
I Tried Verifying PQ-TLS for Amazon S3 Using CloudTrail Logging (keyExchange)
This page has been translated by machine translation. View original
Introduction
On November 17, 2026, the per-request TLS key exchange method for Amazon S3 began to be recorded in CloudTrail. On the same day, PQ-TLS key exchange was also supported for S3 Vectors and for AWS PrivateLink for Amazon S3 interface endpoints.
According to the announcement, it is recorded in tlsDetails.keyExchange of management events and data events. In this article, I sent the management event ListBuckets to the regional S3 endpoint from curl and the AWS CLI. I did not create a trail, and I compared the keyExchange in Event history with the key exchange observed on the curl side and the AWS CLI version.
Test environment
- Host: Fedora Asahi Remix 44 (aarch64)
- AWS CLI 2.41.0
- Other versions of the AWS CLI: the aarch64 Docker image
amazon/aws-cli
- Other versions of the AWS CLI: the aarch64 Docker image
- curl 8.18.0 (OpenSSL 3.5.9)
- Region is ap-northeast-1
Values recorded in CloudTrail
I extracted the relevant lines from the CloudTrail event for the ListBuckets sent with curl. The userAgent contains the label attached to curl.
"eventTime": "2026-11-18T10:20:50Z",
"eventSource": "s3.amazonaws.com",
"eventName": "ListBuckets",
"userAgent": "[pqtls-curl-x25519mlkem768]",
"tlsDetails": {
"tlsVersion": "TLSv1.3",
"cipherSuite": "TLS_AES_128_GCM_SHA256",
"clientProvidedHostHeader": "s3.ap-northeast-1.amazonaws.com",
"keyExchange": "X25519MLKEM768"
}
The values observed in this ListBuckets test were X25519MLKEM768, x25519, and secp256r1. The table in the S3 User Guide also lists SecP256r1MLKEM768, a post-quantum (PQ) method, and secp384r1, a classical one. Both PQ values contain MLKEM, so using this string as a condition catches both.
Verification with curl
Sending signed requests
I fixed the key exchange with curl's --curves and the TLS version options, and sent signed ListBuckets requests. The SSL connection using line in curl's -v output is treated as the client-side observed value. The x-amz-request-id in the response headers of the same output is used later to identify the CloudTrail event.
Save the following script as curl-s3-signed.sh. The first argument is a label to attach to the User-Agent, and it ends up in the CloudTrail userAgent. The credentials are passed to curl as configuration via standard input, and the signature and token are masked in the -v output.
curl-s3-signed.sh
#!/usr/bin/env bash
# Usage: curl-s3-signed.sh <label to attach to User-Agent> [curl TLS options...]
# Prerequisite: AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN are set as environment variables.
set -euo pipefail
label="$1"; shift
region="${AWS_REGION:-ap-northeast-1}"
printf 'user = "%s:%s"\nheader = "x-amz-security-token: %s"\n' \
"$AWS_ACCESS_KEY_ID" "$AWS_SECRET_ACCESS_KEY" "$AWS_SESSION_TOKEN" |
curl -sv -K - -o /dev/null -A "$label" \
--aws-sigv4 "aws:amz:${region}:s3" "$@" \
"https://s3.${region}.amazonaws.com/" 2>&1 |
sed -E 's/(x-amz-security-token:) ?.*/\1 <redacted>/I;
s/(Credential=)[A-Z0-9]+/\1<redacted>/;
s/(Signature=)[0-9a-f]+/\1<redacted>/;
s/(Signature - )[0-9a-f]+/\1<redacted>/;
s/(with user ')[A-Za-z0-9]+/\1<redacted>/'
After setting the temporary credentials and the region as environment variables, I send requests with the key exchange fixed in three ways. Then I send a request with only --tlsv1.3 specified and no --curves, twice.
eval "$(aws configure export-credentials --profile <プロファイル名> --format env)"
export AWS_REGION=ap-northeast-1
bash curl-s3-signed.sh pqtls-curl-x25519mlkem768 --tlsv1.3 --curves X25519MLKEM768
bash curl-s3-signed.sh pqtls-curl-x25519 --tlsv1.3 --curves X25519
bash curl-s3-signed.sh pqtls-curl-tls12 --tlsv1.2 --tls-max 1.2
bash curl-s3-signed.sh pqtls-curl-timing --tlsv1.3
bash curl-s3-signed.sh pqtls-curl-timing2 --tlsv1.3
Matching against CloudTrail values
I matched the x-amz-request-id in the response headers against the requestID of the CloudTrail events, and retrieved the corresponding events from Event history.
aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=ListBuckets --start-time <start-time> --max-results 50 --query "Events[].CloudTrailEvent" --output text | jq 'select(.requestID=="<request-id>")'
The curl observation is taken from the SSL connection using line. The CloudTrail values are taken from tlsVersion, cipherSuite, and keyExchange in tlsDetails. Both are listed in the order "version / cipher suite / key exchange".
| curl option | curl observation | CloudTrail record |
|---|---|---|
--tlsv1.3 --curves X25519MLKEM768 |
TLSv1.3 / TLS_AES_128_GCM_SHA256 / X25519MLKEM768 | TLSv1.3 / TLS_AES_128_GCM_SHA256 / X25519MLKEM768 |
--tlsv1.3 --curves X25519 |
TLSv1.3 / TLS_AES_128_GCM_SHA256 / x25519 | TLSv1.3 / TLS_AES_128_GCM_SHA256 / x25519 |
--tlsv1.2 --tls-max 1.2 |
TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256 / secp256r1 | TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256 / secp256r1 |
--tlsv1.3 (1st) |
TLSv1.3 / TLS_AES_128_GCM_SHA256 / X25519MLKEM768 | TLSv1.3 / TLS_AES_128_GCM_SHA256 / X25519MLKEM768 |
With this curl (OpenSSL 3.5.9), the key exchange for --tlsv1.3 without --curves is X25519MLKEM768. For the 2nd --tlsv1.3 request as well, the CloudTrail keyExchange was X25519MLKEM768. To connect with a classical key exchange, add --curves X25519 or pin to TLS 1.2.
The S3 User Guide says that management events without a trail appear in Event history within about 15 minutes. The two requests with only --tlsv1.3 specified were found in Event history 48 to 84 seconds after their eventTime.
Verification with the AWS CLI
keyExchange by version
I ran s3api list-buckets on each version. Credentials were passed via the same environment variables as for curl, and --debug was added to obtain the x-amz-request-id of the response.
docker run --rm -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN -e AWS_REGION amazon/aws-cli:<版> s3api list-buckets --debug --query 'Buckets[].Name' --output text
The --debug output contains the session token, signature, and bucket names, so mask them when sharing.
| AWS CLI version | Run from | keyExchange | Bundled OpenSSL |
|---|---|---|---|
| 2.33.0 | Docker | x25519 | 1.1.1zd |
| 2.34.0 | Docker | x25519 | 1.1.1zf |
| 2.34.50 | Docker | x25519 | 1.1.1zg |
| 2.34.52 | Docker | x25519 | 1.1.1zg |
| 2.34.53 | Docker | X25519MLKEM768 | 3.5.6 |
| 2.34.54 | Docker | X25519MLKEM768 | 3.5.6 |
| 2.40.1 | Docker | X25519MLKEM768 | Not checked |
| 2.40.2 | Docker (latest tag) | X25519MLKEM768 | Not checked |
| 2.41.0 | Host | X25519MLKEM768 | Not checked |
In the Docker images, the bundled OpenSSL became 3.5.6 at 2.34.53, and the keyExchange changed to X25519MLKEM768.
--debug output and request ID
In the output of ListBuckets with --debug on host version 2.41.0, none of the TLS key exchange, cipher suite, or version was shown. For this reason, the AWS CLI's key exchange is checked on the CloudTrail side.
The x-amz-request-id in the response headers matched the CloudTrail requestID for all 14 of the curl and AWS CLI requests I tested. The event corresponding to a request sent by the AWS CLI can be identified by the x-amz-request-id in the --debug output.
Searching in CloudTrail
Requests with classical key exchange
Extract the events where keyExchange is recorded and its value does not contain MLKEM, together with the userAgent.
aws cloudtrail lookup-events --region ap-northeast-1 --lookup-attributes AttributeKey=EventSource,AttributeValue=s3.amazonaws.com --start-time 2026-11-18T10:19:00Z --query "Events[].CloudTrailEvent" --output text | jq -c 'select(.tlsDetails.keyExchange != null and (.tlsDetails.keyExchange | test("MLKEM") | not)) | {eventTime, userAgent: (.userAgent | split(" ")[0]), keyExchange: .tlsDetails.keyExchange, tlsVersion: .tlsDetails.tlsVersion}'
{"eventTime":"2026-11-18T10:27:51Z","userAgent":"[aws-cli/2.34.52","keyExchange":"x25519","tlsVersion":"TLSv1.3"}
{"eventTime":"2026-11-18T10:27:50Z","userAgent":"[aws-cli/2.34.50","keyExchange":"x25519","tlsVersion":"TLSv1.3"}
{"eventTime":"2026-11-18T10:27:48Z","userAgent":"[aws-cli/2.34.0","keyExchange":"x25519","tlsVersion":"TLSv1.3"}
{"eventTime":"2026-11-18T10:21:28Z","userAgent":"[aws-cli/2.33.0","keyExchange":"x25519","tlsVersion":"TLSv1.3"}
{"eventTime":"2026-11-18T10:20:50Z","userAgent":"[pqtls-curl-x25519]","keyExchange":"x25519","tlsVersion":"TLSv1.3"}
{"eventTime":"2026-11-18T10:20:50Z","userAgent":"[pqtls-curl-tls12]","keyExchange":"secp256r1","tlsVersion":"TLSv1.2"}
Only the six classical requests I sent this time were returned from Event history (management events). The AWS CLI version and label in the userAgent serve as clues for finding clients that need to be migrated.
Summary
I confirmed that the per-request TLS key exchange method for Amazon S3 is recorded in CloudTrail's tlsDetails.keyExchange. Requests that used a classical key exchange could also be filtered by the keyExchange value.
What I verified this time was S3 management events. The announcement says it is also recorded for data events, so by logging S3 data events you can use CloudTrail's keyExchange to assure that access to objects is done over PQ-TLS. If you use S3 in a workload that requires PQ support, give it a try.
