-
Notifications
You must be signed in to change notification settings - Fork 222
Create an SBOM when publishing #3459
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
base: main
Are you sure you want to change the base?
Conversation
5750e41 to
5399add
Compare
c3bfc47 to
05ce0ec
Compare
8d4e903 to
386b7d1
Compare
|
@dgannon991 Do you have a sample of how the SBOM file will look? |
|
@kichristensen - this is the output for the porter-test bundle: {
"spdxVersion": "SPDX-2.3",
"dataLicense": "CC0-1.0",
"SPDXID": "SPDXRef-DOCUMENT",
"name": "localhost:5000/porter-hello",
"documentNamespace": "https://anchore.com/Porter/image/localhost-5000/porter-hello-c33f9e71-51f5-4afa-bab5-26c751faa5b6",
"creationInfo": {
"licenseListVersion": "3.27",
"creators": [
"Organization: Anchore, Inc",
"Tool: Porter-"
],
"created": "2025-10-07T20:43:18Z"
},
"packages": [
{
"name": "localhost:5000/porter-hello",
"SPDXID": "SPDXRef-DocumentRoot-Image-localhost-5000-porter-hello",
"versionInfo": "v0.1.0",
"supplier": "NOASSERTION",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"checksums": [
{
"algorithm": "SHA256",
"checksumValue": "ed53c608e21e4d441eb1697a725065446018d90b3b1c6a47873f8ad12a86f671"
}
],
"licenseConcluded": "NOASSERTION",
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
"referenceLocator": "pkg:oci/localhost%3A5000%2Fporter-hello@sha256%3Aed53c608e21e4d441eb1697a725065446018d90b3b1c6a47873f8ad12a86f671?arch=&tag=v0.1.0"
}
],
"primaryPackagePurpose": "CONTAINER"
}
],
"relationships": [
{
"spdxElementId": "SPDXRef-DOCUMENT",
"relatedSpdxElement": "SPDXRef-DocumentRoot-Image-localhost-5000-porter-hello",
"relationshipType": "DESCRIBES"
}
]
} |
Signed-off-by: David Gannon <[email protected]>
Signed-off-by: David Gannon <[email protected]>
Signed-off-by: David Gannon <[email protected]>
7e5d355 to
4c3de09
Compare
Signed-off-by: David Gannon <[email protected]>
4c3de09 to
846b4d0
Compare
Signed-off-by: David Gannon <[email protected]>
|
@dgannon991 Does the SBOM also handled other images part of the bundle, in the |
kichristensen
left a comment
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.
How big an impact does this feature have on the size the porter binary? A lot of new dependencies have been pulled in.
| "path/filepath" | ||
| "strings" | ||
|
|
||
| _ "modernc.org/sqlite" // required for rpmdb and other features |
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.
Can this be moved into sbom.go instead? The module has an init function which will be triggered on import
| return log.Errorf("failed to create SBOM file %s: %w", sbomPath, err) | ||
| } | ||
| defer func() { | ||
| err = errors.Join(err, f.Close()) |
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.
Do you want this error to be returned from the function? If so have you tested that, I don't think this is the error that will be returned. I'm pretty sure the deferred function is ran after the return value have been created, meaning this isn't the error that will be returned. Not a 100% sure
| --preserve-tags Preserve the original tag name on referenced images | ||
| -r, --reference string Use a bundle in an OCI registry specified by the given reference. | ||
| --registry string Override the registry portion of the bundle reference, e.g. docker.io, myregistry.com/myorg | ||
| --sbom-file string Generate a Software Bill of Materials (SBOM) for the bundle at this location. |
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.
Should we mention the SBOM file format here?
|
We should also add some documentation around this |
What does this change
Adds a flag onto the publish command which will generate an SBOM for the published image.
What issue does it fix
Closes #2930
Notes for the reviewer
This is currently an extreme draft version to get feedback, none of the following have been done :D
Checklist