-
Notifications
You must be signed in to change notification settings - Fork 4
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
[DPE-2137] Add SBOM generation #31
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Generate SBOM | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yaml | ||
sbom: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Install Syft | ||
run: | | ||
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin | ||
- name: Set tag | ||
run: | | ||
version=$(yq '(.version|split("-"))[0]' rockcraft.yaml) | ||
base=$(yq '(.base|split(":"))[1]' rockcraft.yaml) | ||
echo "tag=${version}-${base}_edge" >> "$GITHUB_ENV" | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: charmed-mysql-rock | ||
- name: Create SBOM | ||
run: syft charmed-mysql_${{env.tag}}_amd64.rock -o spdx-json=charmed-mysql_${{env.tag}}_amd64.rock.spdx.json | ||
- name: Upload SBOM | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: "charmed-mysql_${{env.tag}}_amd64.rock.spdx.json" | ||
name: charmed-mysql_${{env.tag}}_amd64.rock.spdx.json |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dragomirp after some internal discussions, please replace here "main" with "v0.85.0", it should be safe enough to merge it AS IS, until we have a final SBOM Canonical vision. Tnx!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@taurus-forever That doesn't address security concerns—the tag can be moved. Suggest pinning to a commit hash instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@carlcsaposs-canonical I intend to move this to check the image from the registry, so it wouldn't matter if the artefact is potentially changed, but I can't promise it would be this pulse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My point is that
main
andv0.85.0
are essentially the same from a security perspective—in the short term, I think we should either stay withmain
or move to a commit hashThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Running syft at the end against the registry instead of the artefact would address this, since at that point the artefact is already published.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the commit hash, I'm only referring to short-term (i.e. this PR)