How does Pod Security Admission enforce those standards?
IntermediateConceptKubernetes Security
Answer
PSA is a built-in admission controller (GA in 1.25, replacing PodSecurityPolicy). You opt in per namespace with labels, choosing a level for each of three modes: enforce rejects pods, audit writes an audit annotation, warn returns a warning to the client.
kubectl label ns shop \
pod-security.kubernetes.io/enforce=restricted \
pod-security.kubernetes.io/enforce-version=latest \
pod-security.kubernetes.io/warn=restricted
Rollout pattern: set warn and audit first, fix violations, then turn on enforce. PSA only checks pods, and it is not customisable; anything beyond the standards needs Kyverno, Gatekeeper or ValidatingAdmissionPolicy.
More on Kubernetes Security
What are the 4Cs of cloud native security?BeginnerWhat happens to a request between `kubectl apply` and etcd from a security point of view?IntermediateExplain 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`?Intermediate