Legacy Authorization (ABAC) must be disabled on Kubernetes Engine (GKE) clusters. ABAC grants access based on user attributes instead of fine-grained RBAC rules, which can result in overly broad permissions and increase the risk of unauthorized access or privilege escalation.
For Ansible-managed clusters using the google.cloud.gcp_container_cluster or gcp_container_cluster modules, the legacy_abac.enabled property must be set to false. This rule flags cluster resources where legacy_abac.enabled is true. Ensure the property is explicitly defined as false in your cluster declaration to enforce RBAC.
Secure configuration example:
- name:Create GKE cluster with legacy ABAC disabledgoogle.cloud.gcp_container_cluster:name:my-clusterlocation:us-central1legacy_abac:enabled:falseinitial_node_count:3
Compliant Code Examples
#this code is a correct code for which the query should not find any result- name:create a clustergoogle.cloud.gcp_container_cluster:name:my-clusterinitial_node_count:2master_auth:username:cluster_adminpassword:my-secret-passwordnode_config:machine_type:n1-standard-4disk_size_gb:500location:us-central1-aproject:test_projectauth_kind:serviceaccountservice_account_file:/tmp/auth.pemstate:presentlegacy_abac:enabled:no
Non-Compliant Code Examples
#this is a problematic code where the query should report a result(s)- name:create a clustergoogle.cloud.gcp_container_cluster:name:my-clusterinitial_node_count:2master_auth:username:cluster_adminpassword:my-secret-passwordnode_config:machine_type:n1-standard-4disk_size_gb:500location:us-central1-aproject:test_projectauth_kind:serviceaccountservice_account_file:"/tmp/auth.pem"state:presentlegacy_abac:enabled:yes
1
2
rulesets:- Ansible / GCP # Rules to enforce / GCP.
맞춤형 데모 요청
Datadog 시작하기
Ask AI
AI-generated responses may be inaccurate. Verify important info.