Open DovydasNavickas opened 2 months ago
hiya @DovydasNavickas, from the looks of things I'm suspecting the issue originates from CloudFlare and the way they handle permissions between those 4 options. I suspect that they are errantly not including the s3:HeadBucket
equivalent permission for the Object Read & Write
option. The reason I suspect this may be an oversight/error is that level claims to "Allows the ability to read, write, and list objects in specific buckets." Meaning that users should in fact be allowed to GET
the bucket to see a list of contents, and similarly should be able to HEAD
the bucket to verify it exists.
We are using a fairly standard minio library for s3 client, so it's not trying to list all buckets or anything exceptional. Just a basic BucketExists
call to verify before connecting. Based on the logs you provided I can see exactly where the error comes from and I suspect it should be working as is. Looking at the r2 docs they list having compatibility for this method: https://developers.cloudflare.com/r2/api/s3/api/
Given that they list the HeadBucket
method as one that they support and that it's generally an equivalent to ListObjects
, this is more reason I suspect that CloudFlare may have missed adding that permission to the Object Read & Write
option.
Rancher Server Setup
Describe the bug The
Backup
pod logs say (credentials and URL are random GUIDs):To Reproduce Steps to reproduce the behavior:
Create a bucket in Cloudflare R2
Create token with
Object Read & Write
permissionsSet S3 credentials for the
Backup
Apply configuration, wait for backup pod to proceed and observe the error
The problem is that backup pod tries to list the buckets, even though I set a specific bucket for it in the
Backup
specification:I tried setting the
Admin Read & Write
permissions, which is basicallysudo
for all buckets:And the credentials worked.
Expected behavior The backup should not list the buckets and should try uploading the file. This way if the permissions are sufficient, it will be able to upload the file successfully. If not, it will fail and should error out.