-
Notifications
You must be signed in to change notification settings - Fork 71
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
Add ContainerImageSignature type to verifier client #521
Conversation
/gcbrun |
2 similar comments
/gcbrun |
/gcbrun |
launcher/agent/agent.go
Outdated
verifierSigs, err := convertToContainerSignatures(signatures) | ||
if err != nil { | ||
return nil, fmt.Errorf("error converting container signatures: %v", err) | ||
} |
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.
The current behavior of converting sigs seems to return on error. However, this violates the previous behavior which is logging on error and sending any valid signature found to verifier. We don't want a single failure of conversion to break the entire signature verification process.
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.
Done. Changed the conversion function to be for one signature (not the full list) and log/continue on error instead of returning.
/gcbrun |
448fccc
to
77f20c7
Compare
/gcbrun |
OCI signatures are converted to a different structure in the Rest client for GCA. With the addition of ITA, we want to send a similar structure, so the conversion should be done at a higher level - the agent - rather than being verifier-specific.
The verifier client package will have its own
ContainerSignature
type - which contains only the fields that will be sent to verifier services - rather than using the fulloci.Signature
object.fakesignature
is also updated to remove implementations forPublicKey
andSigningAlgorthm
since the correspondingfakeverifier
will use the newContainerSignature
type that lacks these methods. Instead,fakeverifier
will parse the pubkey and sigalg from the payload - similar to how this is done in the actual verification process.verifier/client
,VerifyAttestationRequest.ContainerImageSignatures
type is changed from[]ociSignature
to[]*ContainerSignature
verifier/fake
,verifyContainerImageSignature()
is changed toextractClaims()
verifier/oci/cosign/fakesignature
,fakeSig.PublicKey()
andfakeSig.SigningAlgorithm
now return "not implemented" errors. Additionally,fakeSig.Payload()
returns "f.data,f.sigAlg" rather than the data alone.verifier/rest
,convertOCISignatureToREST
is removed