Skip to content

Block delete_bucket requests by an OBC account #8331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

dannyzaken
Copy link
Member

@dannyzaken dannyzaken commented Sep 5, 2024

Explain the changes

  1. Prevent the deletion of an OBC bucket by the OBC account.
  2. A regular account can delete an OBC bucket according to the access policy or via RPC

Issues: Fixed #xxx / Gap #xxx

  1. https://bugzilla.redhat.com/show_bug.cgi?id=2301657

Testing Instructions:

  1. Create an OBC bucket
  2. use the credentials associated with the OBC (in the OBC secret) and attempt to delete the bucket via s3 API (e.g. aws-cli)
  3. The expected status is AccessDenied
  4. Attempt to delete the bucket using the admin credentials. deletion should work.
  5. Deletion of the OBC should also work and delete the underlying bucket
  • Doc added/updated
  • Tests added

Copy link
Member

@tangledbytes tangledbytes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can add a small test in unit_tests/test_s3_ops to ensure no regression in future.

throw new S3Error(S3Error.AccessDenied);
}


// @TODO: System owner as a construct should be removed - Temporary
if (is_system_owner) return;
Copy link
Contributor

@jackyalbo jackyalbo Sep 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please move line 233 close to the check in line 245. I mean, put your code block before or after this check, not in the middle. also, I would move the @todo before the const, just as a side note...

* Prevent the deletion of an OBC bucket by the OBC account.
* A regular account can delete an OBC bucket according to the access policy or via RPC

Signed-off-by: Danny Zaken <[email protected]>
@dannyzaken dannyzaken merged commit 2bcdc0a into noobaa:master Sep 10, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants