Question 30
A permissions review finds overly broad IAM role access in production. The team confirms that a role has a valid trust relationship but is denied access by a separate explicit resource-policy Deny. What is the best design response for this workload?
Explanation
Correct Answer
The scenario identifies this requirement: A role has a valid trust relationship but is denied access by a separate explicit resource-policy Deny. Select Remove or narrow the resource-policy deny only after authorized review as the specified technical mechanism. An explicit deny overrides an identity-policy allow. This response addresses the problem described rather than a different design goal.
Incorrect Answers
Enable organization CloudTrail events and analyze AssumeRole activity would help if the architecture needs a central log of every role assumption by an operator. CloudTrail captures STS calls and their requester context. That is not the symptom described here: a role has a valid trust relationship but is denied access by a separate explicit resource-policy Deny. The matching response is Remove or narrow the resource-policy deny only after authorized review, because an explicit deny overrides an identity-policy allow.
For the alternative failure a policy grants access to resources never used by the role, the control Use IAM Access Analyzer policy generation and last-accessed evidence to tighten grants is relevant: access evidence helps identify unused permissions. Here the evidence instead is a role has a valid trust relationship but is denied access by a separate explicit resource-policy Deny. The selected technical mechanism is Remove or narrow the resource-policy deny only after authorized review: an explicit deny overrides an identity-policy allow.
Restrict iam:PassRole to approved target role ARNs and compatible services solves a different operational problem where a developer needs a deploy-time service role but should not create arbitrary privileged roles. PassRole permission controls which role a principal may delegate to a service. It does not directly address a role has a valid trust relationship but is denied access by a separate explicit resource-policy Deny. The case calls for Remove or narrow the resource-policy deny only after authorized review, since an explicit deny overrides an identity-policy allow.