Skip to content

enhancement(sources): add subject_altnames to TLS client metadata - #26113

Open
emillen wants to merge 1 commit into
vectordotdev:masterfrom
emillen:feat/tls-client-metadata-subject-altnames
Open

enhancement(sources): add subject_altnames to TLS client metadata#26113
emillen wants to merge 1 commit into
vectordotdev:masterfrom
emillen:feat/tls-client-metadata-subject-altnames

Conversation

@emillen

@emillen emillen commented Aug 14, 2026

Copy link
Copy Markdown

Summary

tls_client_metadata (emitted by TLS sources when client_metadata_key is set)
currently exposes only the client certificate subject. This PR adds
subject_altnames with the certificate's Subject Alternative Names — the real
entity identity in modern/mTLS PKI — so operators can distinguish, enrich,
route, and audit clients by their SANs.

  • Comma-separated, type-prefixed to match openssl x509 -text
    (e.g. DNS:localhost,IP Address:127.0.0.1).
  • Only present when the cert contains SANs; additive, no config change.
  • Covers all sources supporting client_metadata_key (fluent, logstash, socket,
    statsd, syslog, TCP-mode dnstap) via the shared build_tls_client_metadata.
  • Also fixes logs_output.html so the nested subject/subject_altnames
    options render on the reference docs.

References

Closes: #26111
Related: #11905 (original tls_client_metadata feature)

Vector configuration

Receiver (syslog with mTLS):

sources:
  syslog:
    type: syslog
    mode: tcp
    address: "0.0.0.0:9000"
    tls:
      enabled: true
      verify_certificate: true
      ca_file: "./tls/ca.cert.pem"
      crt_file: "./tls/server.cert.pem"
      key_file: "./tls/server.key.pem"
      client_metadata_key: tls_peer

transforms:
  tls_metadata:
    type: remap
    inputs: [syslog]
    source: |
      .tls_subject = .tls_peer.subject
      .tls_subject_altnames = .tls_peer.subject_altnames
      del(.tls_peer)

sinks:
  console:
    type: console
    inputs: [tls_metadata]
    encoding:
      codec: json

Sender: demo_logssocket sink over TLS with a client cert that has SANs.

How did you test this PR?

  • Manual end-to-end test of the config above (throwaway CA/server/client PKI);
    receiver output included "tls_subject_altnames":"DNS:localhost,IP Address:127.0.0.1".
  • Unit tests for CertificateMetadata::subject_altnames (vector-core) and
    build_tls_client_metadata (key present with SANs, absent without).
  • make fmt, make check-fmt, make check-markdown, make check-generated-docs
    pass; scoped clippy on vector/vector-core clean.
    (Full make check-clippy is blocked by a pre-existing krb5-src C-dependency
    build failure under newer GCC via kafka's gssapi-vendored feature.)

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Changelog fragment added.
  • No. A maintainer will apply the no-changelog label to this PR.

@emillen
emillen requested review from a team as code owners August 14, 2026 13:29
@github-actions github-actions Bot added the docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. label Aug 14, 2026
@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@github-actions github-actions Bot added domain: sources Anything related to the Vector's sources domain: external docs Anything related to Vector's external, public documentation domain: core Anything related to core crates i.e. vector-core, core-common, etc labels Aug 14, 2026
@emillen

emillen commented Aug 14, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@pront pront left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @emillen

@pront
pront enabled auto-merge August 14, 2026 20:54
@pront
pront added this pull request to the merge queue Aug 14, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. domain: core Anything related to core crates i.e. vector-core, core-common, etc domain: external docs Anything related to Vector's external, public documentation domain: sources Anything related to the Vector's sources

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tls_client_metadata should expose Subject Alternative Names (SANs) from the client certificate

2 participants