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
@@ -20,7 +21,10 @@ The following lists describe the bucket and object operations available in NooBa
20
21
- S3 HeadBucket
21
22
- S3 ListBuckets
22
23
- S3 ListMultipartUploads
23
-
24
+
- S3 PutBucketPolicy
25
+
- S3 DeleteBucketPolicy
26
+
- S3 GetBucketPolicy
27
+
- S3 GetBucketPolicyStatus
24
28
25
29
### Supported S3 Object Operations
26
30
@@ -40,6 +44,56 @@ The following lists describe the bucket and object operations available in NooBa
40
44
- S3 PutObjectTagging
41
45
- S3 DeleteObjectTagging
42
46
47
+
### Bucket Policy Support
48
+
- Bucket policies are an access policy option available to grant permission to buckets and objects (see [bucket policy](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucket-policies.html) in AWS documentation). You can use bucket policies to add or deny permissions for the objects in a bucket. Bucket policies can allow or deny requests based on the elements in the policy.
49
+
- Bucket policies use JSON-based policy language (for more information see [basic elements in bucket policy](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-policy-language-overview.html) in AWS documentation)
50
+
- Bucket policy can be added to a bucket using the S3 API or the noobaa-cli.
51
+
- Bucket policy is an additional layer of permissions to the FS permissions (UID and GID), which means that if two accounts do not have the same permissions (UID, GID) just setting bucket policy on the bucket is not enough.
52
+
53
+
#### Bucket Policy in NooBaa CLI
54
+
1. Adding a bucket policy:
55
+
- On bucket creation using the command: `noobaa-cli bucket add --name <bucket_name> --owner <owner_name> --path <path> --bucket_policy <bucket-policy>`.
56
+
- On bucket update using the command: `noobaa-cli bucket update --name <bucket_name> --bucket_policy <bucket-policy>`.
57
+
In both cases the argument for the bucket policy is a string
Replace `<account-name>` with account name and `<bucket-name>` with a bucket name.
88
+
Note: `arn:aws:s3:::<bucket-name>` for S3 bucket operations and `arn:aws:s3:::<bucket-name>/*` for S3 object operations.
89
+
Warning: this policy allows `<account-name>` to run all S3 operations.
90
+
91
+
##### Principal Field:
92
+
A bucket policy defines which principals can perform actions on the bucket. The Principal element specifies the user or account that is either allowed or denied access to a resource.
93
+
Currently we support a couple of options:
94
+
1. Grant anonymous permissions (all principals): either `"Principal": { "AWS": "*" }` or `"Principal": { "*" }`.
95
+
2. Principal by account name: `"Principal": { "AWS": [ "<account-name-1>", "<account-name-2>", ... ,"<account-name-n>"] }`
96
+
43
97
### Anonymous Requests Support
44
98
45
99
Anonymous requests are S3 requests made without an access key or a secret key -
0 commit comments