Skip to content

HDDS-15141. Support HMAC-SHA256 signature verification for S3 chunked uploads - #11061

Open
rich7420 wants to merge 2 commits into
apache:masterfrom
rich7420:HDDS-15141
Open

HDDS-15141. Support HMAC-SHA256 signature verification for S3 chunked uploads#11061
rich7420 wants to merge 2 commits into
apache:masterfrom
rich7420:HDDS-15141

Conversation

@rich7420

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This task aims to introduce ChunksValidator to 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

… 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).
Copilot AI lite review requested due to automatic review settings August 19, 2026 12:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@rich7420

rich7420 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

cc @chungen0126 , @jojochuang and @peterxcli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants