RAAAAM
RAAAAM

Reputation: 3380

How to restrict folders to user

Thanks for previous replies.

Is it possible to restrict the user to view particular folder in a bucket. let us take example, i have a bucket and it contains 2 folder, User A have only privilege to view first folder of the bucket, if he tries to access another folder it has to show access denied. is this possible to do in amazon S3.

Upvotes: 2

Views: 2130

Answers (1)

Geoff Appleford
Geoff Appleford

Reputation: 18832

You can do this using AWS Identity and Access Management (IAM). You can use this to create multiple identities and assign various permissions to those identities.

Here's a relevant example taken from the Amazon docs:

Example 1: Allow each user to have a home directory in Amazon S3

In this example, we create a policy that we'll attach to the user named Bob. The policy gives Bob access to the following home directory in Amazon S3: my_corporate_bucket/home/bob. Bob is allowed to access only the specific Amazon S3 actions shown in the policy, and only with the objects in his home directory.

{
   "Statement":[{
      "Effect":"Allow",
      "Action":["s3:PutObject","s3:GetObject","s3:GetObjectVersion",
      "s3:DeleteObject","s3:DeleteObjectVersion"],
      "Resource":"arn:aws:s3:::my_corporate_bucket/home/bob/*"
   }
   ]
}

Upvotes: 1

Related Questions