Bug #76206
closedBucket Logging record field not populated correctly for presigned urls.
0%
Description
AuthenticationType in standard mode log record is not populated with "QueryString" for a request with presigned url.(It is set correctly when using the aws cli.)
import boto3
import requests
client = boto3.client("s3", aws_access_key_id="root-access-key", aws_secret_access_key="root-secret-key",endpoint_url="http://127.0.0.1:7777", region_name="us-east-1")
client.generate_presigned_url(ClientMethod="get_object", HttpMethod='GET', Params={"Bucket": "my-test-bucket", "Key": "object-1"})
'http://127.0.0.1:7777/my-test-bucket/object-1?AWSAccessKeyId=root-access-key&Signature=VCRBrSTpoRNOWs2qtEODXuL4jzs%3D&Expires=1776847466'
requests.get('http://127.0.0.1:7777/my-test-bucket/object-1?AWSAccessKeyId=root-access-key&Signature=VCRBrSTpoRNOWs2qtEODXuL4jzs%3D&Expires=1776847466')
<Response [200]>
Log record:
root-user my-test-bucket [22/Apr/2026:07:44:41 +0000] 127.0.0.1 root-user 33a371d8-7b19-4263-b58d-6bbf9e04ea0a.4180.748874064485556576 REST.GET.OBJECT object-1 "GET /my-test-bucket/object-1?AWSAccessKeyId=root-access-key&Signature=VCRBrSTpoRNOWs2qtEODXuL4jzs%3D&Expires=1776847466 HTTP/1.1" 200 - - 5257 - 2ms - "python-requests/2.32.5" - - - - - 127.0.0.1 - - Yes
NB Updated by Nithya Balachandran 7 months ago
- Assignee set to Nithya Balachandran
- Backport set to squid, tentacle
NB Updated by Nithya Balachandran 7 months ago
- Description updated (diff)
NB Updated by Nithya Balachandran 7 months ago ยท Edited
The current code checks for the presence of the "x-amz-credential" parameter to determine whether the request is a presigned url. X-Amz-Credential is a mandatory query parameter used in AWS Signature Version 4 to authenticate requests via query strings (e.g., presigned URLs).
However this does not handle presigned requests using Signature version 2. A better way is to check for the Expires or X-Amz-Expires field.
The issue where a boto3 presigned URL contains an Expires parameter instead of X-Amz-Expires is typically due to the AWS Signature Version being used. Expires is characteristic of the older Signature Version 2, while X-Amz-Expires is used in Signature Version 4 (SigV4).
NB Updated by Nithya Balachandran 7 months ago
- Pull request ID set to 68540
NB Updated by Nithya Balachandran 7 months ago
- Status changed from New to Fix Under Review
NB Updated by Nithya Balachandran 7 months ago
- Backport changed from squid, tentacle to tentacle
UB Updated by Upkeep Bot 7 months ago
- Status changed from Fix Under Review to Pending Backport
- Merge Commit set to cfec561b2da9632ff1f7ce54f505fe0d368c231f
- Fixed In set to v21.0.0-956-gcfec561b2d
- Upkeep Timestamp set to 2026-04-28T07:37:08+00:00
UB Updated by Upkeep Bot 7 months ago
- Copied to Backport #76289: tentacle: Bucket Logging record field not populated correctly for presigned urls. added
UB Updated by Upkeep Bot 7 months ago
- Tags (freeform) set to backport_processed
UB Updated by Upkeep Bot 5 months ago
- Status changed from Pending Backport to Resolved
- Upkeep Timestamp changed from 2026-04-28T07:37:08+00:00 to 2026-07-10T13:28:44+00:00
UB Updated by Upkeep Bot 3 months ago
- Tags (freeform) deleted (
backport_processed) - Upkeep Timestamp changed from 2026-07-10T13:28:44+00:00 to 2026-08-28T01:41:56+00:00
UB Updated by Upkeep Bot about 1 month ago
- Released In set to v21.2.0~630
- Upkeep Timestamp changed from 2026-08-28T01:41:56+00:00 to 2026-10-24T02:03:13+00:00