Filter frontend provenance attestations#3416
Conversation
|
@tonistiigi in changing the tests to use SBOMs, I hit an issue with what I think is the history API? |
tonistiigi
left a comment
There was a problem hiding this comment.
I'm not sure I understand these many commits changing the "attestation reason" handling. Iiuc we just need to check the predicate type does not match SLSA, unless attestation is made internally with ContentCallback. A simple for loop would do.
Signed-off-by: Justin Chadwell <me@jedevc.com>
This isn't anywhere at the moment, but we should be consistent here to help avoid any future logic issues. Signed-off-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
6583ddb to
85060b0
Compare
|
Removed the reason handling, we just check against the SLSA predicate type now, in the same place where we do checking of Paths, etc. The rest of the commits are minor fixups and checks that I found while writing the patch, that we should take as well - happy to split those up into a separate PR if neccessary. |
Signed-off-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
af1db32 to
b587aeb
Compare
| eg.Go(func() error { | ||
| switch att.Kind { | ||
| case gatewaypb.AttestationKindInToto: | ||
| if strings.HasPrefix(att.InToto.PredicateType, "https://slsa.dev/provenance/") { |
There was a problem hiding this comment.
No need to check .. in the URL path?
I assume not needed, but posting this for confirmation
There was a problem hiding this comment.
I don't think we do - my understanding is that end-users should treat as essentially opaque strings and not attempt to resolve them: https://github.com/in-toto/attestation/blob/main/spec/field_types.md#TypeURI.
The only reason we do the strings.HasPrefix here instead of comparing directly against the strings in the in-toto library is to match against different versions (including unreleased ones).
Signed-off-by: Justin Chadwell <me@jedevc.com>
b587aeb to
13a24b7
Compare
The frontend isn't allowed to create provenance attestations - only buildkit is allowed to do this.
We do the check in two stages: