-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document minimum AMI user permissions/ACLs in order for accesssing an AWS bucket #139
Comments
It would be nice to see documented exactly which actions are required for this plugin to work. I do not like giving more privileges than necessary. I use the following policy for other services and it works. But with
Another policy example is in issue #62. |
Well, after going through all the permissions myself it turns out that |
This is really helpful @SunSparc :) I'll try to upstream a doc change when I'm next using this plugin |
Ok, after some experimentation, found the minimal permissions for bucket and plugin setup is: {
s3Options: {
// ...
},
s3UploadOptions: {
ACL: '',
Bucket: 'YOURBUCKET'
}
} IAM > Users > YOURUSER > Permissions > Add inline policy (JSON): {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject"
],
"Resource": "arn:aws:s3:::YOURBUCKET/*"
}
]
} S3 > YOURBUCKET > Permissions > Block public access: All "OFF" S3 > YOURBUCKET > Permissions > Bucket Policy: {
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::YOURBUCKET/*"
}
]
} |
@patcon Does
"YOURBUCKET" have to be a hardcoded string? Having a difficult time passing this value from an .env using |
I don't think so, @mapineda :( |
Took me awhile to sort this out, and was surprised that I couldn't find a record of it in the issue queue. Copy-pasting this in to the JSON editor allowed it to finally work: https://docs.aws.amazon.com/AmazonS3/latest/dev/example-policies-s3.html#iam-policy-ex0
Giving full S3 permissions on the bucket also worked, but that felt like overkill, and it would be bad to incentivize users to do that.
The text was updated successfully, but these errors were encountered: