Skip to content

Instantly share code, notes, and snippets.

@fwessels
Created May 23, 2017 22:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fwessels/903c5b07be6605a4cf4454441962f9de to your computer and use it in GitHub Desktop.
Save fwessels/903c5b07be6605a4cf4454441962f9de to your computer and use it in GitHub Desktop.
AWS policy with minimal permissions to allow Minio Gateway access to a single bucket
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1495498207000",
"Effect": "Allow",
"Action": [
"s3:GetBucketLocation",
"s3:ListAllMyBuckets"
],
"Resource": [
"arn:aws:s3:::*"
]
},
{
"Sid": "Stmt1495499162000",
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::minio-gateway-test"
]
},
{
"Sid": "Stmt1495499056000",
"Effect": "Allow",
"Action": [
"s3:*"
],
"Resource": [
"arn:aws:s3:::minio-gateway-test/*"
]
}
]
}
@fwessels
Copy link
Author

This is a policy definition for AWS in order to setup (for existing AWS users) access to just a single bucket.

By creating a new user (with its own ACCESS and SECRET key) and attaching the above policy to this user, if you subsequently run minio gateway with these credentials, then the gateway will just allow access to this specific bucket (eg. mys3/minio-gateway-test in this case).

Note that the policy allows some actions at higher levels. Also the user of the gateway is able to list the names of all buckets (eg. mc ls mys3 works) but obviously cannot list inside these buckets. (And the names of the buckets are public anyway because they are accessible under s3.amazonaws.com.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment