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.
More on Kubernetes Security
What are the 4Cs of cloud native security?BeginnerExplain Role, ClusterRole, RoleBinding and ClusterRoleBinding.BeginnerHow do you check what a user or service account is allowed to do?BeginnerWhich RBAC permissions are effectively cluster-admin in disguise?AdvancedHow do service account tokens work now, and what is `automountServiceAccountToken`?IntermediateWhat are the three Pod Security Standards?Beginner