Notary
Verify CNCF Notary format signatures using X.509 certificates.
The logical structure of an verifyImages rule is shown below:
Each rule contains the following common configuration attributes:
type
: the signature type. Sigstore Cosign and Notary are supported.imageReferences
: a list of image reference patterns to matchrequired
: enforces that all matching images are verifiedmutateDigest
: converts tags to digests for matching imagesverifyDigest
: enforces that digests are used for matching imagesrepository
: use a different repository for fetching signaturesA verifyImages rule can contain a list of attestors
or authorities used to check the attached image signature. The type of attestor supported will vary based on the tool used to sign the image. For example, Sigstore Cosign supports public keys, certificates, and keyless attestors.
A verifyImages rule can contain a list of attestations
i.e., signed metadata, to checked for the image. The nested attestations.attestors
are used to verify the signature of the attestation. Any JSON data in an attestation can be verified using a set of attestations.conditions
.
The rule mutates matching images to add the image digest, when mutateDigest is set to true (which is the default), if the digest is not already specified. Using an image digest has the benefit of making image references immutable and prevents spoofing attacks. Using a digest helps ensure that the version of the deployed image does not change and, for example, is the same version that was scanned and verified by a vulnerability scanning and detection tool.
The imageVerify rule first executes as part of the mutation webhook as the applying policy may insert the image digest. The imageVerify rules execute after other mutation rules are applied but before the validation webhook is invoked. This order allows other policy rules to first mutate the image reference if necessary, for example, to replace the registry address, before the image signature is verified.
The imageVerify rule is also executed as part of the validation webhook to apply the required
and verifyDigest
checks:
required
is set to true
(default) each image in the resource is checked to ensure that an immutable annotation that marks the image as verified is present.verifyDigest
rule is set to true
(default) each image is checked for a digest.The imageVerify
rule can be combined with auto-gen so that policy rule checks are applied to Pod controllers.
The attestors
declaration specifies one or more ways of checking image signatures or attestations. The attestors.count
specifies the required count of attestors in the entries
list that must be verified. By default, and when not specified, all attestors are verified.
The attestors.count
specifies the required count of attestors in the entries list that must be verified. By default, and when not specified, all attestors are verified.
For additional details please reference a section below for the solution used to sign the images and attestations:
Verify CNCF Notary format signatures using X.509 certificates.
Verify Sigstore Cosign format signatures and attestations using keys, certificates, or keyless attestors.