Json Yaml Write Actions Wildcard Resource
Description
Detects CloudFormation IAM policies that use wildcard (*) resources while granting write permissions. This creates overly permissive access control that violates the principle of least privilege, potentially allowing actions on unintended AWS resources.
Detection Strategy
• Scans CloudFormation templates for IAM managed policies and role trust policies
• Identifies policy statements that grant write/modify permissions (e.g. Put*, Update*, Delete*, Create*)
• Checks if the Resource field in these statements uses wildcards (*)
• Reports a vulnerability when write permissions are combined with wildcard resources in policy statements
Vulnerable code example
Resources:
AdminRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow...✅ Secure code example
Resources:
AdminRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow...Search for vulnerabilities in your apps for free with Fluid Attacks' automated security testing! Start your 21-day free trial and discover the benefits of the Continuous Hacking Essential plan. If you prefer the Advanced plan, which includes the expertise of Fluid Attacks' hacking team, fill out this contact form.