For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/terraform-aws-efs-with-vulnerable-policy.md.
A documentation index is available at /llms.txt.
AWS EFS file system policies should avoid the use of wildcards (*) in the Action and Principal fields, as shown below, because this grants broad permissions to all users and all actions:
Such overly permissive policies can allow any AWS account to perform any action on the EFS resource, leading to potential unauthorized data access, deletion, or modification. To mitigate this risk, restrict the Principal to specific IAM identities and limit Action to only what is necessary. For example: