Skip to content

feat(s2n-metric-subscriber): add supported parameters#5768

Merged
jmayclin merged 6 commits intoaws:mainfrom
jmayclin:2026-01-22-supported-params
Mar 17, 2026
Merged

feat(s2n-metric-subscriber): add supported parameters#5768
jmayclin merged 6 commits intoaws:mainfrom
jmayclin:2026-01-22-supported-params

Conversation

@jmayclin
Copy link
Copy Markdown
Contributor

@jmayclin jmayclin commented Mar 3, 2026

Goal

Add support for supported_parameter metrics to the metrics subscriber.

Why

This is necessary to determine if a security policy can be changed without breaking customers.

How

s2n-tls does not expose APIs to retrieve this information, so we manually parse them out of the relevant parts of the ClientHello.

It is admittedly not great to write a new client hello parser. However C is a violent creature that must be kept at arms length, so I think it's better to go this way than exposing more of the C parser.

Note that I do use the existing parser where possible to pull out the extensions.

Callouts

I am currently directly referencing s2n-codec through a git dependency. We'll need to update that for the next release.

Testing

Added unit tests. The snapshot test is also useful.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the s2n-core team label Mar 3, 2026
@jmayclin jmayclin changed the title 2026 01 22 supported params feat(s2n-metric-subscriber): add supported parameters Mar 3, 2026
@jmayclin jmayclin force-pushed the 2026-01-22-supported-params branch from 943575b to c936971 Compare March 10, 2026 22:12
@jmayclin jmayclin marked this pull request as ready for review March 10, 2026 22:17
* add copyright header
if conn.client_hello_is_sslv2()? {
self.sslv2_client_hello.fetch_add(1, Ordering::Relaxed);
} else {
let supported_parameter = ClientHelloSupportedParameters::new(conn.client_hello()?);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm okay let me see if I understand the motivation for this PR is. Handshake records previously contained lists of negotiated crypto parameters. A user looks at the cumulative crypto parameters and understands what's getting negotiated(and therefore what is safe to drop support for.) Now we are adding all supported parameters to the handshake event, presumably because we want to know my peers support (i.e. what parameters are safe to move to). But do you know that? If one client doesn't support x25519, would that be lost in the noise of the other clients who do supported x25519? Or is the goal to do some reasoning, we did 100 handshakes and 99 handshakes had clients that supported x25519, therefore there must be one client that will be broken if we only offered x25519?
Just wondering since negotiated parameters is useful when cumulative, but supported parameters is more of a "per connection" type of datapoint in my mind.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If one client doesn't support x25519, would that be lost in the noise of the other clients who do supported x25519?

No, because we also know the total handshake count.

Consider the use case where you want to shift an endpoint to a FIPS policy. Currently everyone negotiates x25519, because that's the key share that they are sending. Let's say that there are 100 handshakes on the endpoints

handshake_count: 100
negotiated.x25519: 94
negotiated.secp256r1: 6
supported.x25519: 95
supported.secp256r1: 99

In this case, we know that there is one connection which didn't support secp256r1, and would have been broken by the FIPS policy.

@jmayclin jmayclin added this pull request to the merge queue Mar 17, 2026
Merged via the queue into aws:main with commit b0e48bd Mar 17, 2026
54 checks passed
@jmayclin jmayclin deleted the 2026-01-22-supported-params branch March 17, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants