Policy Classification | Purpose of Policy | Policy Description | Intercepted Objects | Running Mode |
Deletion Protection | Clusters with existing nodes cannot be deleted. | Clusters with any nodes (regular nodes, native nodes, registered nodes) must have the nodes decommissioned before deletion. | Cluster | Default deny |
Policy Classification | Purpose of Policy | Policy Description | Intercepted Objects | Running Mode |
Deletion Protection | Namespaces with existing pods cannot be deleted. | If there are pods in the namespace, you must clear them before deleting the namespace. | Namespace | Default dryrun |
Deletion Protection | CRDs with existing CRs cannot be deleted. | If there is a cr resource created under the apiversion defined by crd, the cr must be cleared before the crd can be deleted. | CRD | Default dryrun |
Deletion Protection | Unblocked Nodes cannot be deleted. | Node in the ready state cannot be deleted directly when it is in a non-blocking condition. | Node | Default does not create a policy instance. |
Deletion Protection | CoreDNS Component Deletion Protection | Prohibit deletion of the Service, ConfigMap, and Deployment of the CoreDNS component. | Deployment,Service,ConfigMap | Default does not create a policy instance. |
Deletion Protection | Resource Deletion Protection | Resources (Service, Ingress, Deployment, StatefulSet) with specified Labels cannot be deleted. | Service,Ingress,Deployment,StatefulSet | Default does not create a policy instance. |
Deletion Protection | PV in binding state cannot be deleted | A PersistentVolume cannot be deleted if it is in a Bound status. | PV | Default does not create a policy instance. |
Policy Control | Forbidden to mount the specified volume type. | Restrict mountable volume types to the user-specified type. | Pod | Default does not create a policy instance. |
Policy Control | Forbid the image pull policy from using Always. | Forbid containers from using the Always image pull policy, reduce access to the mirror repository. | Pod | Default does not create a policy instance. |
Policy Control | Container Image Access Restrictions | Only allow pulling images from specified repositories. | Pod | Default does not create a policy instance. |
Policy Control | Forbidden to deploy unknown DaemonSets. | Only allow deployment of specified DaemonSets. | DaemonSet | Default does not create a policy instance. |
Policy Control | Workload image version upgrade policy control | Restrict Deployment and DaemonSet to upgrade only in the configured image list. | Deployment,DaemonSet | Default does not create a policy instance. |
Policy Control | ServiceAccount Permission Control | Forbid ServiceAccount from binding to Roles and ClusterRoles with large permissions, enhancing cluster security. | ServiceAccount | Default does not create a policy instance. |
Policy Control | Do not allow Service to be of ClusterIP type. | Creation of ClusterIP type Service is prohibited or updating Service from other types to ClusterIP type is prohibited. | Service | Default does not create a policy instance. |
Policy Control | Disable public network access | Forbidden to expose backend services to the public network by creating a public network type Service or Ingress. | Service,Ingress | Default does not create a policy instance. |
Policy Control | ENI resource configuration limits | Cross-tenant ENI must be configured with Request resources. | Pod | Default does not create a policy instance. |
Policy Classification | Purpose of Policy | Policy Description | Intercepted Objects |
Policy Control | tkeblockvolumemountpath | Forbidden to container mount the specified directory. | pods |
Policy Control | k8sallowedrepos | Container image must start with a string from the specified string list. | pods |
Policy Control | k8spspautomountserviceaccounttokenpod | Containers cannot set automountServiceAccountToken to true. | pods |
Policy Control | k8sblockendpointeditdefaultrole | By default, many Kubernetes clusters predefine a ClusterRole named system:aggregate-to-edit. The k8sblockendpointeditdefaultrole policy definition forbids this ClusterRole from performing create, patch, and update operations on Endpoints. | clusterroles |
Policy Control | k8sblockloadbalancer | Do not allow Service to be of LoadBalancer type. | services |
Policy Control | k8sblocknodeport | Do not allow Service to be of NodePort type. | services |
Policy Control | k8sblockwildcardingress | Prohibit ingress from configuring blank or wildcard-type hostnames. | ingresses |
Policy Control | k8scontainerlimits | Limit containers must set CPU and memory Limit, and it must be less than the set maximum value. | pods |
Policy Control | k8scontainerrequests | Limit the Request for CPU and memory must be set and less than the configured maximum value. | pods |
Policy Control | k8scontainerratios | Limit the maximum ratio of Request and Limit for CPU and memory. | pods |
Policy Control | k8srequiredresources | The Limit for memory must be configured, and the Request for CPU and memory must be set. | pods |
Policy Control | k8sdisallowanonymous | ClusterRoles and Roles not in the allowlist cannot be associated with the system:anonymous User and system:unauthenticated Group. | rolebindings clusterrolebindings |
Policy Control | k8sdisallowedtags | Restrict container image tags. | pods |
Policy Control | k8sexternalips | Limit the externalIP service to the allowed IP address list. | services |
Policy Control | k8simagedigests | Container image must contain digest. | pods |
Policy Control | noupdateserviceaccount | Deny updates to ServiceAccount for resources not in the allowlist. | replicationcontrollers replicasets deployments statefulsets daemonsets cronjobs |
Policy Control | k8sreplicalimits | Objects with the "spec.replicas" field (such as Deployments, ReplicaSets) must be within the defined scope. | deployments |
Policy Control | k8srequiredannotations | The resource must include the specified annotations, whose values must match the provided regular expression. | services |
Policy Control | k8srequiredlabels | The resource must include the specified tags, whose values must match the provided regular expression. | namespaces |
Policy Control | k8srequiredprobes | The Pod must have a Readiness or Liveness Probe. | pods |
Security Reinforcement | k8spspallowprivilegeescalationcontainer | Set the "allowPrivilegeEscalation" field in PodSecurityPolicy to false. | pods |
Security Reinforcement | k8spspapparmor | Constrain the AppArmor field list. | pods |
Security Reinforcement | k8spspcapabilities | Restrict the "allowedCapabilities" and "requiredDropCapabilities" fields in PodSecurityPolicy. | pods |
Security Reinforcement | k8spspflexvolumes | Constrain the field type of allowedFlexVolumes in PodSecurityPolicy. | pods |
Security Reinforcement | k8spspforbiddensysctls | Constrain the "sysctls" field in PodSecurityPolicy to disallow the use of the name. | pods |
Security Reinforcement | k8spspfsgroup | Control the "fsGroup" field in PodSecurityPolicy within the limit range. | pods |
Security Reinforcement | k8spsphostfilesystem | Constrain the parameters of the "hostPath" field in PodSecurityPolicy. | pods |
Security Reinforcement | k8spsphostnamespace | Restrict the "hostPID" and "hostIPC" fields in PodSecurityPolicy. | pods |
Security Reinforcement | k8spsphostnetworkingports | Restrict the "hostNetwork" and "hostPorts" fields in PodSecurityPolicy. | pods |
Security Reinforcement | k8spspprivilegedcontainer | Forbid the "privileged" field in PodSecurityPolicy to be true. | pods |
Security Reinforcement | k8spspprocmount | Constrain the "allowedProcMountTypes" field in PodSecurityPolicy. | pods |
Security Reinforcement | k8spspreadonlyrootfilesystem | Constrain the "readOnlyRootFilesystem" field in PodSecurityPolicy. | pods |
Security Reinforcement | k8spspseccomp | Constrain the "seccomp.security.alpha.kubernetes.io/allowedProfileNames" annotation on PodSecurityPolicy. | pods |
Security Reinforcement | k8spspselinuxv2 | Constrain the allowed list of SELinux configurations in Pod definitions. | pods |
Security Reinforcement | k8spspallowedusers | Constrain the runAsUser, runAsGroup, supplementalGroups, and fsGroup fields in PodSecurityPolicy. | pods |
Security Reinforcement | k8spspvolumetypes | Constrain the "volumes" field type in PodSecurityPolicy. | pods |

apiVersion: constraints.gatekeeper.sh/v1beta1kind: K8sPSPPrivilegedContainermetadata:name: psp-privileged-containerspec:match:kinds:- apiGroups: [""]kinds: ["Pod"]namespaces: []excludedNamespaces: ["kube-system"]parameters:exemptInitContainers: true
apiVersion: v1kind: Podmetadata:name: privileged-podspec:containers:- name: privileged-containerimage: nginxsecurityContext:privileged: trueinitContainers:- name: privileged-init-containerimage: busyboxcommand: ['sh', '-c', 'echo Hello, Kubernetes!']securityContext:privileged: true
Error from server (Forbidden): error when creating "pod.yaml": admission webhook "validation.gatekeeper.sh" denied the request: [psp-privileged-container] Privileged container is not allowed: privileged-container, securityContext: {"privileged": true}, Pod name: privileged-pod
Feedback