mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-30 03:15:05 +00:00
fix: subject and issuer validation when attestations are present (#4786)
Signed-off-by: praddy26 <pradeep.vaishnav4@gmail.com> Signed-off-by: praddy26 <pradeep.vaishnav4@gmail.com> Co-authored-by: shuting <shuting@nirmata.com>
This commit is contained in:
parent
4cb171c980
commit
4e1c1e6785
1 changed files with 14 additions and 0 deletions
|
@ -279,6 +279,20 @@ func fetchAttestations(opts Options) (*Response, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
payload, err := extractPayload(signatures)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err := matchCertificate(signatures, opts.Subject, opts.Issuer, opts.AdditionalExtensions); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = checkAnnotations(payload, opts.Annotations)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
logger.V(3).Info("verified images", "signatures", len(signatures), "bundleVerified", bundleVerified)
|
||||
inTotoStatements, digest, err := decodeStatements(signatures)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue