Fix Wildcard Action: "*" / Resource: "*"
Scope full wildcard admin policies (IAM001, IAM004) into least-privilege JSON diffs.
iam:PassRole & CreatePolicyVersion Privilege Escalation
Eliminate silent AWS admin takeover paths from unscoped iam:PassRole (IAM003),
iam:CreatePolicyVersion (IAM004), iam:* wildcards (IAM002),
and AdministratorAccess attachments (IAM009)—audited 100% locally with 0 bytes uploaded.
0 bytes uploaded · 0 AWS keys · One-time local CLI, SARIF 2.1.0 & SOC 2 CC6.1 dossier via Polar.sh.
.tf / .json Files
.json or Terraform .tf files — processed strictly in browser memory.
CI/CD deploy roles frequently accumulate iam:*, unscoped iam:PassRole,
iam:CreatePolicyVersion, or direct AdministratorAccess attachments. Scope
iam:PassRole to the exact execution role ARN with iam:PassedToService, attach a
permissions_boundary, and enforce exact OIDC repository claims.
resource "aws_iam_role_policy" "ci_escalate" {
name = "ci-deployer-inline"
role = aws_iam_role.ci_deployer.id
policy = jsonencode({
Version = "2012-10-17"
Statement = [{
Effect = "Allow"
Action = [
"iam:*",
"iam:PassRole",
"iam:CreatePolicyVersion",
"lambda:UpdateFunctionCode"
]
Resource = "*"
}]
})
}
resource "aws_iam_role_policy_attachment" "admin_attach" {
role = aws_iam_role.ci_deployer.name
policy_arn = "arn:aws:iam::aws:policy/AdministratorAccess"
}
resource "aws_iam_role" "ci_deployer" {
name = "ci-deployer-prod"
permissions_boundary = "arn:aws:iam::123456789012:policy/AppBoundary"
max_session_duration = 3600
assume_role_policy = jsonencode({
Version = "2012-10-17"
Statement = [{
Effect = "Allow"
Principal = { Federated = "arn:aws:iam::123456789012:oidc-provider/token.actions.githubusercontent.com" }
Action = "sts:AssumeRoleWithWebIdentity"
Condition = {
StringEquals = {
"token.actions.githubusercontent.com:aud" = "sts.amazonaws.com"
"token.actions.githubusercontent.com:sub" = "repo:acme/app:ref:refs/heads/main"
}
}
}]
})
}
resource "aws_iam_role_policy" "ci_scoped_passrole" {
name = "ci-deployer-scoped-passrole"
role = aws_iam_role.ci_deployer.id
policy = jsonencode({
Version = "2012-10-17"
Statement = [{
Effect = "Allow"
Action = ["iam:PassRole"]
Resource = "arn:aws:iam::123456789012:role/app-lambda-exec"
Condition = {
StringEquals = {
"iam:PassedToService" = "lambda.amazonaws.com"
}
}
}]
})
}
| Rule | Severity | Escalation Vector Caught | Exact Fix |
|---|---|---|---|
IAM002 |
CRITICAL | Dangerous service wildcards (iam:*, sts:*, kms:*, ec2:*, organizations:*) on * |
Replace with explicit minimal actions scoped to target ARNs. |
IAM003 |
CRITICAL | Unscoped iam:PassRole missing target role ARN or iam:PassedToService |
Pin exact role ARN and add Condition.StringEquals["iam:PassedToService"]. |
IAM004 |
CRITICAL | iam:CreatePolicyVersion, AttachRolePolicy, PutRolePolicy, or lambda:UpdateFunctionCode on * |
Remove direct IAM write actions from workload/CI roles or constrain via permissions boundary. |
IAM009 |
HIGH | Direct attachment of AdministratorAccess, PowerUserAccess, or IAMFullAccess |
Replace managed admin policies with task-specific least-privilege policies. |
Scan entire multi-module AWS repositories locally with leastproof-cli (68 KB Node.js binary, 0 npm
deps) and export SARIF 2.1.0 + SHA-256 sealed SOC 2 CC6.1 auditor evidence.
iam:PassRole?
With iam:PassRole on * plus compute creation permissions (Lambda, EC2, ECS), an
attacker attaches an existing admin execution role to a new compute task and executes arbitrary AWS API calls
as administrator.
iam:CreatePolicyVersion on * a direct privilege escalation?
Setting a new default version on a policy already attached to the caller grants immediate
Action: "*" on Resource: "*" without modifying trust relationships.
iam:PassRole in Terraform?
List the exact target execution role ARN in Resource, add an iam:PassedToService
StringEquals condition, and enforce a permissions_boundary on the role.
Action: "*" / Resource: "*"Scope full wildcard admin policies (IAM001, IAM004) into least-privilege JSON diffs.
0.0.0.0/0 SSH & RDS Security GroupsLock down exposed ports 22, 3389, 5432, and 3306 (TF001–TF004) in Terraform.
Enforce http_tokens = "required" and KMS encryption (TF007–TF012).