What problem does it solve?
Security rules enforced through manual review or documentation drift out of sync and cannot block non-compliant Kubernetes workloads or pipeline changes. This Skill provides a concrete workflow for codifying organizational policies as version-controlled, testable, and enforceable rules using Open Policy Agent and Gatekeeper.
Core Features & Use Cases
- Kubernetes Admission Control: Deploy Gatekeeper via Helm and define ConstraintTemplates and Constraints that deny privileged containers, missing resource limits, and missing labels.
- Local and CI Policy Testing: Validate Kubernetes manifests, Terraform, and Dockerfiles against Rego policies with conftest, wired into GitHub Actions so violations fail the pipeline.
- Safe Rollout Guidance: Start in warn mode, remediate, then switch to deny, with verification steps that prove the webhook actually rejects violating resources.
- Use Case: A platform team needs to stop teams from deploying privileged containers and untagged images across shared clusters. They install Gatekeeper, apply deny constraints for privileged pods and :latest tags, and add a conftest job to every pull request touching k8s/ or terraform/.
Quick Start
Install Gatekeeper with Helm, apply the provided ConstraintTemplates and deny constraints, then run conftest against a manifest using a :latest image to confirm the policy fails the check.