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

Backport of backend/s3: prevent keys containing double slashes into v1.6 #33877

Conversation

teamterraform
Copy link
Contributor

Backport

This PR is auto-generated from #33869 to be assessed for backporting due to the inclusion of the label 1.6-backport.

The below text is copied from the body of the original PR.


With the AWS Go SDK V2, URI cleaning of S3 object URLs is no longer done by default. As such, key values containing double slashes (//) could introduce situations where an existing statefile cannot be read. This additional validation step disallows keys containing double slashes to prevent this.

Prevention of leading and trailing slashes (also potential failure points with AWS Go SDK v2) is already done via the validateStringS3Path validator.

% TF_ACC=1 go test ./internal/backend/remote-state/s3/...
ok      github.com/hashicorp/terraform/internal/backend/remote-state/s3 122.148

Relates #33687
Relates hashicorp/terraform-provider-aws#33358 (changes to URI cleaning discovered during SDK upgrade of this resource in the AWS Provider)

Target Release

1.6.x

Draft CHANGELOG entry

N/A - validation change only.

@teamterraform teamterraform requested a review from a team as a code owner September 12, 2023 13:41
@teamterraform teamterraform force-pushed the backport/s3/key-double-slash-validation/optionally-advanced-sheepdog branch 2 times, most recently from 1c7272d to 47cefd2 Compare September 12, 2023 13:41
@jar-b
Copy link
Member

jar-b commented Sep 12, 2023

% TF_ACC=1 go test ./internal/backend/remote-state/s3/...
ok      github.com/hashicorp/terraform/internal/backend/remote-state/s3 122.594s

@jar-b jar-b merged commit 0e6a627 into v1.6 Sep 12, 2023
6 checks passed
@jar-b jar-b deleted the backport/s3/key-double-slash-validation/optionally-advanced-sheepdog branch September 12, 2023 13:52
@github-actions
Copy link

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

Copy link

github-actions bot commented Dec 9, 2023

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants