- Where admission controllers sit in the Kubernetes API request flow.
- The difference between mutating and validating webhooks.
- How Gatekeeper and Kyverno implement policy and when to choose each.
securityContext.privileged: true and hostNetwork: true. That Pod had full access to the host network stack and other containers on the node. An attacker exploited a vulnerability in the debug container and escaped the container. RBAC could not prevent this because it does not inspect Pod specs.

- A container runs as root,
- An image is from an untrusted registry,
- Resource requests/limits are missing,
- A container is privileged,
- Required labels are present on new objects.

- Authentication — Who are you?
- Authorization (RBAC) — Are you allowed to perform this action?
- Mutating admission webhooks — Can change the incoming object (first to run).
- Schema validation and built-in admission controllers.
- Validating admission webhooks — Accept or reject the (possibly mutated) object.
- Persist to etcd — Only after all checks pass.

Mutating webhooks can inject defaults, sidecars, or labels before validation. Always design mutating rules with the validating rules in mind so validation evaluates the object that will actually be persisted.
- Mutating webhooks
- Can modify the incoming object.
- Common uses: inject sidecars (logging, service mesh proxies), add default labels/annotations, set default resource requests/limits when omitted.
- Validating webhooks
- Cannot modify objects; they accept or reject them.
- Common uses: block privileged containers, enforce allowed registries, require specific labels, reject Pods that run as root.

Example field condition that enforces no privileged containers:
Many teams run both tools to leverage Gatekeeper’s expressiveness for advanced checks and Kyverno’s ease for mutation and common validations. Both tools are included in cloud-native platform certification exam lists.


- Apply a few high-value validating policies first (image registry whitelist, required labels, no privileged containers, resource limits). These block the most common and risky misconfigurations.
- Use mutating webhooks to enforce defaults and reduce developer friction (inject labels, annotations, or sidecars).
- Test policies in dry-run or audit mode before enforcement to avoid surprising teams. Both Gatekeeper and Kyverno support dry-run modes.
- Keep policy logic simple and well-documented. Complex Rego can be powerful but harder to maintain; Kyverno’s YAML rules are easier to read for Kubernetes operators.
Admission control is a safety net, not a substitute for secure container images, least-privilege RBAC, or host hardening. Combine RBAC, admission controls, image scanning, and runtime defenses for a layered security posture.
- Kubernetes Admission Controllers: https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/
- OPA Gatekeeper: https://open-policy-agent.github.io/gatekeeper/
- Kyverno: https://kyverno.io/