mirror of
https://github.com/floci-io/floci.git
synced 2026-11-29 16:35:29 -05:00
A role's trust policy now reaches IAM enforcement through a ResourcePolicyProvider, the path every other resource-based policy takes, instead of a branch on sts:AssumeRole in the enforcement filter. RoleTrustPolicyProvider answers an STS action on a role ARN with the role's stored trust policy, each statement that names no Resource given the role's ARN, and with the account in the role's ARN as its owner. IAM actions on the role, such as iam:GetRole and iam:PassRole, get nothing from it. evaluateResourcePolicyFor already returns ALLOW_DIRECT_IAM_USER for an Allow naming the caller's user ARN, so a same-account grant to a user is unchanged, and AssumeRolePolicyEvaluator.grantsToIamUser and its request-key helper are removed. Within the role's account, an Allow naming a role session's role, or "*", now grants the call too, as any same-account resource-based policy does. Across accounts the filter needs the trust policy's Allow beside the caller's identity policy, so it refuses an IAM user or a role session the trust policy does not allow before STS does, with its own AccessDenied message; AssumeRoleTrustConditionsIntegrationTest checks that message for those callers. The STS guide's sentence that the caller's identity policy must allow sts:AssumeRole now names the same-account exception.