Repository navigation
ir/container: verify eACL signature on container creation - #4304
Draft
hal0x9000[bot] wants to merge 1 commit into
Draft
hal0x9000[bot] wants to merge 1 commit into
hal0x9000[bot] wants to merge 1 commit into
Conversation
An eACL table attached to a container Put request was approved by the Inner Ring without checking who signed it. Since storage nodes always pass the original API request to the contract, the creation path called checkSetEACL with checkSig set to false, so the table was only validated structurally. The original request check covers the container (or the request) signature but never eacl_signature, so a table signed by any key was stored, while the same table sent as a separate SetExtendedACL request was rejected. Drop the flag and always authenticate the table the same way as a standalone eACL update: the signer must be the container owner or be authorized by an owner-issued session with the SetEACL verb. Fixes #4298. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4304 +/- ##
==========================================
+ Coverage 32.83% 33.15% +0.32%
==========================================
Files 673 673
Lines 41706 41704 -2
==========================================
+ Hits 13694 13829 +135
+ Misses 28012 27875 -137 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Warning
The commit has no
Signed-off-by:trailer because no sign-off was requested for this run. The DCO check will fail until a human signs off.Closes #4298.
What was wrong
An eACL table attached to
Container.PutRequestwas stored without checking who signed it. The same table and signature sent later as a standaloneSetExtendedACLwas correctly rejected.The cause is a regression from 1f53dc2. Since that commit the storage node always forwards the original API request, so in
processCreateContainerRequestthe callalways passed
checkSig == false, andcheckSetEACLreturned before reaching its signature check. Nothing else covered the eACL signer:checkOriginalRequestauthenticates the container signature (API < 2.29) or the whole request signature (API >= 2.29), nevereacl_signature, and on the storage nodeServer.Putonly checks that the signature is present.What this changes
The
checkSigbypass is removed, so both paths converge on one rule: the eACL must be signed by the container owner, or by a key authorized through an owner-issued session for SetEACL on that container — the same rule standaloneSetExtendedACLalready applies.Behaviour change. Container creation with an attached eACL is now rejected when it is covered only by:
CONTAINER_SETEACL, orThis is a restoration, not a new restriction: before 1f53dc2
checkSetEACLrequiredVerbContainerSetEACLwith the Put token as well, and it matches the SDK's documented contract forWithEACL.Verification
process_container_test.gofail onmasterand pass here: an eACL signed by a foreign key, a V2 session without SetEACL, and a V2 session whose eACL signer differs from the session subject. The positive cases pass on both, as they should.go build,golangci-lint(0 issues) andgo test -race -shuffle=on ./...pass.Open for reviewers
The test drives
processCreateContainerRequestend to end with a zero FS chain client, so approval always fails and the test asserts on the logged outcome rather than a returned error. Extracting the eACL block into a separately testable function would allow direct assertions; that seemed larger than this fix warranted, but say if you would prefer it.Implements proposal v1 (option A), with no deviation in approach.