Skip to content
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

HeadBucket->ListBucket #8

Merged
merged 2 commits into from
Aug 26, 2022
Merged

HeadBucket->ListBucket #8

merged 2 commits into from
Aug 26, 2022

Conversation

leos
Copy link
Contributor

@leos leos commented Aug 17, 2022

The existing example gives this error in the policy editor:

Ln 8, Col 16 Invalid Action: The action s3:HeadBucket does not exist. Did you mean s3:ListBucket? The API called HeadBucket authorizes against the IAM action s3:ListBucket.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
The existing example gives this error in the policy editor:
```
Ln 8, Col 16 Invalid Action: The action s3:HeadBucket does not exist. Did you mean s3:ListBucket? The API called HeadBucket authorizes against the IAM action s3:ListBucket.
```
README.md Outdated
@@ -49,7 +49,7 @@ The following policy grants the user access to the bucket `my-restricted-bucket`
"Sid": "AllowBucketStat",
"Effect": "Allow",
"Action": [
"s3:HeadBucket"
"s3:ListBucket"
],
"Resource": "*"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, should this also be referencing arn:aws:s3:::my-restricted-bucket?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't remember if it makes any difference to the way MinIO works, but my guess is that it's probably fine if you want to restrict the ListBucket action to a specific resource, too.

@peter-evans
Copy link
Owner

Hi @leos

I wonder if anything has changed about the HeadBucket action since I wrote this. 🤔 But it seems you are right, that HeadBucket depends on ListBucket.
https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html

Does the action work for you with the policy set to ListBucket?

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@leos
Copy link
Contributor Author

leos commented Aug 25, 2022

Just got it all hooked up, yes, it works with ListBucket. And it works if the Resource is restricted to just that bucket.

@peter-evans
Copy link
Owner

Thanks for testing and contributing this patch!

@peter-evans peter-evans merged commit 8e6e58a into peter-evans:master Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants