Skip to main content
compliance · aws

IAM role trust policies open to any principal

resource types
1
rule IDs covered
1
severity
critical

What does ZopNight detect here?

An IAM role whose trust policy contains a "Principal": "*" statement lets any AWS principal assume it, so ZopNight raises critical finding RC-080 the moment the discoverer stamps has_wildcard_principal as true. With no verdict recorded the rule abstains, and the fix is scoping the principal to exact accounts or services.

Signal and threshold

How ZopNight evaluates IAM role trust policies open to any principal.
Field Value
Rule IDsRC-080
Categorycompliance
Severitycritical
Metricnone — pure configuration read
Sourceiam_public_access.go

What a wildcard principal hands out

A role’s trust policy names who may assume it. Writing "Principal": "*" into a statement names everyone: any AWS account, any user, and (depending on the actions involved) unauthenticated requests. Whatever permissions the role carries are now effectively public, which is why this is one of the few findings ZopNight files at critical severity. A wildcard that slipped in during debugging (“just make it work, we’ll tighten it later”) looks exactly like one an attacker would plant.

From trust-policy scan to finding

The discoverer parses each role’s trust policy during inventory and records whether any statement carries the wildcard, writing has_wildcard_principal onto the role as a string verdict. RC-080 fires only when that verdict is present and reads true.

When no verdict was recorded, the rule stays quiet. That is deliberate fail-closed behaviour, and it has history: an earlier revision read the flag from a tag field no producer ever populated, so the rule could never fire at all. Reading the field the discoverer actually writes is what brought it to life.

Hunting wildcard trust policies yourself

Terminal window
aws iam list-roles --output json | jq -r '.Roles[]
| select(.AssumeRolePolicyDocument.Statement[]?
| (.Principal == "*") or (.Principal.AWS? == "*"))
| .RoleName'

Both spellings matter. A bare "Principal": "*" and the nested "AWS": "*" form grant the same thing, and audits that grep for only one of them miss half the exposure.

Narrowing the principal down

Remediation is replacement, not deletion. Substitute the wildcard with the exact account IDs, role ARNs or service principals that genuinely need to assume the role, then add condition keys as a second seatbelt: aws:PrincipalOrgID to fence access inside your organization, or aws:SourceAccount where a service acts on your behalf.

Before saving, check CloudTrail for AssumeRole events against the role. If unfamiliar principals have been assuming it, the task is no longer hygiene; treat it as a potential compromise, rotate whatever the role could reach, and then close the trust policy.

See it fire on your bill.

Connect an account read-only. The first findings land in minutes.

417 rule families across 353 resource types on 22 platforms. Every threshold, metric, and IAM action is documented on these pages before you grant anything.

417 rule families documented
353 resource types covered
read-only default access level
Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001· 20–60% off the bill, first month· 4 platforms · 1 console· Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001· 20–60% off the bill, first month· 4 platforms · 1 console·