Skip to content

Enable TLS Fingerprinting configuration (JA3/JA4)#7372

Open
WUMUXIAN wants to merge 4 commits intoprojectcontour:mainfrom
WUMUXIAN:add_ja3_ja4_config_support
Open

Enable TLS Fingerprinting configuration (JA3/JA4)#7372
WUMUXIAN wants to merge 4 commits intoprojectcontour:mainfrom
WUMUXIAN:add_ja3_ja4_config_support

Conversation

@WUMUXIAN
Copy link
Contributor

@WUMUXIAN WUMUXIAN commented Jan 13, 2026

internal/(envoy): Make it possible to enable TLS fingerprinting in Envoy's TLS Inspector Listener filter, useful for security monitoring, analytics, and bot detection. Provides independent control over JA3 and JA4 fingerprinting methods.

enableJA3Fingerprinting: Enable JA3 fingerprinting (requires Envoy 1.21.0+)
enableJA4Fingerprinting: Enable JA4 fingerprinting (requires Envoy 1.35.0+)
Both settings default to false.

Updates #7307
Release note: release-note/minor

Signed-off-by: Muxian Wu wumuxian1988@gmail.com

@WUMUXIAN WUMUXIAN requested a review from a team as a code owner January 13, 2026 14:30
@WUMUXIAN WUMUXIAN requested review from sunjayBhatia and tsaarni and removed request for a team January 13, 2026 14:30
@sunjayBhatia sunjayBhatia requested review from a team, clayton-gonsalves and rajatvig and removed request for a team January 13, 2026 14:30
@github-actions
Copy link

Hi @WUMUXIAN! Welcome to our community and thank you for opening your first Pull Request. Someone will review it soon. Thank you for committing to making Contour better. You can also join us on our mailing list and in our channel in the Kubernetes Slack Workspace

@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 60.00000% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.13%. Comparing base (8a51282) to head (04832c1).
⚠️ Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
cmd/contour/servecontext.go 42.85% 3 Missing and 1 partial ⚠️
pkg/config/parameters.go 0.00% 3 Missing ⚠️
cmd/contour/serve.go 0.00% 2 Missing ⚠️
internal/envoy/v3/listener.go 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7372      +/-   ##
==========================================
- Coverage   81.18%   80.13%   -1.06%     
==========================================
  Files         130      130              
  Lines       15803    15788      -15     
==========================================
- Hits        12829    12651     -178     
- Misses       2613     2624      +11     
- Partials      361      513     +152     
Files with missing lines Coverage Δ
internal/dag/policy.go 80.44% <100.00%> (-15.11%) ⬇️
internal/xdscache/v3/listener.go 76.61% <100.00%> (-0.71%) ⬇️
internal/envoy/v3/listener.go 84.22% <87.50%> (-13.94%) ⬇️
cmd/contour/serve.go 22.23% <0.00%> (+0.18%) ⬆️
pkg/config/parameters.go 66.78% <0.00%> (-12.17%) ⬇️
cmd/contour/servecontext.go 85.67% <42.85%> (+1.79%) ⬆️

... and 17 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@WUMUXIAN
Copy link
Contributor Author

hi @tsaarni , @sunjayBhatia can you review this? thank you

@WUMUXIAN WUMUXIAN force-pushed the add_ja3_ja4_config_support branch from ce51f73 to 8d38ebc Compare January 21, 2026 10:09
@tsaarni tsaarni added the release-note/minor A minor change that needs about a paragraph of explanation in the release notes. label Jan 21, 2026
Signed-off-by: Muxian Wu <muxianw@twitter.com>
Signed-off-by: Muxian Wu <muxianw@twitter.com>
@github-actions
Copy link

The Contour project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 30d of inactivity, lifecycle/stale is applied
  • After 60d of inactivity since lifecycle/stale was applied, the PR is closed

You can:

  • Ensure your PR is passing all CI checks. PRs that are fully green are more likely to be reviewed. If you are having trouble with CI checks, reach out to the #contour channel in the Kubernetes Slack workspace.
  • Mark this PR as fresh by commenting or pushing a commit
  • Close this PR
  • Offer to help out with triage

