Wiz Guide Details Migrating Kubernetes from Pod Security Policies to Pod Security Standards

· Original article ↗

Summary

Wiz outlines how to migrate Kubernetes workloads from deprecated Pod Security Policies to Pod Security Admission, including staged enforcement, workload exceptions, managed-cluster limitations, and post-migration security checks.

Key points

  • Kubernetes deprecated Pod Security Policies in version 1.21 and removed them in 1.25; Pod Security Admission became stable in 1.25.
  • Wiz says its research across hundreds of cloud environments found 76% could use both PSPs and PSSs, while 2% were on Kubernetes 1.25.
  • For new or policy-free workloads, administrators can use server-side dry runs to identify violations before enforcing a Pod Security Standard.
  • For existing workloads, the guide recommends starting with audit or warn modes, addressing violations, and then enabling enforcement; retain PSP until PSA is enforcing where supported, on versions 1.24 and below.
  • Workloads requiring privileges beyond baseline or restricted profiles may need namespace separation, exemptions, or an external admission controller.
  • The guide warns that managed-cluster namespaces may be exempt, completed pods can still block policy application, and image-level settings may evade admission-time checks.
  • After migration, restrict who can create namespaces or change their Pod Security labels, and review permissions that allow namespace updates.

Article Details

Defense Focus
Safely migrate Kubernetes workloads from Pod Security Policies to Pod Security Admission and Pod Security Standards, then monitor policy coverage and permissions that could weaken namespace controls.
Detection Methods
  • Use server-side dry runs when applying namespace security labels to identify existing workloads that violate the selected Pod Security level.
  • Apply audit or warn modes before enforcement and review the resulting policy-violation warnings for newly created pods.
  • Use Wiz's built-in Cloud Configuration Rule to identify workloads running without an assigned Pod Security Policy at the cluster level.
  • Assess clusters and namespaces with the built-in Pod Security Standards frameworks to identify suitable policy levels.
  • Use a query to identify Kubernetes principals that can modify namespace Pod Security levels.
  • Use runtime checks at container startup to catch images configured to run as root despite pod-level security settings.
Data Sources
  • Kubernetes cluster, namespace, pod, and workload configuration
  • Pod Security Admission audit, warn, and enforcement results
  • Kubernetes API server request telemetry, including requests shown with kubectl --v=8
  • Kubernetes API scan objects
  • Kubernetes user and service-account permissions to patch or update namespaces
  • Container runtime startup checks
Rule Types
  • Wiz Cloud Configuration Rule for workloads without an assigned Pod Security Policy
  • Pod Security Standards assessment frameworks
  • Wiz Admission Controller rules for requiring an assigned namespace security level and disallowing the privileged level
Platforms
  • Kubernetes
  • AKS
  • EKS
  • GKE
Defensive Actions
  • Begin migration before upgrading to Kubernetes 1.25, when Pod Security Policies are removed.
  • Test policy levels with server-side dry runs before applying changes.
  • For existing workloads, use audit or warn modes first, review violations, remediate workloads, and then enforce the selected level.
  • Where supported on Kubernetes 1.24 and below, keep Pod Security Policies active until Pod Security Admission is enforcing.
  • Separate workloads that require special privileges into different namespaces where practical; use exemptions selectively, and prefer the privileged level over leaving a namespace without a policy.
  • Allow only explicitly labelled namespaces and review which users and service accounts can patch or update namespace security labels.
  • Use Wiz Admission Controller rules to require an assigned namespace security level and to prevent assignment of the privileged level where appropriate.
  • Identify and remove completed or otherwise stale pods that block policy application.

Vendors

Products

Tools

Related Articles