Interview › Security & DevSecOps
What is the difference between a validating and a mutating admission webhook? [Intermediate]
Answer
A validating admission webhook approves or denies an API request. A mutating admission webhook modifies the object before validation and persistence. Mutating webhooks set defaults or inject config; validating webhooks enforce rules.
Technical explanation
Mutating examples include injecting a sidecar, adding labels, setting default resource requests, or adding securityContext defaults.
Validating examples include denying privileged pods, public LoadBalancers, missing owners, or untrusted images.
Mutation should be predictable and validation should produce clear messages so developers understand how to fix violations.
Hands-on example
Example: a mutating webhook adds runAsNonRoot: true and seccompProfile: RuntimeDefault when missing. A validating webhook denies the pod if it still requests privileged=true or hostPath volumes in a restricted namespace.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Security & DevSecOps interview questions
- What is OPA, and what is the Rego language used for? [Intermediate]
- How do you apply least privilege to service-to-service communication (e.g., with Istio mTLS)? [Intermediate]
- What is secrets management, and how does HashiCorp Vault work at a high level? [Intermediate]
- What is workload identity, and how does it remove static credentials? [Intermediate]
- What is encryption at rest versus in transit, and how do you ensure both? [Advanced]
- What is the difference between symmetric and asymmetric encryption? [Advanced]
- What is certificate management, and how do tools like cert-manager help? [Advanced]
- What is the difference between authentication and authorization? [Advanced]