HDDS-15141. Support HMAC-SHA256 signature verification for S3 chunked uploads - #11061
Open
rich7420 wants to merge 2 commits into
Open
HDDS-15141. Support HMAC-SHA256 signature verification for S3 chunked uploads#11061rich7420 wants to merge 2 commits into
HMAC-SHA256 signature verification for S3 chunked uploads#11061rich7420 wants to merge 2 commits into
Conversation
… verification Add ChunksValidator (HMAC-SHA256 per-chunk signature verification, verified against the AWS SigV4 streaming test vector) and wire it into SignedChunksInputStream as an optional validator. Add SIGNATURE_DOES_NOT_MATCH.
Wire ChunksValidator into the signed multi-chunk PUT paths: single-object PUT (streaming and non-streaming) and multipart UploadPart (streaming and non-streaming). The OM-derived signing key (HDDS-15140) is only available after the key is opened, so SignedChunksInputStream gains a guarded attachValidator() that must be called before the first read; the endpoint requests the key via derivedKeyPiggyBacking and attaches the validator once the key is open. Enforcement follows secure mode: in secure mode OM always returns the derived key for a signed upload, so a missing key is rejected (INTERNAL_ERROR) rather than stored unverified; in non-secure mode there is no secret to verify against and verification is skipped. Teach OzoneBucketStub the HDDS-15140 derivedKeyPiggyBacking stream overloads, and add attachValidator tests (deferred attach, tamper rejection, before-read and attach-once guards).
Contributor
Author
|
cc @chungen0126 , @jojochuang and @peterxcli |
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.
What changes were proposed in this pull request?
This task aims to introduce
ChunksValidatorto verify signature for the STREAMING-AWS4-HMAC-SHA256-PAYLOAD algorithm within the S3 Gateway.The primary goal is to enable SignedChunksInputStream to verify the authenticity of each data chunk in real-time. By calculating the HMAC-SHA256 hash of the streaming payload and comparing it against the chunk-signature provided in the S3 chunk header, S3G can ensure data integrity and reject tampered or unauthorized data before it reaches the backend storage.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15141
How was this patch tested?
https://github.com/rich7420/ozone/actions/runs/32246615796