-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Introduce attestation metadata #3342
Conversation
We can now attach a reason for why each attestation was generated, which will in future allow us to include/exclude specific attestation types from exporters if desired. Signed-off-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
@@ -68,6 +66,11 @@ func ProvenanceProcessor(attrs map[string]string) llbsolver.Processor { | |||
} | |||
} | |||
|
|||
var inlineOnly bool | |||
if v, err := strconv.ParseBool(attrs["inline-only"]); v && err == nil { |
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'm not a fan of inline-only
as the name of the option in hindsight. 1. It has a different meaning to inline
for the exporters, and 2. it's not clear what property makes image/oci inline
but not local/tar.
Other ideas welcome here 🎉
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'm not a fan of inline-only
attach
/ embed
maybe?
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.
In order to support the buildx case this should also change the mode defaults for provenance and remove mode=disabled
.
|
Signed-off-by: Justin Chadwell <me@jedevc.com>
12e36ad
to
8e107a6
Compare
This will be useful to help with default values for docker/buildx#1412.
With this PR, buildx can attach the option
--opt attest:provenance=mode=min,inline-only=true
. Thisinline-only
option is propagated through attestation metadata to the exporter, where it can be filtered out for the local/tar exporters, while being included for the image/oci/docker exporters. We could achieve similar functionality if we attempted to explicitly modify the exporter properties in buildx, but this would be overly complex logic to put into the client.Additionally, I've added a
reason
field to the metadata, which can be optionally added to the metadata on attestation creation indicating the purpose of the attestation - in the future, this could be used by the exporter to filter out specific attestations for exporters (will be useful when we support multiple exporters, if different attestation output is desired). We could also (maybe) use the metadata in the SBOM scanner component to detect if the scanner has already run instead of relying on checking the predicate types.