An important part of ensuring software supply chain integrity is performing periodic vulnerability scans on images. Initial scans as part of the build process is necessary, but as new vulnerabilities are discovered the scans must be refreshed. This policy ensures that images, signed with Cosign's keyless ability during a GitHub Actions workflow, have attested vulnerability scans not older than one week. This policy is expected to be customized based upon your signing strategy and applicable to the images you designate.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: require-vulnerability-scanannotations:policies.kyverno.io/title: Require Image Vulnerability Scanspolicies.kyverno.io/category: Software Supply Chain Securitypolicies.kyverno.io/severity: mediumkyverno.io/kyverno-version: 1.9.0policies.kyverno.io/minversion: 1.8.3kyverno.io/kubernetes-version: "1.24"policies.kyverno.io/subject: Podpolicies.kyverno.io/description: An important part of ensuring software supply chain integrity is performing periodic vulnerability scans on images. Initial scans as part of the build process is necessary, but as new vulnerabilities are discovered the scans must be refreshed. This policy ensures that images, signed with Cosign's keyless ability during a GitHub Actions workflow, have attested vulnerability scans not older than one week. This policy is expected to be customized based upon your signing strategy and applicable to the images you designate.spec:validationFailureAction: AuditwebhookTimeoutSeconds: 10failurePolicy: Failrules:- name: scan-not-older-than-one-weekmatch:any:- resources:kinds:- PodverifyImages:- imageReferences:- ghcr.io/myorg/myrepo:*attestations:- predicateType: cosign.sigstore.dev/attestation/vuln/v1attestors:- entries:- keyless:subject: https://github.com/myorg/myrepo/.github/workflows/*issuer: https://token.actions.githubusercontent.comrekor:url: https://rekor.sigstore.devconditions:- all:- key: "{{ time_since('','{{metadata.scanFinishedOn}}','') }}"operator: LessThanOrEqualsvalue: 168h
Ensures that container images used to run Flux controllers in the cluster are signed with valid Cosign signatures. Prevents the deployment of untrusted or potentially compromised Flux images. Protects the integrity and security of the Flux deployment process.
A signed bundle is required
A signed bundle is required.