ValidatingAdmissionPolicy
A built-in Kubernetes admission check, written in CEL, that rejects requests whose objects break a rule, with no webhook server to run.
In more detail
The policy holds the CEL validations and a message, and a ValidatingAdmissionPolicyBinding says where it applies and whether to deny, warn or audit. Because the API server evaluates it in-process, there is no webhook to go down or time out. A rule that only checks containers can miss initContainers, so good policies check both.
Example
validations:
- expression: "object.spec.containers.all(c, c.image.startsWith('registry.example.com/'))"Related terms
- Common Expression Language — A small, safe expression language from Google that Kubernetes uses to write rules, such as validation checks, inside its own objects.
- admission controller — A Kubernetes API server plugin that checks or changes each request after authentication and authorization, before the object is stored.
- Kyverno — A Kubernetes policy engine that validates, changes or generates resources using policies written in YAML.
Taught in
- Allowed Registries: Admission That Refuses Images — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Signing And Verifying Images With Cosign — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Detection Review: Which Signal Catches It? — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Mock Exam: Seventeen Security Tasks Against The Clock — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Ninety Minutes, Six Domains: Where The Marks Are — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- Same Rule, Two Kinds: Controls And Frameworks — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- Overview Sprint: Four Findings Before The Auditor — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- What Outlives The Fix: Persistence And Privilege Escalation — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- Who Built This Image? Supply Chain And Registries — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- Forty Minutes Of Yes: Admission Control — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- Platform Sprint: Evidence, Order, Proof — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep