| name | opa-image-security-templates |
| description | OPA image security policies for container registry allowlisting, digest enforcement, and signature verification in Kubernetes. |
OPA Image Security Templates
When to Use This Skill
Image security policies control which container images can run in your cluster. These templates enforce registry allowlists, require immutable digests, and validate cryptographic signatures.
Image Tags Are Mutable
Tags like latest or v1.2.3 can be overwritten by attackers who compromise registries. Use digest-based references (sha256:...) for immutable deployments.
When to Apply
Scenario 1: Block Public Registries
Prevent deployment of images from untrusted sources:
Scenario 2: Prevent Tag Mutation
Require digest-based image references:
Scenario 3: Block Vulnerable Images
Reject images with known CVEs:
Scenario 4: Verify Build Provenance
Validate cryptographic signatures on all images:
Implementation
See the full implementation guide in the source documentation.
Examples
See examples.md for code examples.
Full Reference
See reference.md for complete documentation.
Related Patterns
- OPA Templates Overview
- OPA Pod Security
- Kyverno Image Validation
References