{
  "schemaVersion": "ebb.rule.v1",
  "id": "kubernetes.policy.podsecuritypolicy.v1beta1.removed",
  "ecosystem": "kubernetes",
  "purl": "pkg:generic/kubernetes/policy/PodSecurityPolicy",
  "affectedVersions": "vers:semver/1.0.0-beta.1",
  "event": "removed",
  "severity": "high",
  "title": "PodSecurityPolicy policy/v1beta1 is no longer served",
  "summary": "The Kubernetes Deprecated API Migration Guide states that the policy/v1beta1 API version of PodSecurityPolicy is no longer served as of v1.25, which was released on 2022-08-23.",
  "replacement": "Pod Security Admission or a 3rd party admission webhook",
  "deadline": "2022-08-23",
  "sources": [
    {
      "title": "Kubernetes Deprecated API Migration Guide",
      "url": "https://kubernetes.io/docs/reference/using-api/deprecation-guide/",
      "accessedAt": "2026-10-17"
    },
    {
      "title": "Kubernetes v1.25: Combiner (release announcement, 2022-08-23)",
      "url": "https://kubernetes.io/blog/2022/08/23/kubernetes-v1-25-release/",
      "accessedAt": "2026-10-17"
    }
  ],
  "provenance": {
    "observedAt": "2026-10-17",
    "reviewedAt": "2026-10-17",
    "reviewer": "arminazimi"
  },
  "migration": {
    "constraints": [
      "PodSecurityPolicy has no drop-in replacement: the admission controller was removed together with the API, so the policy must be re-expressed.",
      "Decide the intended Pod Security Standard (privileged, baseline, or restricted) for each namespace the policy covered before changing anything.",
      "Remove Roles and ClusterRoles that grant `use` on the PodSecurityPolicy once it is gone."
    ],
    "steps": [
      {
        "id": "choose-replacement",
        "title": "Choose a replacement policy",
        "instructions": "Replace the PodSecurityPolicy with Pod Security Admission labels on the affected namespaces, or with a third-party admission webhook, as the Kubernetes migration guide describes.",
        "targets": "declaration"
      },
      {
        "id": "remove-policy-rbac",
        "title": "Remove references to the policy",
        "instructions": "Delete the PodSecurityPolicy manifest and any Role or ClusterRole rule that grants `use` on it.",
        "targets": "all"
      }
    ],
    "verification": [
      {
        "command": "kubectl label --dry-run=server --overwrite ns --all pod-security.kubernetes.io/enforce=baseline",
        "purpose": "Preview which existing pods would violate the chosen Pod Security Standard, without changing any namespace."
      },
      {
        "command": "kubeconform -strict -summary <manifest-paths>",
        "purpose": "Validate the remaining manifests against the target Kubernetes version."
      }
    ]
  }
}
