fix(objectstorage): tighten public read bucket policy#7066
Merged
dinoallo merged 3 commits intoJul 20, 2026
Conversation
nowinkeyy
force-pushed
the
fix/objectstorage-public-read-policy
branch
from
July 17, 2026 04:04
6ce418f to
edaee13
Compare
nowinkeyy
force-pushed
the
fix/objectstorage-public-read-policy
branch
from
July 17, 2026 06:59
edaee13 to
9998231
Compare
dinoallo
requested changes
Jul 17, 2026
dinoallo
left a comment
Collaborator
There was a problem hiding this comment.
ListBucket should also be disabled in PublicReadWrite
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens the generated S3 bucket policies for “public” buckets in the objectstorage controller, primarily removing anonymous bucket-list/location permissions while adding/adjusting policy tests to prevent regressions.
Changes:
- Restrict
PublicReadBucketPolicyandPublicReadwriteBucketPolicyto avoid anonymous bucket listing/location actions (keep object-level actions only). - Refactor
BucketServiceAccountPolicystatements to separate bucket-level vs object-level resources/actions more cleanly. - Add unit tests for
buildPolicy(...)to validate the intended action/resource split and the tightened public policies.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| controllers/objectstorage/main.go | Import/flag formatting changes; introduces an unused CLI flag and removes kubebuilder scaffold marker. |
| controllers/objectstorage/controllers/suite_test.go | Test file import/var formatting; removes kubebuilder scaffold marker. |
| controllers/objectstorage/controllers/objectstorageuser_controller.go | Mostly formatting and minor error/string conversion adjustments. |
| controllers/objectstorage/controllers/objectstoragebucket_controller.go | Tightens public bucket policy generation and refactors service account policy statements. |
| controllers/objectstorage/controllers/objectstoragebucket_controller_test.go | Adds unit tests covering policy JSON and action/resource expectations. |
dinoallo
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.