Pod Security Standards
Three built-in Kubernetes security profiles, called privileged, baseline and restricted, that define how locked down a pod must be.
In more detail
Privileged allows everything, baseline blocks known ways to gain extra privileges, and restricted enforces current hardening practice such as running as non-root, dropping all Linux capabilities and setting a seccomp profile. The built-in Pod Security admission controller applies them per namespace in enforce, audit or warn mode. They replaced the older PodSecurityPolicy feature, removed in Kubernetes 1.25.
Examples
kubectl label namespace payments pod-security.kubernetes.io/enforce=restrictedlog-shipper violates restricted
needs drop ALL capabilitiesThe baseline and restricted levels block hostPath volumes, privileged containers and host namespaces.Related terms
- Pod Security Admission — The built-in Kubernetes admission controller that applies Pod Security Standards to each namespace according to its labels.
- securityContext — The part of a Kubernetes pod or container spec that sets security options such as user, capabilities, seccomp and read-only root filesystem.
- privileged container — A container started with --privileged, which removes almost all isolation and gives it the powers of root on the host.
- PodSecurityPolicy — An older Kubernetes pod security mechanism that was removed in version 1.25 and replaced by Pod Security Admission.
- runAsNonRoot — A Kubernetes security setting that, when set to true, stops a container from starting if it would run as the root user.
- Linux capabilities — Separate pieces of root power, such as binding low ports or changing file owners, that can be granted or removed one by one.
- seccomp — A Linux kernel feature that blocks a process from making system calls it has no need for.
- hostPath volume — A Kubernetes volume that mounts a directory from the node's own file system into a pod.
- static pod — A pod the kubelet runs directly from a manifest file on the node, without going through the API server.
- admission controller — A Kubernetes API server plugin that checks or changes each request after authentication and authorization, before the object is stored.
Taught in
- Anonymous Access: The Fix That Kills The API Server — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Seccomp: Which Syscalls A Container May Make — Certified Kubernetes Security Specialist (CKS) Exam Prep
- AppArmor: The Guard Docker Desktop Does Not Have — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Pod Security Admission: Created, Never Started — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Mock Exam: Seventeen Security Tasks Against The Clock — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Kubernetes Pod Security Standards: Baseline & Restricted — Cloud Security & DevSecOps Engineering
- Security Frameworks: NIST CSF 2.0, ISO 27001 & CIS — Cybersecurity Fundamentals, GRC & Cryptography
- A Pod That Mounts The Node: Runtime, Pods And Storage — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- Created, But Never Running: Pod Security Admission — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- Fundamentals Sprint: Four Findings, Eight Questions — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- Four Alerts, One Incident: Observability And The Mesh — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- Troubleshooting: OOMKilled, Throttling And Evictions — Kubernetes: Production-Grade Container Orchestration
- securityContext: Nonroot, Capabilities And Seccomp — Kubernetes: Production-Grade Container Orchestration
- Pod Security Admission And Pod Security Standards — Kubernetes: Production-Grade Container Orchestration
- Troubleshooting: Forbidden Requests And Admission Rejections — Kubernetes: Production-Grade Container Orchestration
- Detecting Persistence: Tasks, Registry & Services — Security Operations & Threat Hunting (SOC)