Skip to content

Prevent list bucket visilibilty created by non-admin accounts #8890

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ezio-auditore
Copy link

@ezio-auditore ezio-auditore commented Mar 21, 2025

Describe the Problem

Explain the Changes

Issues: Fixed #xxx / Gap #xxx

  1. Fixes https://issues.redhat.com/browse/RHSTOR-7088

Testing Instructions:

  • Doc added/updated
  • Tests added

Signed-off-by: Kaustav Majumder <kaustav.majumder@ibm.com>
@@ -670,14 +673,16 @@ function _get_auth_info(account, system, authorized_by, role, extra) {
* @returns {Promise<boolean>} true if the account has permission to perform the action on the bucket
*/
async function has_bucket_action_permission(bucket, account, action, req_query, bucket_path = "") {
dbg.log1('has_bucket_action_permission:', bucket.name, account.email, bucket.owner_account.email);
dbg.info('has_bucket_action_permission:', bucket.name.unwrap(),bucket.system.owner.email.unwrap(), account.email.unwrap(), bucket.owner_account.email.unwrap());
Copy link
Author

Choose a reason for hiding this comment

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

Used Command

sh-4.2$ aws s3 ls --endpoint-url http://s3-endpoint-proxy.openshift-storage-client.svc.cluster.local
2025-03-21 09:07:05 client-bucket // client owns this bucket
2025-03-19 12:05:05 first.bucket // admin owns
2025-03-21 08:56:26 test-bucket // admin owns

[INFO] core.server.common_services.auth_server:: has_bucket_action_permission: test-bucket admin@noobaa.io storageconsumer-7a3ae305-b4cf-4547-a5af-aa1f91dbe79a admin@noobaa.io

According to the logic here, this bucket should not have been listed in the output
since account.email (storageconsumer-7a3ae305-b4cf-4547-a5af-aa1f91dbe79a ) does not equal bucket.owner_account.email (admin@noobaa.io)
@nimrod-becker @jackyalbo Any thoughts?

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.

1 participant