How would you enforce "only signed images from our registry" in the cluster?
IntermediateProductionSecurity Hardening & Compliance
Answer
A Kyverno ClusterPolicy with verifyImages checks the Cosign signature against a trusted identity (OIDC issuer and subject of your CI) and rejects others, together with a rule restricting registries to 123456789012.dkr.ecr.*.amazonaws.com/*. Start in Audit mode, review violations, then switch to Enforce.
validationFailureAction: Enforce
rules:
- name: verify-signature
verifyImages:
- imageReferences: ["123456789012.dkr.ecr.ap-south-1.amazonaws.com/*"]
More on Security Hardening & Compliance
What is the baseline security checklist for a production cluster?BeginnerWhy should containers run as non-root?BeginnerHow should human access to the cluster be managed?BeginnerWhat is the purpose of image scanning in CI and in the cluster?BeginnerWhy not store secrets in Git or in ConfigMaps?BeginnerWhat is a default-deny NetworkPolicy baseline?Beginner