Abhishek Nair
Abhishek Nair

Reputation: 21

S3 bucket policy to grant/restrict access to a specific federated user

I am looking for a S3 bucket policy which can grant/restrict specific federated users access to the bucket. Federated users in aws uses IAM roles. Is there some way I can limit the access to a user even if the user has assumed the role. Is there a way I can specify federated users in a bucket policy? Also the S3 bucket is in a different account.

Upvotes: 2

Views: 3149

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269490

When a user is assuming a role, they are assigned a role-session-name. This can be used to track the identity of the user assuming the role.

From AWS JSON Policy Elements: Principal - AWS Identity and Access Management:

Specific assumed-role user

"Principal": { "AWS": "arn:aws:sts::AWS-account-ID:assumed-role/role-name/role-session-name" }

Upvotes: 1

Related Questions