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/rbac_roles_with_read_secrets_permissions.md.
A documentation index is available at /llms.txt.
Roles and ClusterRoles that grant ‘get’, ‘watch’, or ’list’ RBAC permissions on Kubernetes ‘secrets’ are dangerous and should not include such permissions. If compromised, these roles can be used to access sensitive data such as passwords, tokens, and keys. This rule flags Role and ClusterRole resources that include rules with ‘secrets’ in their resources field together with any of the read verbs (‘get’, ‘watch’, ’list’).