What does `iam:PassRole` do and why is it dangerous?
AdvancedConceptIAM Advanced, STS and Multi-Account
Answer
iam:PassRole is the permission to hand a role to an AWS service (an EC2 instance, a Lambda function, an ECS task, CloudFormation). It is not an API call; it is checked when you call another API like lambda:CreateFunction --role.
If a user can pass an admin role to a service they can create, they effectively get admin through that service. Scope it with the Resource (specific role ARNs) and the iam:PassedToService condition.
More on IAM Advanced, STS and Multi-Account
Explain the IAM policy evaluation logic.AdvancedHow does cross-account access evaluation differ from same-account?AdvancedHow does `sts:AssumeRole` work, step by step?IntermediateWhat is the difference between AssumeRole, AssumeRoleWithWebIdentity and AssumeRoleWithSAML?IntermediateWhat is a permission boundary and when would you use one?IntermediateWhat do Service Control Policies do and not do?Intermediate