- Newest
- Most votes
- Most comments
Unfortunately, there isn't a single RESTful API endpoint that directly provides a list of all users who have access to a particular S3 bucket without using the AWS SDK. This is a complex task due to the various ways access can be granted in AWS (bucket policies, IAM policies, ACLs, etc.).
However, you can use a combination of approaches to gather this information:
-
Use the S3 API to retrieve the bucket policy and ACLs. This will give you information about permissions set directly on the bucket.
-
Use the IAM API to list all users and roles in the account, then retrieve their policies to check for S3 permissions.
-
If you're using AWS Organizations, you can use the ListCallerAccessGrants API to get information about S3 Access Grants for IAM principals and IAM Identity Center users. This API returns the S3 Access Grants for users and their groups based on group membership in AWS IAM or an Identity Provider.
-
Consider implementing a custom solution where you maintain a separate database or configuration file that maps users to their S3 bucket permissions. You would need to keep this updated as permissions change in AWS.
-
Implement a proxy or middleware layer that intercepts and logs all S3 access attempts. This could help you build a list of users who actually access each bucket.
Remember that determining exact permissions can be challenging due to the potential complexity of IAM policies and their interactions. Your solution may need to be approximate or require periodic manual review.
Also, be aware that listing all users with access to a bucket could potentially expose sensitive information. Ensure you have proper authorization and security measures in place when implementing this feature.
Sources
Amazon S3 Access Grants introduce the ListCallerAccessGrants API - AWS
Add users in organization to S3 buckets | AWS re:Post
Getting started with Amazon S3 - Amazon Simple Storage Service
Relevant content
asked 2 years ago
asked 2 years ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated a year ago
