Add fine-grained bucket access: paths, actions, conditions, raw #4
Reference in New Issue
Block a user
Delete Branch "benvin/bucketaccess-fine-grained-policy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
BucketAccessonly offered three coarse levels (read-only/read-write/full) applied to the whole bucket. Real grants often need to be scoped to a key prefix, limited to a source network or TLS, restricted to specific S3 actions, or expressed as an arbitrary statement. RGW (Reef 18.2+ / Squid) honours the S3 bucket-policy features to do all of this, so this exposes them onBucketAccesswhile keepinglevelas the ergonomic default.Builds on #3 (the go-ceph/radosgw rebuild, now merged).
Changes
BucketAccessspec fields:paths— scope object access to key prefixes (<bucket>/<prefix>*)actions— grant exactly these S3 actions instead of the level's setconditions—sourceIPs(aws:SourceIpallowlist) +secureTransportOnly(aws:SecureTransport)rawStatements— arbitrary S3 statements (effect/actions/resources/conditions) with the Principal injectedceph.Grant+BuildBucketPolicyto render prefixed object resources, custom-action statements, condition blocks and raw statements, all deterministic (sorted, stable sids)BucketAccessobjects no longer collapse onUID+levelaloneconfig/samples/04-access-fine-grained.yamlpolicy_test.go; document the fields in the READMENotes
rawStatementsis set,level/actions/paths/conditionsare ignored for that grant; rawresourceswithout anarn:prefix are treated as bucket-relative key prefixes.Verification
gofmt,go vet,go build ./...,go test -race ./...pass;CGO_ENABLED=0binary builds; CRDs regenerated with controller-gen v0.17.3.https://claude.ai/code/session_016CEncETbf8cvy1PhsHfFHM