Repository navigation
Conversation
When mutual TLS is used, add the details of the client certificate (status, subject, issuer, serial, validity, protocol, cipher suite, common name, SHA-256 fingerprint, SANs) to `[@metadata]`, aligned with the field names of the beats input. Requests headers prefixed with `tls_peer_` are discarded so the values cannot be forged by a client. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nabled Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
Changelog and Version ManagementNo changelog or version changes detected. You can either update them manually or use a comment command to update them automatically on merge:
Omit the entry line to use the PR title. If multiple commands are posted, the last one wins. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an opt-in
ssl_peer_metadataoption (boolean, defaultfalse). When mutual TLS is used, the details of the client certificate are added to[@metadata]of the events, like thessl_peer_metadataenrichment of the beats input.Requires
ssl_client_authenticationto beoptionalorrequired(aConfigurationErroris raised otherwise).Fields
v1/v8disabled[@metadata][tls_peer][status][@metadata][tls_peer][status][@metadata][input][http][tls][client][subject][@metadata][tls_peer][subject][@metadata][input][http][tls][version_protocol][@metadata][tls_peer][protocol][@metadata][input][http][tls][cipher][@metadata][tls_peer][cipher_suite][@metadata][input][http][tls][client][x509][subject][common_name][@metadata][tls_peer][subject_cn][@metadata][input][http][tls][client][issuer][@metadata][tls_peer][issuer_dn][@metadata][input][http][tls][client][x509][serial_number][@metadata][tls_peer][serial][@metadata][input][http][tls][client][not_before]/[not_after][@metadata][tls_peer][not_before]/[not_after][@metadata][input][http][tls][client][hash][sha256][@metadata][tls_peer][fingerprint_sha256][@metadata][input][http][tls][client][x509][alternative_names][@metadata][tls_peer][sans]statusisverifiedwhen the client presented a certificate,unverifiedotherwise (only possible withoptional). Names follow the beats input; the ECS ones usetls.client.*, under[@metadata][input][http]like the other ECS fields of this plugin. Note thatx509.alternative_namesis not in the official ECS spec.How
The certificate is not reachable from the Ruby side (the Java
IMessageHandleronly receives remote address, headers and body).TlsPeerInfo(Java) reads the peer certificate from theSSLSession, once per connection, andMessageProcessorhands it over astls_peer_*pseudo-headers. The Ruby side moves them out of the headers and into[@metadata].ssl_peer_metadatais enabled (passed down toNettyHttpServer; existing constructors are kept).tls_peer_*/Tls-Peer-*sent by a client are always discarded, so the values cannot be forged.Tests
TlsPeerInfoTest.disabledandv1, forged headers ignored, client without certificate (optional), option disabled, config validation.disabledandv1).additional_codecsspecs fail locally with and without this change (Logstash 8.19.24 and 9.5.6 cores).CHANGELOG.md/ version are left to/pr_prepare.Relates to logstash-plugins/logstash-integration-logstash#22. A backport to
3.xfollows (Logstash 8.19).I have signed the Elastic CLA.
This change was developed with the help of Claude Code and reviewed by me.
🤖 Generated with Claude Code