Please send feedback to the #contour channel in the Kubernetes Slack

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 22, 2026
@tsaarni tsaarni removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 22, 2026
Copy link
Member

@tsaarni tsaarni left a comment

Choose a reason for hiding this comment

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

Hi @WUMUXIAN, Thank You for contribution and sorry for the delay!

Have you considered how these fingerprints will be consumed or observed? I do not see that reflected in this change. Based on what I understood from Envoy documentation, the options include:

  • Logging fingerprints in HTTP access logs (this requires changes in apis/projectcontour/v1alpha1/accesslog.go).
  • Setting dynamic request headers (this requires changes in internal/dag/policy.go). Header could make the fingerprints available to the backend service, and possibly to external authorization server.

We should also add some documentation regarding how to observe these fingerprints.

We need tests to verify this functionality. The simplest approach is to add unit tests in internal/featuretests/.

@WUMUXIAN WUMUXIAN force-pushed the add_ja3_ja4_config_support branch from 76feef1 to 4ccec21 Compare February 24, 2026 14:53
@WUMUXIAN
Copy link
Contributor Author

Hi @WUMUXIAN, Thank You for contribution and sorry for the delay!

Have you considered how these fingerprints will be consumed or observed? I do not see that reflected in this change. Based on what I understood from Envoy documentation, the options include:

  • Logging fingerprints in HTTP access logs (this requires changes in apis/projectcontour/v1alpha1/accesslog.go).
  • Setting dynamic request headers (this requires changes in internal/dag/policy.go). Header could make the fingerprints available to the backend service, and possibly to external authorization server.

We should also add some documentation regarding how to observe these fingerprints.

We need tests to verify this functionality. The simplest approach is to add unit tests in internal/featuretests/.

Thanks for the thorough reviews! @tsaarni, I have updated the PR with all the comments addressed, please review again, ty!

@WUMUXIAN WUMUXIAN force-pushed the add_ja3_ja4_config_support branch from 4ccec21 to 80b5e33 Compare February 24, 2026 15:14
- Group JA3/JA4 config under a 'fingerprint' sub-struct in both the
  ContourConfiguration CRD (EnvoyTLS.Fingerprint) and the YAML config
  file (ProtocolParameters.Fingerprint) for cleaner API design.

- Refactor TLSInspector() to be a no-arg function for backward
  compatibility, and add TLSInspectorWithConfig(enableJA3, enableJA4)
  for the configurable variant.

- Refactor secureProxyProtocol() to accept the full ListenerConfig
  struct instead of individual boolean parameters.

- Add access log support: register TLS_JA3_FINGERPRINT and
  TLS_JA4_FINGERPRINT as Envoy access log operators, add
  tls_ja3_fingerprint/tls_ja4_fingerprint JSON field aliases, and
  fix commandOperatorRegexp to support digits in operator names.

- Add dynamic request header support: allow TLS_JA3_FINGERPRINT and
  TLS_JA4_FINGERPRINT variables in header policy values so fingerprints
  can be forwarded to backend services.

- Add comprehensive tests: unit tests for TLSInspector/WithConfig,
  access log field validation, header policy passthrough, and feature
  tests covering JA3-only, JA4-only, both, and with PROXY protocol.

- Add documentation: access log usage guide, request header variable
  list, and updated changelog.

Signed-off-by: Muxian Wu <muxianw@twitter.com>
@WUMUXIAN WUMUXIAN force-pushed the add_ja3_ja4_config_support branch from 80b5e33 to 099a720 Compare February 24, 2026 15:14
The testExternalAuth e2e test was flaky because it created the auth
server deployment and immediately proceeded to make requests without
waiting for the pod to be ready. In CI, image pulls and pod scheduling
can be slow, causing Envoy's ext_authz filter to return 403 (default
denial code for unreachable auth services) instead of the expected 401
from the auth server, even across the 60-second retry window.

Add a wait for the auth server deployment to have at least one ready
replica before creating the Service, ExtensionService, and HTTPProxy.
This ensures Envoy can reach the ext_authz cluster when the test
starts making requests.

Signed-off-by: Muxian Wu <muxianw@twitter.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/minor A minor change that needs about a paragraph of explanation in the release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants