-
Notifications
You must be signed in to change notification settings - Fork 485
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
Improved attestation inspect #1498
Conversation
Signed-off-by: Justin Chadwell <[email protected]>
Signed-off-by: Justin Chadwell <[email protected]>
Signed-off-by: Justin Chadwell <[email protected]>
type provenanceStub struct { | ||
SLSA interface{} `json:",omitempty"` | ||
} |
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.
Provenance > SLSA? I thought it was SLSA > Provenance to keep common denominator first? Like in the future we can have SLSA > VSA.
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.
I think it makes sense to have Type > Format. We have SBOM > SPDX, so I think it makes sense to have Provenance > SLSA.
VSA isn't provenance, so we'd have another "type" for that I think.
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.
Makes sense 👍
Need changes in docs too I think: https://github.com/docker/buildx/blob/master/docs/reference/buildx_imagetools_inspect.md#examples |
Signed-off-by: Justin Chadwell <[email protected]>
Signed-off-by: Justin Chadwell <[email protected]>
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.
LGTM! Are we going to document on docs repo advanced use cases to retrieve list of packages in an SBOM for example?
as.sbom = &sbomStub{ | ||
SPDX: dt, | ||
var spdx struct { | ||
Predicate interface{} `json:"predicate"` |
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.
Bit concerned that there isn't any way to extract the actual attestation. But I guess we can add some special case/command for that later.
⬆️ Follow up to #1444
This includes 3 main changes:
interface{}
types instead ofjson.RawMessage
; this allows them to be accessed using go template notation, e.g.--format "{{ range .SBOM.SPDX.packages }}{{ println .name .versionInfo }}{{ end }}"
.Predicate
field to directly access the predicate of the attestation. In the future, we should to sanity check the subject of the attestation against the pulled image, as well as the predicate type - this should be the responsibility of the go-imageinspect library..Attestations
field, but it seems an edge use-case for now.BUILDKIT_SBOM_SCAN
args). The first SPDX document is added to.SPDX
, while all documents are appended to.SPDXs
- this can allow tools to search through dependencies used in build tooling.