GitOps & ArgoCD (50 Qs)•Part 3: Enterprise Scale, Security & Edge GitOps (Senior / Staff)
How do you enforce Policy as Code with Kyverno or Gatekeeper in GitOps?
senior LevelSecurity & Auth
In Simple Words:
GitOps ensures what is in Git gets deployed, but does not prevent a developer from committing an insecure manifest (e.g. running containers as root or missing CPU limits).
- Shift-Left in CI: Run
conftestorkyverno-cli testinside GitHub Actions to fail PRs that violate security policies before they are merged. - In-Cluster Admission Control: Kyverno or OPA Gatekeeper runs in Kubernetes and blocks non-compliant resources even if ArgoCD attempts to apply them.