I have two buckets on S3 that I use with an app; one for test environment, and one for production.
I’ve been wrestling with permissions on IAM panel to try to get the developers to only have access to the test environment bucket, especially since they had accidentally deleted files from production bucket in the past.
I have no specific policy set up to grant them S3 access aside from list objects, and a policy that allows s3:* in the resource that is relevant to them (arn:aws:s3:::testbucket).
For some reason, when I log in as the test user, I am still able to get into the production bucket, upload files, and delete files no problem. What am I doing wrong here? I checked bucket permissions as well - s3 buckets don’t have any specific bucket permissions set aside from root user having max permissions.
I believe you’ll want to setup a policy on the bucket itself to only allow certain people access to the production bucket or you may have to deny a group or individual users.
You should probably create a new, separate account for the test bucket, and other test AWS resources. AWS can roll the billing up for both accounts into one for you.
Which takes precedence over the other in the event that there are overlapping permissions between IAM group policies and bucket-specific policies set on S3?
I did exactly this
and when I log in as the dev user account, while I am not able to create buckets at root (I get the message "You do not have permission to read this.. or something like that), I can still get into the production bucket and create new directories, upload, and delete.
As for the bucket itself… no other permissions set other than me (root user) having full control.
I have a couple of other policies which I think are unrelated, that have to do with Beanstalk use. Actions relating to autoscaling, elastic beanstalk, and of course a redundant “read only” s3 policy is also present.
Other than that, I can’t think of any reason why they are able to read/write as they do.
You can do permissions on the bucket side. If you can narrow down who has access to the production bucket, you can do an explicit deny on anything other than the IAM account(s) mentioned in the bucket policy.
I defined the S3 test bucket under Resource though? How would I frame it so they are permitted all actions just to that particular bucket? The way I have it set up with policy 7, I can still log in as the dev user and go into production use bucket and create, upload and delete.
Whoops, sorry, I thought My s3 bucket was the production bucket.
Are you sure the test user doesn’t have any groups or other policies attached? Maybe managed policies or other stuff, the new IAM interface sometimes hides those tables so make sure you expand every section and get into the nitty gritty of the user.
As a test I would start removing all policies from the testuser and logging in and testing the bucket access.
They’re all group policies - the user has no policies attached. Unfortunately those 7 are the only policies I have active anywhere.
Bah! I think i might just create another AWS account for them. Had enough headache with this heh