Skip to main content

enforce-policy-as-code

Enforces policy-as-code in Kubernetes using OPA Gatekeeper or Kyverno to ensure compliance and prevent security misconfigurations.

Install this skill

or
36/100

Security score

The enforce-policy-as-code skill was audited on Mar 3, 2026 and we found 20 security issues across 2 threat categories. Review the findings below before installing.

Categories Tested

Security Issues

low line 66

Webhook reference - potential data exfiltration

SourceSKILL.md
66--set validatingWebhookFailurePolicy=Fail \
low line 73

Webhook reference - potential data exfiltration

SourceSKILL.md
73# Check webhook configuration
low line 74

Webhook reference - potential data exfiltration

SourceSKILL.md
74kubectl get validatingwebhookconfigurations gatekeeper-validating-webhook-configuration -o yaml
low line 96

Webhook reference - potential data exfiltration

SourceSKILL.md
96# Check webhook configurations
low line 97

Webhook reference - potential data exfiltration

SourceSKILL.md
97kubectl get validatingwebhookconfigurations kyverno-resource-validating-webhook-cfg
low line 98

Webhook reference - potential data exfiltration

SourceSKILL.md
98kubectl get mutatingwebhookconfigurations kyverno-resource-mutating-webhook-cfg
low line 118

Webhook reference - potential data exfiltration

SourceSKILL.md
118- webhook
medium line 128

Webhook reference - potential data exfiltration

SourceSKILL.md
128**Expected:** Policy engine pods running with multiple replicas. CRDs installed (ConstraintTemplate, Constraint for Gatekeeper; ClusterPolicy, Policy for Kyverno). Validating/mutating webhooks active.
medium line 132

Webhook reference - potential data exfiltration

SourceSKILL.md
132- Verify webhook endpoints reachable: `kubectl get endpoints -n gatekeeper-system`
medium line 133

Webhook reference - potential data exfiltration

SourceSKILL.md
133- Check for port conflicts or certificate issues in webhook logs
medium line 180

Webhook reference - potential data exfiltration

SourceSKILL.md
180**Expected:** ConstraintTemplates/ClusterPolicies created successfully. Constraints show status "True" for enforcement. No errors in policy definitions. Webhook begins evaluating new resources against
medium line 239

Webhook reference - potential data exfiltration

SourceSKILL.md
239- Verify webhook is processing requests: `kubectl logs -n gatekeeper-system -l app=gatekeeper`
medium line 241

Webhook reference - potential data exfiltration

SourceSKILL.md
241- Test webhook connectivity: `kubectl run test --rm -it --image=busybox --restart=Never`
medium line 242

Webhook reference - potential data exfiltration

SourceSKILL.md
242- Review webhook failure policy (Ignore vs Fail)
medium line 284

Webhook reference - potential data exfiltration

SourceSKILL.md
284- Check mutation webhook is enabled: `kubectl get mutatingwebhookconfiguration`
medium line 385

Webhook reference - potential data exfiltration

SourceSKILL.md
385- [ ] Validating and mutating webhooks active and reachable
medium line 399

Webhook reference - potential data exfiltration

SourceSKILL.md
399- **Webhook Failure Policy**: `failurePolicy: Fail` blocks all resources if webhook unavailable. Use `Ignore` for non-critical policies, but understand security implications. Test webhook availability
medium line 411

Webhook reference - potential data exfiltration

SourceSKILL.md
411- **Performance Impact**: Policy evaluation adds latency to admission. Keep policies efficient, use appropriate matching criteria, monitor webhook latency metrics.
low line 57

External URL reference

SourceSKILL.md
57helm repo add gatekeeper https://open-policy-agent.github.io/gatekeeper/charts
low line 80

External URL reference

SourceSKILL.md
80helm repo add kyverno https://kyverno.github.io/kyverno/
Scanned on Mar 3, 2026
View Security Dashboard