0

please note: I am not using AWS as the S3 provider but something called Cegedim S3.

Following operation is not working with Minio client but with boto3 it's working.

When I am trying to setup the following policy with Minio client it works for the bucket level operations but not for object the level operations.

 policy = {
            "Version": "2012-10-17",
            "Id": "Policy1639139464683",
            "Statement": [
                {
                    "Action": [
                        "s3:ListBucket"
                    ],
                    "Resource": "arn:aws:s3:::test",
                    "Effect": "Allow",
                    "Principal": {
                        "AWS": [
                            "{user_access_key}"
                        ]
                    },
                    "Sid": "Stmt1639139460416"
                },
                {
                    "Action": [
                        "s3:GetObject",
                        "s3:PutObject"
                    ],
                    "Resource": "arn:aws:s3:::test/*",
                    "Effect": "Allow",
                    "Principal": {
                        "AWS": [
                            "{user_access_key}"
                        ]
                    },
                    "Sid": "Stmt1639139460415",
                }
            ]
        }

Minio connection

 def minio(self) -> Minio:
     return Minio(
         endpoint=f"{self.config.s3.host}:{self.config.s3.port}",
         access_key=Secrets.S3_USER.get_value(),
         secret_key=Secrets.S3_PASSWORD.get_value(),
         secure=(self.config.s3.schema != "http"),
        )

After setting up this policy I can't perform get/put or any other operation on objects.

is there any workaround for this with Minio client?

Januka samaranyake
  • 2,385
  • 1
  • 28
  • 50

1 Answers1

1

If you share the actual error that you get, it would be easier to figure out the problem. However, I would venture to guess that you also need "s3:GetBucketLocation" in your bucket level permissions statement in the policy.

donatello
  • 5,727
  • 6
  • 32
  • 56