Developers are allowed to create IAM roles for their Lambda functions. However, the security team is concerned that developers could create roles with Administrator access, granting Lambda functions more permissions than the developers themselves have. What IAM feature prevents privilege escalation in this scenario?
Trap 1: Enable IAM Access Analyzer to detect when developers create overly…
IAM Access Analyzer identifies resources accessible from outside the account (external access) or unused permissions (unused access), and generates policy recommendations. It detects after-the-fact and requires manual remediation. It does not prevent a developer from creating an overly permissive role in the first place.
Trap 2: Require MFA for all IAM API calls so developers must…
MFA verifies identity but does not restrict what actions an authenticated identity can take. A developer who has iam:CreateRole permission can still create an Administrator role after MFA verification. Permission boundaries restrict what actions are possible, not who can authenticate.
Trap 3: Enable CloudTrail logging for all IAM API calls and set up a…
CloudTrail logging detects role creation after the fact. An alarm notifies the team but does not block the action. The developer can still create an overly permissive role before any remediation occurs. Permission boundaries prevent the escalation proactively.
- A
Attach a permission boundary to each developer IAM user that limits them to creating roles with only the permissions they are allowed to grant
The permission boundary on the developer prevents them from passing permissions they do not have (iam:PassRole with a role whose boundary exceeds their own). When combined with an IAM policy that requires any role they create to have the same boundary attached, privilege escalation is prevented systematically.
- B
Enable IAM Access Analyzer to detect when developers create overly permissive roles
Why wrong: IAM Access Analyzer identifies resources accessible from outside the account (external access) or unused permissions (unused access), and generates policy recommendations. It detects after-the-fact and requires manual remediation. It does not prevent a developer from creating an overly permissive role in the first place.
- C
Require MFA for all IAM API calls so developers must re-authenticate before creating roles
Why wrong: MFA verifies identity but does not restrict what actions an authenticated identity can take. A developer who has iam:CreateRole permission can still create an Administrator role after MFA verification. Permission boundaries restrict what actions are possible, not who can authenticate.
- D
Enable CloudTrail logging for all IAM API calls and set up a CloudWatch alarm for iam:CreateRole events
Why wrong: CloudTrail logging detects role creation after the fact. An alarm notifies the team but does not block the action. The developer can still create an overly permissive role before any remediation occurs. Permission boundaries prevent the escalation proactively.