Skip to content

IAM User Inline Policy With Bucket Policy #9866

Description

@shirady

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

  1. Create an IAM User and access key (no IAM user line permission).

  2. Create a bucket in the account and add an object

  3. Add a bucket policy on the principal of the user using ARN and a specific action

  4. 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.

  5. 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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions