Agent skill
opa-policy-templates
OPA Gatekeeper policy templates overview. 20 production-ready constraint templates for pod security, image validation, RBAC, and resource governance.
Install this agent skill to your Project
npx add-skill https://github.com/adaptive-enforcement-lab/claude-skills/tree/main/plugins/enforce/skills/opa-policy-templates
SKILL.md
OPA Policy Templates
When to Use This Skill
Deploy in Audit Mode First
Use
enforcementAction: dryruninitially. Existing resources may violate constraints. Monitor violations for 48 hours usingkubectl get constraints, fix non-compliant resources, then switch todeny.
Production-ready OPA/Gatekeeper constraint templates for Kubernetes admission control. 20 policies covering pod security, image validation, RBAC, and resource governance. Each template includes complete Rego implementation, constraint examples, customization options, validation commands, and real-world use cases.
Implementation
Standard deployment workflow for all templates:
See examples.md for detailed code examples.
Comparison
Choosing between OPA/Gatekeeper and Kyverno depends on your team's expertise and requirements:
Use OPA/Gatekeeper When
- You need maximum flexibility in policy logic (Rego is Turing-complete)
- Your team has Rego expertise or investment in OPA across multiple systems
- You require cross-platform policy (Kubernetes, Terraform, Envoy, etc.)
- Policies involve complex conditional logic or multi-resource validation
- You're building a policy platform for enterprise governance
Use Kyverno When
- You want Kubernetes-native YAML policies (no DSL learning curve)
- You need mutation and generation features (OPA is validation-only)
- Your team prefers JMESPath over Rego for data extraction
- You want faster time-to-value with simpler policies
- You're new to policy-as-code and want quick adoption
See Decision Guide → for detailed comparison and migration strategies.
Examples
See examples.md for code examples.
Full Reference
See reference.md for complete documentation.
Related Patterns
- Kyverno Templates →
- Decision Guide →
- OPA/Kyverno Comparison →
- Migration Guide →
- Template Library Overview →
References
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
github-token-permissions-overview
Understanding GITHUB_TOKEN scope, default permissions, and implementing least-privilege principle for GitHub Actions workflows.
secure
Find and fix security issues before they become incidents. Vulnerability scanning, SBOM generation, supply chain security, and secure authentication workflows.
complete-workflow-examples
Copy-paste hardened CI/CD workflows with SHA-pinned actions, minimal GITHUB_TOKEN permissions, OIDC authentication, and comprehensive security scanning for GitHub Actions.
ephemeral-runner-patterns
Disposable runner patterns for GitHub Actions. Container-based, VM-based, and ARC deployment strategies with complete state isolation between jobs.
action-pinning-overview
Why pinning GitHub Actions to SHA-256 commits matters for supply chain security. Attack vectors from unpinned actions and comparison of tag vs SHA pinning.
github-actions-security-patterns-hub
Complete security patterns for GitHub Actions covering action pinning, GITHUB_TOKEN permissions, third-party action risks, secret management, and runner security.
Didn't find tool you were looking for?