How do you write an admission policy that verifies both the signer identity and an SBOM attestation?
AdvancedProductionSupply Chain Security at Scale
Answer
With Kyverno:
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: verify-acme-images
spec:
validationFailureAction: Enforce
webhookTimeoutSeconds: 30
rules:
- name: signed-by-ci
match:
any:
- resources:
kinds: [Pod]
verifyImages:
- imageReferences: ["ghcr.io/acme/*"]
mutateDigest: true
attestors:
- entries:
- keyless:
subject: "https://github.com/acme/platform-workflows/.github/workflows/build.yml@refs/heads/main"
issuer: "https://token.actions.githubusercontent.com"
attestations:
- type: https://cyclonedx.org/bom
attestors:
- entries:
- keyless:
subject: "https://github.com/acme/platform-workflows/.github/workflows/build.yml@refs/heads/main"
issuer: "https://token.actions.githubusercontent.com"
Pinning the subject to the reusable build workflow means only images built by the paved road are admitted.
More on Supply Chain Security at Scale
How do you design an end-to-end supply-chain security architecture for 200 services?AdvancedWhat does it take to reach SLSA Build Level 3 in practice?AdvancedHow do you use GitHub artifact attestations for build provenance, and how do consumers verify them?IntermediateWhere and how do you store SBOMs at scale?IntermediateWhat does "sign everything" mean in a mature supply chain?IntermediateWhy pin the signer identity to a reusable workflow rather than to each repository?Advanced