For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/terraform-kubernetes-permissive-access-to-create-pods.md.
A documentation index is available at /llms.txt.
The permission to create pods in a cluster should be restricted because it allows privilege escalation. This rule inspects kubernetes_role and kubernetes_cluster_role resources and reports when a rule’s verbs contains create while its resources contains pods or a wildcard value. It also flags cases where verbs or resources contain a wildcard (for example, *) in combination with pods, since those broaden access and can enable pod creation. Restricting these permissions reduces the risk of workloads obtaining elevated privileges.