Hardening Kubernetes: Moving away from Pod Security Policies

Pod Security Policies (PSP) are deprecated in K8s 1.21. The industry is moving to Pod Security Standards (PSS) and Admission Controllers like OPA Gatekeeper or Kyverno.

The New Standard

Kubernetes now has built-in labels for namespaces to enforce security levels:

YAML7 lines
apiVersion: v1
kind: Namespace
metadata:
  name: my-secure-ns
  labels:
    pod-security.kubernetes.io/enforce: restricted
    pod-security.kubernetes.io/audit: restricted

Setting this label automatically rejects any Pod that tries to run as Root or mount host paths.


Discover more from C4: Container, Code, Cloud & Context

Subscribe to get the latest posts sent to your email.

Written by

Nithin Mohan TK

Hello Namaste! 👋🏻 I'm an accomplished Enterprise Solution Architect & Engineering Leader with 20+ years of progressive experience architecting, building, and scaling transformative enterprise solutions. ⚜️ Solution Architect / AI & Cloud 📌 Galway, Ireland

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.