You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot read the contents of an object, even though I have the s3:GetObject, as well as the s3:ListBucket permission for it. Additionally the s3:ListAllMyBuckets permission is needed, otherwise the access is forbidden.
Expected Behavior
A user who is allowed to access an object should be able to access it without additional permissions. In our scenario it is not feasible to give the ListAllMyBuckets permission.
Environment
s3fs-nio version: 2.0.0
OS: Windows 10
JDK: 8
Additional context
This behavior is caused in S3SeekableByteChannel:85 when calling getBucket. This method tries to get all buckets and then filter for the one needed, thus needing the s3:ListAllMyBuckets permission.
Proposed Solution
Remove the call of getBucket and instead retrieve the name of the bucket directly from the path object by calling getBucketName on it.
Also, I want to open a pull request with the proposed solution shortly.
The text was updated successfully, but these errors were encountered:
The s3:listAllMyBuckets permission is needed to comply with the Java NIO interfaces. With Java NIO you can "list all drives" -- a Windows analogy would be listing C:, D:. Using the Ss3fs-nio proider you can list all buckets.
I don't think we're using the listAllMyBuckets REST API endpoint anywhere else but to list all buckets. However I need to double check the code to be sure. If we are -- then we might need to look into ways to avoid it if possible.
The issue is not related to behavior of listAllMyBuckets, but its use for retrieving data in S3SeekableByteChannel.
My change in #891 makes use of the bucket name in S3Path. This solves my issue of having to give a user the permission s3:ListAllMyBuckets to access the objects of that bucket.
I just added a commit to my PR replacing the getBucket call in S3FileSystemProvider with a new method hasBucket. This will also avoid the need for the S3:ListAllMyBuckets permission in this call. Also I think it is more logical to call hasBucket to check if a bucket exists instead of calling getBucket to get all buckets and then filter for one specific bucket to find out if it exists.
Bug Description
I cannot read the contents of an object, even though I have the
s3:GetObject
, as well as thes3:ListBucket
permission for it. Additionally thes3:ListAllMyBuckets
permission is needed, otherwise the access is forbidden.Expected Behavior
A user who is allowed to access an object should be able to access it without additional permissions. In our scenario it is not feasible to give the
ListAllMyBuckets
permission.Environment
s3fs-nio
version: 2.0.0Additional context
This behavior is caused in S3SeekableByteChannel:85 when calling
getBucket
. This method tries to get all buckets and then filter for the one needed, thus needing thes3:ListAllMyBuckets
permission.Proposed Solution
Remove the call of
getBucket
and instead retrieve the name of the bucket directly from the path object by callinggetBucketName
on it.Also, I want to open a pull request with the proposed solution shortly.
The text was updated successfully, but these errors were encountered: