Over-Permissive IAM
A wildcard IAM policy is an admin credential with a boring name.
What Is Over-Permissive IAM?
An IAM policy grants what it says, not what the role's name suggests. A policy allowing every action on every resource, attached to something called a build agent, is an administrator credential with a boring name. You'll read the wildcard policy on a low-value-looking credential and use iam:PassRole to hand a privileged role to a function you create and invoke. The caller never holds the admin permission directly, which is why that escalation survives review. Then you'll enumerate actions on named resources and attach a permission boundary.
What You'll Learn in Over-Permissive IAM
- A wildcard policy grants what it says, not what the role's name suggests. A boring name does not limit a broad grant.
- Role-passing is a common escalation path because the caller never holds the privileged permission directly, which makes it easy to miss in review.
- Replace wildcards with enumerated actions on named resources. A deny list defaults every new resource to allowed.
- A permission boundary caps what the role can ever hold, so a future policy edit cannot re-grant the escalation.
Over-Permissive IAM — Training Steps
-
A boring set of keys
Bob is working Wyndlar, a freight brokerage that moves several hundred million pounds of carrier settlements a year. What he has is unglamorous: one credential belonging to a build agent, lifted from a pipeline log. A build agent packages artifacts. On paper this is nearly worthless. He checks what it actually is before deciding that.
-
What it is allowed to do
The only way to know a role's reach is to read the policy attached to it. Bob reads it.
-
What else is in the account
A wildcard means Bob can look at everything, so he looks at the roles. He is not after the build agent's own reach. He is after something the build agent can point at.
-
Hand the privileged role to something that will run it
This is the escalation, and it is worth being precise about why it works. Bob never assumes the admin role himself and never needs to. He creates a function and tells the platform to run it as the admin role. The platform is trusted; he is not; the result is the same.
-
What the admin role could see
The function is his code running with someone else's authority. He invokes it.
-
Why the name did not matter
Bob has an administrator's reach from a credential nobody would have bothered to protect.
-
A function nobody created
Wyndlar's platform review flags a function that appeared overnight carrying the break-glass role.
-
Read what the role is actually allowed
The answer is not in the function. It is in the policy on the role that created it.
-
The build agent
Three roles, and one of them is flagged.
-
Everything, on everything
There it is, in one statement.
Security Framework Coverage
CWE
- CWE-269 Improper Privilege Management
- CWE-250 Execution with Unnecessary Privileges
MITRE ATT&CK
- T1098.003 Account Manipulation: Additional Cloud Roles
- T1548 Abuse Elevation Control Mechanism
CIS Controls
- CIS 6 Access Control Management
NIST CSF
- PR.AT-02 Individuals in specialized roles are provided with awareness and training so that they possess the knowledge and skills to perform relevant tasks with cybersecurity risks in mind
- PR.AA Identity Management, Authentication, and Access Control