Only supplement SBOMs with file-layer info for specified SBOMs#3422
Merged
tonistiigi merged 1 commit intomoby:masterfrom Jan 5, 2023
Merged
Only supplement SBOMs with file-layer info for specified SBOMs#3422tonistiigi merged 1 commit intomoby:masterfrom
tonistiigi merged 1 commit intomoby:masterfrom
Conversation
11ae4cb to
ee27a27
Compare
Previously, we would attempt to add file data for every single SBOM - however, if these SBOMs were taken of layers that were not exported, then these could be wrong. To workaround this, for the file layer details to be added to the resulting SBOM, we require that the scanner add a metadata property to indicate the default value. This is configurable, since in the future we may want behavior that allows the frontend to specify no file layers, or wants an SBOM with layers other than the default. Signed-off-by: Justin Chadwell <me@jedevc.com>
ee27a27 to
2948389
Compare
tonistiigi
approved these changes
Jan 5, 2023
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
⬆️ Follow-up to #3258.
Previously, we would attempt to add file data for every single SBOM - however, if these SBOMs were taken of layers that were not exported, then these could be wrong.
To workaround this, for the file layer details to be added to the resulting SBOM, we require that the scanner add a metadata property to indicate the default value. This is configurable, since in the future we may want behavior that allows the frontend to specify no file layers, or wants an SBOM with layers other than the default.
There are some other possible solutions in the future: the "proper" way to do this would be to attach a second ref to every single attestation, so that we could track exactly what part of the build the attestation was about, so that we could then correctly identify which part of the layer chain we should extract file-layer info from. However, this would be a major refactor, and is something we can add later without loss of backwards compatibility in the future 🎉