Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push directly to ironbank from github actions #6448

Draft
wants to merge 27 commits into
base: master
Choose a base branch
from
Draft

Conversation

Amndeep7
Copy link
Contributor

@Amndeep7 Amndeep7 commented Dec 4, 2024

This pr has what is necessary to skip the sophos factory step and directly push to ironbank with as close an analogue to what we were doing in there as possible. Key differences are the variables and directly hitting the api instead of using the cli tool.

I was able to develop a proof of concept using the heimdall lite 'mainline' workflow to show that we can successfully create issues, branches, and MRs with the correct type of changes on Iron Bank. You can see that from commits before 32fe35f and comparing them to the issues/branches/MRs that were created (and closed) in the ironbank repo: https://repo1.dso.mil/dsop/mitre/security-automation-framework/heimdall2.

Work to do:

  • See if it's possible to replace the user.email with the email of the person doing the release instead of hardcoding in my email
  • Set up the mainline heimdall iron bank repo
  • Set up the release heimdall-lite iron bank repo
  • Set up the mainline heimdall-lite iron bank repo
  • Update the mainline heimdall workflow to include a mostly similar set of changes as in this pr (guidance on what will likely need to be changed provided in the comments)
  • Update the mainline heimdall-lite workflow - keep in mind that urls will need to change to point at the heimdall-lite repo instead of the heimdall repo for ironbank/dockerhub/etc
  • Update the release heimdall-lite workflow
  • Add appropriate labels (status:verification) to issue/mr

Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
…nk unless i do an interactive login session which is not possible in this ci setting

Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
…g the issue

Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
@Amndeep7 Amndeep7 changed the title test workflow dispatch Research spike to push directly to ironbank Dec 26, 2024
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
…s so that maybe the shell expansion happens

Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
…anch name, added the directive to delete the branch on merge, and am trying everything on the minimal set of perms again

Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
…e in heimdall server release

Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
@Amndeep7 Amndeep7 changed the title Research spike to push directly to ironbank Push directly to ironbank from github actions Dec 28, 2024
@Amndeep7 Amndeep7 requested review from wdower and em-c-rod December 28, 2024 00:19
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
…hardcoded in

Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
sed -i s/HEIMDALL_VERSION=\.\*/HEIMDALL_VERSION=${{ steps.format-tag.outputs.replaced }}/ Dockerfile
git diff
git add hardening_manifest.yaml Dockerfile
git -c "user.name=Automated Heimdall Release" -c "user.email=saf@groups.mitre.org" commit -s -m "Updating Heimdall to ${{ steps.format-tag.outputs.replaced }}"
Copy link
Contributor

@em-c-rod em-c-rod Jan 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you still want to change the user.email? Using saf@groups.mitre.org seems appropriate to me.

@@ -9,18 +9,27 @@ on:
description: 'Version'
required: true

env:
IRONBANK_HEIMDALL_PROJECT_ID: 5450 # this is for heimdall (non mainline) - I think these can be in-line envs instead of supplied by github repo/org level secrets/values since each push/release workflow will have a unique ironbank id due to the mainline vs release + heimdalllite vs heimdall matrix
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not fully following this comment. Why is it a set number id each release workflow ironbank id is unique? If you give me some more clarity on this, we can wordsmith this comment a bit.

@em-c-rod
Copy link
Contributor

em-c-rod commented Jan 10, 2025

#4727

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants