🎄 Join our Annual Holiday wargame and win prizes!


IAM Wildcard Policy

A wildcard IAM policy, although convenient, increases likelihood of malicious actions on resources and principals. IAM policy should follow the principle of Least Privileges to fine grain exact actions to exact resources.

Remediation

resource "aws_iam_policy" "s3-limit"{
    name="${var.prefix}-s3-limit-policy"
policy =  <<EOF
{
  "Version": "2012-10-17",
  "Statement": [
    {
            "Sid": "",
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:PutObjectAcl"
            ],
            "Resource": [
                "${aws_s3_bucket.example.arn}"
            ]
    }
  ]
}
EOF
}

Metadata

  • Severity: medium
  • Slug: iam-wildcard-policy

CWEs

  • 250: Execution with Unnecessary Privileges

OWASP

  • A05:2021: Security Misconfiguration

Available Labs

Select a language to explore available labs for this vulnerability.

No matching labs found

Try adjusting your language filter.

Deco line
Deco line

Play AppSec WarGames

Want to skill-up in secure coding and AppSec? Try SecDim Wargames to learn how to find, hack and fix security vulnerabilities inspired by real-world incidents.

Deco line
Deco line

Got a comment?

Join our secure coding and AppSec community. A discussion board to share and discuss all aspects of secure programming, AppSec, DevSecOps, fuzzing, cloudsec, AIsec code review, and more.

Read more