-
Notifications
You must be signed in to change notification settings - Fork 799
fix(translator): avoid duplicate filter chain for TLS listener without routes #9342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wiegandf
wants to merge
1
commit into
envoyproxy:main
Choose a base branch
from
wiegandf:fix/tls-listener-no-routes-duplicate-filter-chain
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
internal/xds/translator/testdata/in/xds-ir/https-and-tls-listener-no-routes-same-port.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| http: | ||
| - name: "https-listener" | ||
| address: "0.0.0.0" | ||
| port: 10443 | ||
| hostnames: | ||
| - "*" | ||
| path: | ||
| mergeSlashes: true | ||
| escapedSlashesAction: UnescapeAndRedirect | ||
| tls: | ||
| alpnProtocols: | ||
| - h2 | ||
| - http/1.1 | ||
| certificates: | ||
| - name: secret-1 | ||
| certificate: [99, 101, 114, 116, 45, 100, 97, 116, 97] | ||
| privateKey: [107, 101, 121, 45, 100, 97, 116, 97] | ||
| routes: | ||
| - name: "first-route" | ||
| hostname: "*" | ||
| destination: | ||
| name: "first-route-dest" | ||
| settings: | ||
| - endpoints: | ||
| - host: "1.2.3.4" | ||
| port: 50000 | ||
| name: "first-route-dest/backend/0" | ||
| tcp: | ||
| - name: "tls-terminate-no-routes" | ||
| address: "0.0.0.0" | ||
| port: 10443 | ||
| hostnames: | ||
| - "repro.example.com" | ||
| tls: | ||
| certificates: | ||
| - name: secret-1 | ||
| certificate: [99, 101, 114, 116, 45, 100, 97, 116, 97] | ||
| privateKey: [107, 101, 121, 45, 100, 97, 116, 97] |
25 changes: 25 additions & 0 deletions
25
...s/translator/testdata/out/xds-ir/https-and-tls-listener-no-routes-same-port.clusters.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| - circuitBreakers: | ||
| thresholds: | ||
| - maxRetries: 1024 | ||
| commonLbConfig: {} | ||
| connectTimeout: 10s | ||
| dnsLookupFamily: V4_PREFERRED | ||
| edsClusterConfig: | ||
| edsConfig: | ||
| ads: {} | ||
| resourceApiVersion: V3 | ||
| serviceName: first-route-dest | ||
| ignoreHealthOnHostRemoval: true | ||
| loadBalancingPolicy: | ||
| policies: | ||
| - typedExtensionConfig: | ||
| name: envoy.load_balancing_policies.least_request | ||
| typedConfig: | ||
| '@type': type.googleapis.com/envoy.extensions.load_balancing_policies.least_request.v3.LeastRequest | ||
| localityLbConfig: | ||
| localityWeightedLbConfig: {} | ||
| name: first-route-dest | ||
| perConnectionBufferLimitBytes: 32768 | ||
| type: EDS | ||
| - name: EmptyCluster | ||
| type: STATIC |
12 changes: 12 additions & 0 deletions
12
.../translator/testdata/out/xds-ir/https-and-tls-listener-no-routes-same-port.endpoints.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| - clusterName: first-route-dest | ||
| endpoints: | ||
| - lbEndpoints: | ||
| - endpoint: | ||
| address: | ||
| socketAddress: | ||
| address: 1.2.3.4 | ||
| portValue: 50000 | ||
| loadBalancingWeight: 1 | ||
| loadBalancingWeight: 1 | ||
| locality: | ||
| region: first-route-dest/backend/0 |
64 changes: 64 additions & 0 deletions
64
.../translator/testdata/out/xds-ir/https-and-tls-listener-no-routes-same-port.listeners.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| - address: | ||
| socketAddress: | ||
| address: 0.0.0.0 | ||
| portValue: 10443 | ||
| filterChains: | ||
| - filters: | ||
| - name: envoy.filters.network.http_connection_manager | ||
| typedConfig: | ||
| '@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager | ||
| commonHttpProtocolOptions: | ||
| headersWithUnderscoresAction: REJECT_REQUEST | ||
| http2ProtocolOptions: | ||
| initialConnectionWindowSize: 1048576 | ||
| initialStreamWindowSize: 65536 | ||
| maxConcurrentStreams: 100 | ||
| httpFilters: | ||
| - name: envoy.filters.http.router | ||
| typedConfig: | ||
| '@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router | ||
| suppressEnvoyHeaders: true | ||
| mergeSlashes: true | ||
| normalizePath: true | ||
| pathWithEscapedSlashesAction: UNESCAPE_AND_REDIRECT | ||
| rds: | ||
| configSource: | ||
| ads: {} | ||
| resourceApiVersion: V3 | ||
| routeConfigName: https-listener | ||
| serverHeaderTransformation: PASS_THROUGH | ||
| statPrefix: https-10443 | ||
| useRemoteAddress: true | ||
| name: https-listener | ||
| transportSocket: | ||
| name: envoy.transport_sockets.tls | ||
| typedConfig: | ||
| '@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext | ||
| commonTlsContext: | ||
| alpnProtocols: | ||
| - h2 | ||
| - http/1.1 | ||
| tlsCertificateSdsSecretConfigs: | ||
| - name: secret-1 | ||
| sdsConfig: | ||
| ads: {} | ||
| resourceApiVersion: V3 | ||
| disableStatefulSessionResumption: true | ||
| disableStatelessSessionResumption: true | ||
| - filterChainMatch: | ||
| serverNames: | ||
| - repro.example.com | ||
| filters: | ||
| - name: envoy.filters.network.tcp_proxy | ||
| typedConfig: | ||
| '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy | ||
| cluster: EmptyCluster | ||
| statPrefix: tls-passthrough-10443 | ||
| name: EmptyCluster/tls-terminate-no-routes | ||
| listenerFilters: | ||
| - name: envoy.filters.listener.tls_inspector | ||
| typedConfig: | ||
| '@type': type.googleapis.com/envoy.extensions.filters.listener.tls_inspector.v3.TlsInspector | ||
| maxConnectionsToAcceptPerSocketEvent: 1 | ||
| name: https-listener | ||
| perConnectionBufferLimitBytes: 32768 |
14 changes: 14 additions & 0 deletions
14
...xds/translator/testdata/out/xds-ir/https-and-tls-listener-no-routes-same-port.routes.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| - ignorePortInHostMatching: true | ||
| name: https-listener | ||
| virtualHosts: | ||
| - domains: | ||
| - '*' | ||
| name: https-listener/* | ||
| routes: | ||
| - match: | ||
| prefix: / | ||
| name: first-route | ||
| route: | ||
| cluster: first-route-dest | ||
| upgradeConfigs: | ||
| - upgradeType: websocket |
6 changes: 6 additions & 0 deletions
6
...ds/translator/testdata/out/xds-ir/https-and-tls-listener-no-routes-same-port.secrets.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| - name: secret-1 | ||
| tlsCertificate: | ||
| certificateChain: | ||
| inlineBytes: Y2VydC1kYXRh | ||
| privateKey: | ||
| inlineBytes: a2V5LWRhdGE= |
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
1 change: 1 addition & 0 deletions
1
...e-notes/current/bug_fixes/9342-tls-listener-no-routes-duplicate-filter-chain.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Fixed a duplicate filter chain matcher error when a TLS listener with a specific hostname and no routes shares a port with an HTTPS wildcard listener, which caused Envoy to reject the xDS config update. |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a hostname-only, no-route TLS listener is processed before another TLS listener on the same address/port that enables JA3/JA4 fingerprints, this new synthetic SNI route causes
addXdsTCPFilterChainto installtls_inspectorfor SNI only.addXdsTLSInspectorFilterreturns immediately once an inspector exists, so the later listener's fingerprint flags are never enabled and configured%TLS_JA*_FINGERPRINT%values stay empty. Before this branch, a no-route listener without fingerprints did not install the inspector, so the later listener could enable it; please merge/update existing inspector options when adding this placeholder chain.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that the desired behavior? As
tls_inspectoris a listener filter we can't have per filter chain scope? Maybe it's correct as it is to just install the first. @zirain