For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/kubernetes-security-context-deny-admission-control-plugin-not-set.md.
A documentation index is available at /llms.txt.
For kube-apiserver, the --enable-admission-plugins flag should include SecurityContextDeny when PodSecurityPolicy is not set. The SecurityContextDeny plugin must also be configured in the admission control configuration file. This ensures pod security constraints remain enforced when PodSecurityPolicy is disabled. The rule checks both containers and initContainers command lines for the presence of the flag and plugin.