-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
generate_presigned_url for put_bucket_cors results in invalid signature #2962
Comments
Hi @philipnbbc thanks for reaching out. Could you share more details on your use case? I'm not sure that generating a presigned url is intended to support the |
Our use case is that we have a service that indexes content in S3 and provides information that clients can use to read and write content directly to S3 using pre-signed URLs. The pre-signed URLs allow clients to not have AWS credentials and it avoids the service having to handle the object and bucket requests (with retries etc.), becoming a bottleneck in the S3 interactions. |
Thanks for following up, I brought this issue up for discussion with the team and think it requires more investigation. Marked this for further review. Quick update: after further investigation by the team, this issue appears to be due to recent changes involving endpoint rulesets. A fix will need to be implemented for this issue, for now we will leave the issue open and continue tracking the bug here. |
…tains a query component boto#2962
Bumps [boto3](https://github.com/boto/boto3) from 1.28.0 to 1.28.3. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/boto/boto3/blob/develop/CHANGELOG.rst">boto3's changelog</a>.</em></p> <blockquote> <h1>1.28.3</h1> <ul> <li>api-change:<code>cognito-idp</code>: [<code>botocore</code>] API model updated in Amazon Cognito</li> <li>api-change:<code>connect</code>: [<code>botocore</code>] Add support for deleting Queues and Routing Profiles.</li> <li>api-change:<code>datasync</code>: [<code>botocore</code>] Added LunCount to the response object of DescribeStorageSystemResourcesResponse, LunCount represents the number of LUNs on a storage system resource.</li> <li>api-change:<code>dms</code>: [<code>botocore</code>] Enhanced PostgreSQL target endpoint settings for providing Babelfish support.</li> <li>api-change:<code>ec2</code>: [<code>botocore</code>] This release adds support for the C7gn and Hpc7g instances. C7gn instances are powered by AWS Graviton3 processors and the fifth-generation AWS Nitro Cards. Hpc7g instances are powered by AWS Graviton 3E processors and provide up to 200 Gbps network bandwidth.</li> <li>api-change:<code>fsx</code>: [<code>botocore</code>] Amazon FSx for NetApp ONTAP now supports SnapLock, an ONTAP feature that enables you to protect your files in a volume by transitioning them to a write once, read many (WORM) state.</li> <li>api-change:<code>iam</code>: [<code>botocore</code>] Documentation updates for AWS Identity and Access Management (IAM).</li> <li>api-change:<code>mediatailor</code>: [<code>botocore</code>] Adds categories to MediaTailor channel assembly alerts</li> <li>api-change:<code>personalize</code>: [<code>botocore</code>] This release provides ability to customers to change schema associated with their datasets in Amazon Personalize</li> <li>api-change:<code>proton</code>: [<code>botocore</code>] This release adds support for deployment history for Proton provisioned resources</li> <li>api-change:<code>s3</code>: [<code>botocore</code>] S3 Inventory now supports Object Access Control List and Object Owner as available object metadata fields in inventory reports.</li> <li>api-change:<code>sagemaker</code>: [<code>botocore</code>] Amazon SageMaker Canvas adds WorkspeceSettings support for CanvasAppSettings</li> <li>api-change:<code>secretsmanager</code>: [<code>botocore</code>] Documentation updates for Secrets Manager</li> </ul> <h1>1.28.2</h1> <ul> <li>bugfix:s3: [<code>botocore</code>] Fix s3 presigned URLs for operations with query components (<code>[#2962](boto/boto3#2962) <https://github.com/boto/botocore/issues/2962></code>__)</li> <li>api-change:<code>cognito-idp</code>: [<code>botocore</code>] API model updated in Amazon Cognito</li> </ul> <h1>1.28.1</h1> <ul> <li>api-change:<code>dms</code>: [<code>botocore</code>] Releasing DMS Serverless. Adding support for PostgreSQL 15.x as source and target endpoint. Adding support for DocDB Elastic Clusters with sharded collections, PostgreSQL datatype mapping customization and disabling hostname validation of the certificate authority in Kafka endpoint settings</li> <li>api-change:<code>glue</code>: [<code>botocore</code>] This release enables customers to create new Apache Iceberg tables and associated metadata in Amazon S3 by using native AWS Glue CreateTable operation.</li> <li>api-change:<code>logs</code>: [<code>botocore</code>] Add CMK encryption support for CloudWatch Logs Insights query result data</li> <li>api-change:<code>medialive</code>: [<code>botocore</code>] This release enables the use of Thumbnails in AWS Elemental MediaLive.</li> <li>api-change:<code>mediatailor</code>: [<code>botocore</code>] The AWS Elemental MediaTailor SDK for Channel Assembly has added support for EXT-X-CUE-OUT and EXT-X-CUE-IN tags to specify ad breaks in HLS outputs, including support for EXT-OATCLS, EXT-X-ASSET, and EXT-X-CUE-OUT-CONT accessory tags.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/boto/boto3/commit/618d2b9281913b6acbf9e3e432fc6f5c48c8229c"><code>618d2b9</code></a> Merge branch 'release-1.28.3'</li> <li><a href="https://github.com/boto/boto3/commit/1d41697a41466733a1e271a59d9cb7a07f92d206"><code>1d41697</code></a> Bumping version to 1.28.3</li> <li><a href="https://github.com/boto/boto3/commit/643a04bebf5a55fd10978371cbd5bfec16937e15"><code>643a04b</code></a> Add changelog entries from botocore</li> <li><a href="https://github.com/boto/boto3/commit/132613ebbd96efef1277743318791186f2b1a8f0"><code>132613e</code></a> Merge branch 'release-1.28.2'</li> <li><a href="https://github.com/boto/boto3/commit/6671104a0ccc145a20d6d29f128d1422091bcb02"><code>6671104</code></a> Merge branch 'release-1.28.2' into develop</li> <li><a href="https://github.com/boto/boto3/commit/b107765ccab7f43ba651ec321adcdd9a32a5eb75"><code>b107765</code></a> Bumping version to 1.28.2</li> <li><a href="https://github.com/boto/boto3/commit/fe0be41d24d9f98bd526e47d41fb4a4fa2ac6b5b"><code>fe0be41</code></a> Add changelog entries from botocore</li> <li><a href="https://github.com/boto/boto3/commit/53a0c84b2e016f0491a8ebf34b3d902e71207c37"><code>53a0c84</code></a> Merge branch 'release-1.28.1'</li> <li><a href="https://github.com/boto/boto3/commit/3c988a24f22795d3cb9cf26a74c085d2e6a58504"><code>3c988a2</code></a> Merge branch 'release-1.28.1' into develop</li> <li><a href="https://github.com/boto/boto3/commit/eaa5d94bfc7e6720ebd73dbfa01bfc9b7be8da6d"><code>eaa5d94</code></a> Bumping version to 1.28.1</li> <li>Additional commits viewable in <a href="https://github.com/boto/boto3/compare/1.28.0...1.28.3">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=boto3&package-manager=pip&previous-version=1.28.0&new-version=1.28.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [boto3](https://github.com/boto/boto3) from 1.26.125 to 1.28.3. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/boto/boto3/blob/develop/CHANGELOG.rst">boto3's changelog</a>.</em></p> <blockquote> <h1>1.28.3</h1> <ul> <li>api-change:<code>cognito-idp</code>: [<code>botocore</code>] API model updated in Amazon Cognito</li> <li>api-change:<code>connect</code>: [<code>botocore</code>] Add support for deleting Queues and Routing Profiles.</li> <li>api-change:<code>datasync</code>: [<code>botocore</code>] Added LunCount to the response object of DescribeStorageSystemResourcesResponse, LunCount represents the number of LUNs on a storage system resource.</li> <li>api-change:<code>dms</code>: [<code>botocore</code>] Enhanced PostgreSQL target endpoint settings for providing Babelfish support.</li> <li>api-change:<code>ec2</code>: [<code>botocore</code>] This release adds support for the C7gn and Hpc7g instances. C7gn instances are powered by AWS Graviton3 processors and the fifth-generation AWS Nitro Cards. Hpc7g instances are powered by AWS Graviton 3E processors and provide up to 200 Gbps network bandwidth.</li> <li>api-change:<code>fsx</code>: [<code>botocore</code>] Amazon FSx for NetApp ONTAP now supports SnapLock, an ONTAP feature that enables you to protect your files in a volume by transitioning them to a write once, read many (WORM) state.</li> <li>api-change:<code>iam</code>: [<code>botocore</code>] Documentation updates for AWS Identity and Access Management (IAM).</li> <li>api-change:<code>mediatailor</code>: [<code>botocore</code>] Adds categories to MediaTailor channel assembly alerts</li> <li>api-change:<code>personalize</code>: [<code>botocore</code>] This release provides ability to customers to change schema associated with their datasets in Amazon Personalize</li> <li>api-change:<code>proton</code>: [<code>botocore</code>] This release adds support for deployment history for Proton provisioned resources</li> <li>api-change:<code>s3</code>: [<code>botocore</code>] S3 Inventory now supports Object Access Control List and Object Owner as available object metadata fields in inventory reports.</li> <li>api-change:<code>sagemaker</code>: [<code>botocore</code>] Amazon SageMaker Canvas adds WorkspeceSettings support for CanvasAppSettings</li> <li>api-change:<code>secretsmanager</code>: [<code>botocore</code>] Documentation updates for Secrets Manager</li> </ul> <h1>1.28.2</h1> <ul> <li>bugfix:s3: [<code>botocore</code>] Fix s3 presigned URLs for operations with query components (<code>[#2962](boto/boto3#2962) <https://github.com/boto/botocore/issues/2962></code>__)</li> <li>api-change:<code>cognito-idp</code>: [<code>botocore</code>] API model updated in Amazon Cognito</li> </ul> <h1>1.28.1</h1> <ul> <li>api-change:<code>dms</code>: [<code>botocore</code>] Releasing DMS Serverless. Adding support for PostgreSQL 15.x as source and target endpoint. Adding support for DocDB Elastic Clusters with sharded collections, PostgreSQL datatype mapping customization and disabling hostname validation of the certificate authority in Kafka endpoint settings</li> <li>api-change:<code>glue</code>: [<code>botocore</code>] This release enables customers to create new Apache Iceberg tables and associated metadata in Amazon S3 by using native AWS Glue CreateTable operation.</li> <li>api-change:<code>logs</code>: [<code>botocore</code>] Add CMK encryption support for CloudWatch Logs Insights query result data</li> <li>api-change:<code>medialive</code>: [<code>botocore</code>] This release enables the use of Thumbnails in AWS Elemental MediaLive.</li> <li>api-change:<code>mediatailor</code>: [<code>botocore</code>] The AWS Elemental MediaTailor SDK for Channel Assembly has added support for EXT-X-CUE-OUT and EXT-X-CUE-IN tags to specify ad breaks in HLS outputs, including support for EXT-OATCLS, EXT-X-ASSET, and EXT-X-CUE-OUT-CONT accessory tags.</li> </ul> <h1>1.28.0</h1> <ul> <li>enhancement:configprovider: [<code>botocore</code>] Always use shallow copy of session config value store for clients</li> <li>feature:configuration: [<code>botocore</code>] Configure the endpoint URL in the shared configuration file or via an environment variable for a specific AWS service or all AWS services.</li> <li>bugfix:configprovider: [<code>botocore</code>] Fix bug when deep copying config value store where overrides were not preserved</li> <li>api-change:<code>ec2</code>: [<code>botocore</code>] Add Nitro Enclaves support on DescribeInstanceTypes</li> <li>api-change:<code>location</code>: [<code>botocore</code>] This release adds support for authenticating with Amazon Location Service's Places & Routes APIs with an API Key. Also, with this release developers can publish tracked device position updates to Amazon EventBridge.</li> <li>api-change:<code>outposts</code>: [<code>botocore</code>] Added paginator support to several APIs. Added the ISOLATED enum value to AssetState.</li> <li>api-change:<code>quicksight</code>: [<code>botocore</code>] This release includes below three changes: small multiples axes improvement, field based coloring, removed required trait from Aggregation function for TopBottomFilter.</li> <li>api-change:<code>rds</code>: [<code>botocore</code>] Updates Amazon RDS documentation for creating DB instances and creating Aurora global clusters.</li> </ul> <h1>1.27.1</h1> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/boto/boto3/commit/618d2b9281913b6acbf9e3e432fc6f5c48c8229c"><code>618d2b9</code></a> Merge branch 'release-1.28.3'</li> <li><a href="https://github.com/boto/boto3/commit/1d41697a41466733a1e271a59d9cb7a07f92d206"><code>1d41697</code></a> Bumping version to 1.28.3</li> <li><a href="https://github.com/boto/boto3/commit/643a04bebf5a55fd10978371cbd5bfec16937e15"><code>643a04b</code></a> Add changelog entries from botocore</li> <li><a href="https://github.com/boto/boto3/commit/132613ebbd96efef1277743318791186f2b1a8f0"><code>132613e</code></a> Merge branch 'release-1.28.2'</li> <li><a href="https://github.com/boto/boto3/commit/6671104a0ccc145a20d6d29f128d1422091bcb02"><code>6671104</code></a> Merge branch 'release-1.28.2' into develop</li> <li><a href="https://github.com/boto/boto3/commit/b107765ccab7f43ba651ec321adcdd9a32a5eb75"><code>b107765</code></a> Bumping version to 1.28.2</li> <li><a href="https://github.com/boto/boto3/commit/fe0be41d24d9f98bd526e47d41fb4a4fa2ac6b5b"><code>fe0be41</code></a> Add changelog entries from botocore</li> <li><a href="https://github.com/boto/boto3/commit/53a0c84b2e016f0491a8ebf34b3d902e71207c37"><code>53a0c84</code></a> Merge branch 'release-1.28.1'</li> <li><a href="https://github.com/boto/boto3/commit/3c988a24f22795d3cb9cf26a74c085d2e6a58504"><code>3c988a2</code></a> Merge branch 'release-1.28.1' into develop</li> <li><a href="https://github.com/boto/boto3/commit/eaa5d94bfc7e6720ebd73dbfa01bfc9b7be8da6d"><code>eaa5d94</code></a> Bumping version to 1.28.1</li> <li>Additional commits viewable in <a href="https://github.com/boto/boto3/compare/1.26.125...1.28.3">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=boto3&package-manager=pip&previous-version=1.26.125&new-version=1.28.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
It looks like this can now be closed since #2971 was merged. |
|
Describe the bug
Generating a presigned URL for the
put_bucket_cors
method results in a signature that AWS reports as "SignatureDoesNotMatch"Expected Behavior
The signature should match and the method succeed.
Current Behavior
The request to AWS fails with the response text shown below (some text has been replaced with
REDACTED
).Note the end of StringToSign which has "/test-bucket/?cors". The error text shown further below shows that botocore is using "/test-bucket?cors?cors" instead!
The full output (with some text REDACTED) for the test code is:
Reproduction Steps
The code copied below can be used to reproduce the error and includes a hack to "fix" it The code generates a presigned URL and then makes a request. The
MODIFY_FUNC
variable toggles a "fix" in thebotocore.signers.generate_presigned_url()
function to get it to work.The code assumes that there exists a bucket named "test-bucket" in the "eu-west-1" region. The name and region can be changed as required.
Set
MODIFY_FUNC = False
to see the request failing Set it toMODIFY_FUNC = True
to see the test passing.Possible Solution
See the test code. Modifying
auth_path
property in therequest_dict
in thebotocore.signers.generate_presigned_url()
function results a correct StringToSign and it succeeds.Note however that this is meant as a quick hack and it is unclear what the proper fix should be.
Additional Information/Context
No response
SDK version used
botocore 1.29.143, boto3 1.26.143
Environment details (OS name and version, etc.)
Python 3.10 virtualenv
The text was updated successfully, but these errors were encountered: