mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 21:35:58 +03:00
[GH-ISSUE #2129] should not require access to ListBucket on root to mount. #1086
Labels
No labels
bug
bug
dataloss
duplicate
enhancement
feature request
help wanted
invalid
need info
performance
pull-request
question
question
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/s3fs-fuse#1086
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gposton on GitHub (Mar 14, 2023).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2129
Additional Information
Version of s3fs being used (
s3fs --version)Version of fuse being used (
pkg-config --modversion fuse,rpm -qi fuseordpkg -s fuse)Kernel information (
uname -r)GNU/Linux Distribution, if applicable (
cat /etc/os-release)How to run s3fs, if applicable
s3fs syslog messages (
grep s3fs /var/log/syslog,journalctl | grep s3fs, ors3fs outputs)Details about issue
Previous versions of s3fs did not require ListBucket permission on the bucket root when using a specific sub-folder as the mount. The current version does.
Here is the IAM policy that worked with previous versions:
With this version of s3fs, the condition on the ListBucket permission prevents successful mount. If I remove the condition on ListBucket, s3fs successfully mounts the bucket. Further, I can then update the IAM policy to re-add the condition back and everything continues to work fine. It looks like this ONLY prevents the initial mount.
Our requirement is to prevent IAM access to list buckets so that users can not use awscli (or similar tools) directly to view the directory structure of the entire bucket.
I do not believe that the permission to ListBucket on the root of the bucket should be required when mounting a bucket subfolder.
@ggtakec commented on GitHub (Mar 26, 2023):
@gposton
Since v1.91, I think there is a fix related to this issue.
#2087(and #2114) may have solved your problem.
If you can build and test the code on the master branch, please try it.
Thanks in advance for your assistance.
@schorfi commented on GitHub (Mar 30, 2023):
@ggtakec I tried it and it seems not to work as expected - I had a similar use case
s3fs mybucket:/foo/bar/ /mnt/bar/ -f -d -o passwd_file=/etc/passwd-s3fs -o use_path_request_style -o endpoint=eu-central-1 -o url=https://s3.eu-central-1.amazonaws.comrequirement: minimal access rights in this use-case: list/read only on a specific (set of) prefix
expectation: successful mount of the objects with prefix, despite others are forbidden
fails with 403 - AccessDenied and/or
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message>on https://s3.eu-central-1.amazonaws.com/mybucket/foo/bar/
the same parameters from above work if I add a policy to include root read/list permissions on that bucket, which looks like
besides the other one which does the trick without the extension from above on aws cli, e.g.
aws s3 ls s3://mybucket/foo/bar/which is
What I observed so far, accessing the htttps://s3.eu-ce.... /mybucket/foo/bar/ returns 404 on both cases (success or not)
but on the succes case, there is a request being done
?delimiter=/&max-keys=2&prefix=foo/barwhich succeeds
but not on the unsuccessful case, where it prints the S3 response message
@ggtakec commented on GitHub (May 8, 2023):
@schorfi
I changed the mount point multiple checks to simple.
If you can, please try to check with #2155.
Thanks in advance for your assistance.
@jmcarpenter2 commented on GitHub (Jan 12, 2024):
Hi there @ggtakec !
My team and I are also experiencing this issue. I will do my best to provide a detailed example.
Basic setup
Version of s3fs being used (s3fs --version)
1.92and we also did try with1.93as wellVersion of fuse being used (pkg-config --modversion fuse, rpm -qi fuse or dpkg -s fuse)
2.9.9Kernel information (uname -r)
4.14.334-252.552.amzn2.x86_64GNU/Linux Distribution, if applicable (cat /etc/os-release)
Toy example, based on real issue
How to run s3fs, if applicable
s3fs syslog messages (grep s3fs /var/log/syslog, journalctl | grep s3fs, or s3fs outputs)
IAM Policy
We are trying to list bucket which has contents like the following
Details
It appears that the spaces in the object key
Life and Health History Survey-responses.jsonunder thedavid_stuffprefix is causing issues somehow in relationship with the listbucket permissions onhome/David/*and so we get that ListBucket access denied error, wheredavid_stuff/ object does not have any object under it(errno=-1)I am hoping you can help us with this. I will say that we confirmed removing the conditions from the
s3:ListBucketstatement does fix this, but is not an acceptable solution for us and our customers. Hoping you might know a better solution! Thank you so much in advance for looking into this.@ggtakec commented on GitHub (Feb 3, 2024):
I merged the bugs detected by @jmcarpenter2 and his fixes.
It would be helpful if someone could confirm if the problem has been resolved.