Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Announcement: S3 default integrity change #1240

Open
aBurmeseDev opened this issue Jan 16, 2025 · 5 comments
Open

Announcement: S3 default integrity change #1240

aBurmeseDev opened this issue Jan 16, 2025 · 5 comments
Labels
announcement This is an announcement

Comments

@aBurmeseDev
Copy link
Member

aBurmeseDev commented Jan 16, 2025

In AWS SDK for Rust v1.69.0, we released changes to the S3 client that adopts new default integrity protections. For more information on default integrity behavior, please refer to the official SDK documentation. In SDK releases from this version on, clients default to enabling an additional checksum on all Put calls and enabling validation on Get calls.

You can disable default integrity protections for S3. We do not recommend this because checksums are important to S3 integrity posture. Integrity protections can be disabled by setting the config flag to WHEN_REQUIRED, or by using the related AWS shared config file settings or environment variables.

Disclaimer: the AWS SDKs and CLI are designed for usage with official AWS services. We may introduce and enable new features by default, such as these new default integrity protections, prior to them being supported or otherwise handled by third-party service implementations. You can disable the new behavior with the WHEN_REQUIRED value for the request_checksum_calculation and response_checksum_validation configuration options covered in Data Integrity Protections for Amazon S3.

@danprueitt
Copy link

Seems changing the default breaks AWS S3 Presigned PUTs if you don't explicitly set a checksum? I can see a checksum is added to the headers and when the client attempts an upload it gets:

Error><Code>BadDigest</Code><Message>The CRC32 you specified did not match the calculated checksum.</Message>
...

The issue was resolved by setting the config to WHEN_REQUIRED, but this feels like a breaking behavior change in this scenario. Wouldn’t it be better to manage this change behind a behavior_version in the AWS config instead?

@ysaito1001
Copy link
Collaborator

Hi @danprueitt, thank you for bringing that to our attention. Sounds like it's a regular S3 presigned PUT requests that are affected? Can you provide us with a reproducer so we can work backwards from it?

@jmklix jmklix added the announcement This is an announcement label Jan 16, 2025
@landonxjames
Copy link
Contributor

@danprueitt I was able to replicate your issue and working on a fix now, thanks for bringing this to our attention.

@aaronmondal
Copy link

It looks like this change added the crc64fast-nvme dependency which contains bindgen code as of awesomized/crc64fast-nvme@1ec317f. This is somewhat hard to work with in sandboxed builds (like Bazel) as it tries to write to read-only directories. IIUC the aws sdk doesn't actually make use of the bindings.

See also: awesomized/crc64fast-nvme#5

github-merge-queue bot pushed a commit to smithy-lang/smithy-rs that referenced this issue Jan 17, 2025
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
Fixing bug reported in
awslabs/aws-sdk-rust#1240 (comment)

## Description
<!--- Describe your changes in detail -->

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
Updated presigning integ tests to account for behavior specified in SEP,
added new test for the user provided checksum case

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] For changes to the AWS SDK, generated SDK code, or SDK runtime
crates, I have created a changelog entry Markdown file in the
`.changelog` directory, specifying "aws-sdk-rust" in the `applies_to`
key.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
@landonxjames
Copy link
Contributor

Fix was merged in smithy-lang/smithy-rs#3971, we are working to release the codegen now and the actual fix should be released in version 1.70.0 of the aws-sdk-s3 crate on Monday

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
announcement This is an announcement
Projects
None yet
Development

No branches or pull requests

6 participants