Skip to content

Reading data from file requires s3:ListAllMyBuckets permission #890

Closed as not planned
@kxm-kstlr

Description

@kxm-kstlr

Bug Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions