fix: authorize explicit version deletes with DeleteObjectVersion - #104
Merged
Conversation
Vonng
force-pushed
the
codex/issue-58-delete-version-authz
branch
from
September 1, 2026 18:32
b2f4509 to
14d89a9
Compare
Member
Author
|
Final stacked validation update:
The PR remains based on #101 and should be retargeted to |
Prove that DeleteObjectVersion-only principals cannot delete named UUID or null versions while DeleteObject-only principals can, contrary to the S3 action mapping in issue #58. Signed-off-by: Feng Ruohang <rh@vonng.com>
Select DeleteObject or DeleteObjectVersion from each request's effective version ID for single and multi-delete. Authenticate multi-delete once, bind version conditions to each XML entry, and keep the established DeleteObject plus ReplicateDelete target contract with explicit version denies honored only on trusted replication.\n\nRefs: #58 Signed-off-by: Feng Ruohang <rh@vonng.com>
Document that replication targets retain the DeleteObject plus ReplicateDelete contract and extend the existing two-site test with a target user that lacks DeleteObjectVersion. Use mc for explicit version deletion so the gate no longer depends on AWS CLI. Signed-off-by: Feng Ruohang <rh@vonng.com>
Authenticate DeleteObjects before validating entry count, remove the obsolete per-version auth helper, and pin the marker-only request to the ordinary authorization path.\n\nRefs: #58 Signed-off-by: Feng Ruohang <rh@vonng.com>
Vonng
force-pushed
the
codex/issue-58-delete-version-authz
branch
from
September 1, 2026 23:08
770ccfc to
6d65517
Compare
Accept the additional DeleteObjects route literal introduced by the issue #58 regression matrix. Signed-off-by: Feng Ruohang <rh@vonng.com>
Vonng
force-pushed
the
codex/issue-58-delete-version-authz
branch
from
September 1, 2026 23:08
6d65517 to
d2d47a4
Compare
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.
Contribution Licensing (no CLA, inbound=outbound, DCO required)
Every commit in this PR carries a DCO
Signed-off-bytrailer. The first commit is the deterministic red reproduction requested by issue #58.Description
Select delete authorization from the request's effective version ID:
versionIds3:DeleteObjects3:DeleteObjectVersionversionId=nulls3:DeleteObjectVersionDeleteObjectsThe PR:
DenyOnly DeleteObjectVersioncompatibility block;DeleteObjectsonce, then authorizes each entry independently;s3:versionidconditions to each effective entry, not an outer query or copy-source decoy;mc rm --version-id.Refs #58.
Motivation and Context
Previously, SILO authorized every object delete as
s3:DeleteObjectand useds3:DeleteObjectVersiononly as an explicit-deny check. A DeleteObject-only principal could permanently remove historical versions, while a least-privilege DeleteObjectVersion-only purge principal could not perform an explicit version delete.A direct action remap on trusted replication would break every documented target policy and silently stall permanent-delete replication. This PR therefore separates ordinary S3 authorization from the already-deployed receiver compatibility contract.
How to test this PR?
Passed locally on macOS/arm64 with Go 1.27.0:
null, malformed ID, padded ID, query decoy, per-entry Null/StringEquals conditions, explicit deny, and error ordering;-race;go build ./...;go vet ./cmd;go test ./cmd -count=1(final run: 131.769s);bash -n docs/bucket/replication/delete-replication.sh;make test-delete-replicationwith race binaries and two local sites. A targetrepluserpolicy contained DeleteObject+ReplicateDelete but no DeleteObjectVersion; permanent version deletion and delete-marker replication both converged.golangci-lintreports only the four known findings inherited from #101 (tworeplication-trust.goformatting/revive findings and two CORS test misspellings); this delta adds no lint finding.Claude Code Opus 5 performed an adversarial implementation review and a targeted rereview. Final verdict: GO, no P0/P1/P2.
Compatibility impact
s3:DeleteObjectlose the ability to delete an explicitly named UUID ornullversion. Grants3:DeleteObjectVersionwhere that operation is intended.s3:versionidconditions retain normal precedence;DeleteObjectsmay return mixed per-entry results.X-Minio-Force-Deleteprefix cleanup remains DeleteObject-gated and is not remapped by this PR.Types of changes
Checklist:
git commit -s) per the DCOmake verifierspassespgsty/silo.pgsty.com