Environment info
- NooBaa Version: 4.23 (current master)
- Platform: not relevant - containerized (in NC, we don't have IAM user inline policy)
Actual behavior
Currently, in S3 rest we ask for IAM policy AND bucket policy for all IAM users:
|
await authorize_request_iam_policy(req); // authorize_request_iam_policy(req) is for users only |
|
// authorize_request_policy(req) is supposed to |
|
// allow owners access unless there is an explicit DENY policy |
|
await authorize_request_policy(req); |
Expected behavior
- Cross accounts (IAM users in another account) - the current behavior is as expected.
- Same account (IAM users under the account) - having the permission only in one layer is enough.
From AWS docs (link):
For IAM users and role principals within your account, no other permissions are required. For principals in other accounts, they must also have identity-based permissions in their account that allow them to access your resource. This is called cross-account access.
Steps to reproduce
Cross account case
(should work as expected) - need bucket policy AND IAM user inline policy
Same account case
-
Create an IAM User and access key (no IAM user line permission).
-
Create a bucket in the account and add an object
-
Add a bucket policy on the principal of the user using ARN and a specific action
-
Try to use the IAM user with the specific action using AWS CLI: in AWS should succeed; in our current implementation, you would need to add an IAM inline policy for this.
-
More information - Screenshots / Logs / Other output
- Probably also impacts role inline policy
- Probably also impacts other services in NooBaa (Vectors, STS).
For example: in vector rest:
|
await authorize_request_iam_policy(req); |
|
await authorize_request_vector_policy(req); |
Environment info
Actual behavior
Currently, in S3 rest we ask for IAM policy AND bucket policy for all IAM users:
noobaa-core/src/endpoint/s3/s3_rest.js
Lines 235 to 238 in ae08790
Expected behavior
From AWS docs (link):
Steps to reproduce
Cross account case
(should work as expected) - need bucket policy AND IAM user inline policy
Same account case
Create an IAM User and access key (no IAM user line permission).
Create a bucket in the account and add an object
Add a bucket policy on the principal of the user using ARN and a specific action
Try to use the IAM user with the specific action using AWS CLI: in AWS should succeed; in our current implementation, you would need to add an IAM inline policy for this.
More information - Screenshots / Logs / Other output
For example: in vector rest:
noobaa-core/src/endpoint/vector/vector_rest.js
Lines 205 to 206 in ae08790