Interview Prep/DevSecOps/Kubernetes Security

What happens to a request between `kubectl apply` and etcd from a security point of view?

IntermediateConceptKubernetes Security
Answer

The API server runs every request through three gates in order: authentication (who are you), authorisation (are you allowed this verb on this resource), and admission (mutating, then schema validation, then validating). Only then is the object persisted to etcd.

flowchart LR
  A["kubectl apply"] --> B["Authentication: cert, OIDC token, SA token"]
  B --> C["Authorization: Node, RBAC, Webhook"]
  C --> D["Mutating admission"]
  D --> E["Schema validation"]
  E --> F["Validating admission: PSA, VAP, Kyverno, Gatekeeper"]
  F --> G["etcd"]

A failure at any gate returns 401 (authn), 403 (authz) or an admission denial message, and nothing is stored.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Kubernetes Security