From 988d4ed0be5a5f9dd39a784d52c3bb5c51ecc2aa Mon Sep 17 00:00:00 2001 From: Lior Okman Date: Tue, 13 Feb 2024 20:47:36 +0200 Subject: [PATCH 1/3] feat: Suppress 'X-Envoy' headers and pass-through the upstream 'Server' header by default (#2585) * Implement and update tests for the default header transformations. Signed-off-by: Lior Okman * Make 'gen-check' happy Signed-off-by: Lior Okman --------- Signed-off-by: Lior Okman --- .../translate/out/default-resources.all.yaml | 4 + .../translate/out/envoy-patch-policy.all.yaml | 2 + .../out/from-gateway-api-to-xds.all.json | 8 +- .../out/from-gateway-api-to-xds.all.yaml | 4 + .../out/from-gateway-api-to-xds.listener.yaml | 4 + ...-single-route-single-match-to-xds.all.json | 4 +- ...-single-route-single-match-to-xds.all.yaml | 2 + ...le-route-single-match-to-xds.listener.yaml | 2 + internal/gatewayapi/clienttrafficpolicy.go | 4 +- .../clienttrafficpolicy-headers.in.yaml | 35 +++++ .../clienttrafficpolicy-headers.out.yaml | 143 ++++++++++++++++++ internal/ir/xds.go | 14 +- internal/ir/zz_generated.deepcopy.go | 20 +++ internal/xds/filters/wellknown.go | 4 +- internal/xds/translator/httpfilters.go | 4 +- internal/xds/translator/listener.go | 2 + .../in/xds-ir/suppress-envoy-headers.yaml | 3 +- ...http-route-extension-filter.listeners.yaml | 2 + .../http-route.listeners.yaml | 2 + .../out/xds-ir/accesslog.listeners.yaml | 2 + .../out/xds-ir/basic-auth.listeners.yaml | 2 + .../out/xds-ir/circuit-breaker.listeners.yaml | 2 + .../xds-ir/client-ip-detection.listeners.yaml | 2 + .../testdata/out/xds-ir/cors.listeners.yaml | 2 + .../out/xds-ir/ext-auth.listeners.yaml | 2 + .../out/xds-ir/fault-injection.listeners.yaml | 2 + .../out/xds-ir/health-check.listeners.yaml | 2 + .../http-route-direct-response.listeners.yaml | 2 + .../http-route-dns-cluster.listeners.yaml | 2 + .../xds-ir/http-route-mirror.listeners.yaml | 2 + ...http-route-multiple-matches.listeners.yaml | 2 + ...http-route-multiple-mirrors.listeners.yaml | 2 + .../http-route-partial-invalid.listeners.yaml | 2 + .../xds-ir/http-route-redirect.listeners.yaml | 2 + .../xds-ir/http-route-regex.listeners.yaml | 2 + .../http-route-request-headers.listeners.yaml | 2 + ...-route-response-add-headers.listeners.yaml | 2 + ...response-add-remove-headers.listeners.yaml | 2 + ...ute-response-remove-headers.listeners.yaml | 2 + ...ewrite-root-path-url-prefix.listeners.yaml | 2 + ...-route-rewrite-url-fullpath.listeners.yaml | 2 + ...http-route-rewrite-url-host.listeners.yaml | 2 + ...tp-route-rewrite-url-prefix.listeners.yaml | 2 + .../xds-ir/http-route-timeout.listeners.yaml | 2 + ...http-route-weighted-backend.listeners.yaml | 2 + ...te-weighted-invalid-backend.listeners.yaml | 2 + ...ute-with-stripped-host-port.listeners.yaml | 2 + .../out/xds-ir/http-route.listeners.yaml | 2 + .../xds-ir/http1-preserve-case.listeners.yaml | 4 + .../out/xds-ir/http1-trailers.listeners.yaml | 2 + .../testdata/out/xds-ir/http10.listeners.yaml | 2 + .../out/xds-ir/http2-route.listeners.yaml | 2 + .../testdata/out/xds-ir/http3.listeners.yaml | 4 + ...npatch-add-op-without-value.listeners.yaml | 2 + ...atch-invalid-patch.envoypatchpolicies.yaml | 4 +- .../jsonpatch-invalid-patch.listeners.yaml | 2 + .../jsonpatch-missing-resource.listeners.yaml | 2 + ...sonpatch-move-op-with-value.listeners.yaml | 2 + .../out/xds-ir/jsonpatch.listeners.yaml | 2 + .../jwt-custom-extractor.listeners.yaml | 2 + ...-multi-route-multi-provider.listeners.yaml | 2 + ...multi-route-single-provider.listeners.yaml | 2 + .../out/xds-ir/jwt-ratelimit.listeners.yaml | 2 + ...t-single-route-single-match.listeners.yaml | 2 + .../listener-proxy-protocol.listeners.yaml | 2 + .../listener-tcp-keepalive.listeners.yaml | 4 + .../out/xds-ir/load-balancer.listeners.yaml | 2 + .../out/xds-ir/local-ratelimit.listeners.yaml | 2 + .../metrics-virtual-host.listeners.yaml | 2 + .../xds-ir/mixed-tls-jwt-authn.listeners.yaml | 2 + ...ultiple-listeners-same-port.listeners.yaml | 6 + .../testdata/out/xds-ir/oidc.listeners.yaml | 2 + .../out/xds-ir/path-settings.listeners.yaml | 2 + .../proxy-protocol-upstream.listeners.yaml | 2 + .../ratelimit-custom-domain.listeners.yaml | 2 + .../xds-ir/ratelimit-sourceip.listeners.yaml | 2 + .../out/xds-ir/ratelimit.listeners.yaml | 2 + .../out/xds-ir/simple-tls.listeners.yaml | 2 + .../suppress-envoy-headers.listeners.yaml | 2 +- .../out/xds-ir/timeout.listeners.yaml | 2 + ...-with-ciphers-versions-alpn.listeners.yaml | 2 + .../out/xds-ir/tracing.listeners.yaml | 2 + 82 files changed, 387 insertions(+), 14 deletions(-) create mode 100644 internal/gatewayapi/testdata/clienttrafficpolicy-headers.in.yaml create mode 100644 internal/gatewayapi/testdata/clienttrafficpolicy-headers.out.yaml diff --git a/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml b/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml index 15f05cad63e..92a71a6ac1c 100644 --- a/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml @@ -803,6 +803,7 @@ xds: - 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 @@ -811,6 +812,7 @@ xds: ads: {} resourceApiVersion: V3 routeConfigName: default/eg/http + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket @@ -869,6 +871,7 @@ xds: - 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 @@ -877,6 +880,7 @@ xds: ads: {} resourceApiVersion: V3 routeConfigName: default/eg/grpc + serverHeaderTransformation: PASS_THROUGH statPrefix: http useRemoteAddress: true name: default/eg/grpc diff --git a/internal/cmd/egctl/testdata/translate/out/envoy-patch-policy.all.yaml b/internal/cmd/egctl/testdata/translate/out/envoy-patch-policy.all.yaml index a5b62f51252..c31c5d146f3 100644 --- a/internal/cmd/egctl/testdata/translate/out/envoy-patch-policy.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/envoy-patch-policy.all.yaml @@ -199,6 +199,7 @@ xds: - 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 @@ -207,6 +208,7 @@ xds: ads: {} resourceApiVersion: V3 routeConfigName: default/eg/http + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.json b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.json index 6f113a1cf7f..bd7a401d957 100644 --- a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.json +++ b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.json @@ -553,7 +553,8 @@ { "name": "envoy.filters.http.router", "typedConfig": { - "@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router" + "@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router", + "suppressEnvoyHeaders": true } } ], @@ -567,6 +568,7 @@ }, "routeConfigName": "default/eg/http" }, + "serverHeaderTransformation": "PASS_THROUGH", "statPrefix": "http", "upgradeConfigs": [ { @@ -660,7 +662,8 @@ { "name": "envoy.filters.http.router", "typedConfig": { - "@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router" + "@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router", + "suppressEnvoyHeaders": true } } ], @@ -674,6 +677,7 @@ }, "routeConfigName": "default/eg/grpc" }, + "serverHeaderTransformation": "PASS_THROUGH", "statPrefix": "http", "useRemoteAddress": true } diff --git a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.yaml b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.yaml index 793a79f46d2..ed5c71ea602 100644 --- a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.yaml @@ -329,6 +329,7 @@ xds: - 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 @@ -337,6 +338,7 @@ xds: ads: {} resourceApiVersion: V3 routeConfigName: default/eg/http + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket @@ -395,6 +397,7 @@ xds: - 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 @@ -403,6 +406,7 @@ xds: ads: {} resourceApiVersion: V3 routeConfigName: default/eg/grpc + serverHeaderTransformation: PASS_THROUGH statPrefix: http useRemoteAddress: true name: default/eg/grpc diff --git a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.listener.yaml b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.listener.yaml index ae7fce949cf..bc904a54906 100644 --- a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.listener.yaml +++ b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.listener.yaml @@ -46,6 +46,7 @@ xds: - 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 @@ -54,6 +55,7 @@ xds: ads: {} resourceApiVersion: V3 routeConfigName: default/eg/http + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket @@ -112,6 +114,7 @@ xds: - 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 @@ -120,6 +123,7 @@ xds: ads: {} resourceApiVersion: V3 routeConfigName: default/eg/grpc + serverHeaderTransformation: PASS_THROUGH statPrefix: http useRemoteAddress: true name: default/eg/grpc diff --git a/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.json b/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.json index 934868dabe8..c776a2f53b3 100644 --- a/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.json +++ b/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.json @@ -430,7 +430,8 @@ { "name": "envoy.filters.http.router", "typedConfig": { - "@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router" + "@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router", + "suppressEnvoyHeaders": true } } ], @@ -444,6 +445,7 @@ }, "routeConfigName": "envoy-gateway-system/eg/http" }, + "serverHeaderTransformation": "PASS_THROUGH", "statPrefix": "http", "upgradeConfigs": [ { diff --git a/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.yaml b/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.yaml index 8a9c2e2a6df..94acbe31904 100644 --- a/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.yaml @@ -256,6 +256,7 @@ xds: - 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 @@ -264,6 +265,7 @@ xds: ads: {} resourceApiVersion: V3 routeConfigName: envoy-gateway-system/eg/http + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.listener.yaml b/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.listener.yaml index c841f671422..acc9e8afdee 100644 --- a/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.listener.yaml +++ b/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.listener.yaml @@ -63,6 +63,7 @@ xds: - 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 @@ -71,6 +72,7 @@ xds: ads: {} resourceApiVersion: V3 routeConfigName: envoy-gateway-system/eg/http + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/gatewayapi/clienttrafficpolicy.go b/internal/gatewayapi/clienttrafficpolicy.go index 9e35cb00cc6..db88d9dec6b 100644 --- a/internal/gatewayapi/clienttrafficpolicy.go +++ b/internal/gatewayapi/clienttrafficpolicy.go @@ -415,7 +415,9 @@ func translateListenerHeaderSettings(headerSettings *egv1a1.HeaderSettings, http if headerSettings == nil { return } - httpIR.SuppressEnvoyHeaders = true + httpIR.Headers = &ir.HeaderSettings{ + EnableEnvoyHeaders: ptr.Deref(headerSettings.EnableEnvoyHeaders, false), + } } func translateHTTP1Settings(http1Settings *egv1a1.HTTP1Settings, httpIR *ir.HTTPListener) error { diff --git a/internal/gatewayapi/testdata/clienttrafficpolicy-headers.in.yaml b/internal/gatewayapi/testdata/clienttrafficpolicy-headers.in.yaml new file mode 100644 index 00000000000..82a60c2c033 --- /dev/null +++ b/internal/gatewayapi/testdata/clienttrafficpolicy-headers.in.yaml @@ -0,0 +1,35 @@ +clientTrafficPolicies: +- apiVersion: gateway.envoyproxy.io/v1alpha1 + kind: ClientTrafficPolicy + metadata: + namespace: envoy-gateway + name: target-gateway-1 + spec: + headers: + enableEnvoyHeaders: true + targetRef: + group: gateway.networking.k8s.io + kind: Gateway + name: gateway-1 + namespace: envoy-gateway +gateways: +- apiVersion: gateway.networking.k8s.io/v1 + kind: Gateway + metadata: + namespace: envoy-gateway + name: gateway-1 + spec: + gatewayClassName: envoy-gateway-class + listeners: + - name: http-1 + protocol: HTTP + port: 80 + allowedRoutes: + namespaces: + from: Same + - name: http-2 + protocol: HTTP + port: 8080 + allowedRoutes: + namespaces: + from: Same diff --git a/internal/gatewayapi/testdata/clienttrafficpolicy-headers.out.yaml b/internal/gatewayapi/testdata/clienttrafficpolicy-headers.out.yaml new file mode 100644 index 00000000000..debec3ba699 --- /dev/null +++ b/internal/gatewayapi/testdata/clienttrafficpolicy-headers.out.yaml @@ -0,0 +1,143 @@ +clientTrafficPolicies: +- apiVersion: gateway.envoyproxy.io/v1alpha1 + kind: ClientTrafficPolicy + metadata: + creationTimestamp: null + name: target-gateway-1 + namespace: envoy-gateway + spec: + headers: + enableEnvoyHeaders: true + targetRef: + group: gateway.networking.k8s.io + kind: Gateway + name: gateway-1 + namespace: envoy-gateway + status: + conditions: + - lastTransitionTime: null + message: ClientTrafficPolicy has been accepted. + reason: Accepted + status: "True" + type: Accepted +gateways: +- apiVersion: gateway.networking.k8s.io/v1 + kind: Gateway + metadata: + creationTimestamp: null + name: gateway-1 + namespace: envoy-gateway + spec: + gatewayClassName: envoy-gateway-class + listeners: + - allowedRoutes: + namespaces: + from: Same + name: http-1 + port: 80 + protocol: HTTP + - allowedRoutes: + namespaces: + from: Same + name: http-2 + port: 8080 + protocol: HTTP + status: + listeners: + - attachedRoutes: 0 + conditions: + - lastTransitionTime: null + message: Sending translated listener configuration to the data plane + reason: Programmed + status: "True" + type: Programmed + - lastTransitionTime: null + message: Listener has been successfully translated + reason: Accepted + status: "True" + type: Accepted + - lastTransitionTime: null + message: Listener references have been resolved + reason: ResolvedRefs + status: "True" + type: ResolvedRefs + name: http-1 + supportedKinds: + - group: gateway.networking.k8s.io + kind: HTTPRoute + - group: gateway.networking.k8s.io + kind: GRPCRoute + - attachedRoutes: 0 + conditions: + - lastTransitionTime: null + message: Sending translated listener configuration to the data plane + reason: Programmed + status: "True" + type: Programmed + - lastTransitionTime: null + message: Listener has been successfully translated + reason: Accepted + status: "True" + type: Accepted + - lastTransitionTime: null + message: Listener references have been resolved + reason: ResolvedRefs + status: "True" + type: ResolvedRefs + name: http-2 + supportedKinds: + - group: gateway.networking.k8s.io + kind: HTTPRoute + - group: gateway.networking.k8s.io + kind: GRPCRoute +infraIR: + envoy-gateway/gateway-1: + proxy: + listeners: + - address: null + name: envoy-gateway/gateway-1/http-1 + ports: + - containerPort: 10080 + name: http-1 + protocol: HTTP + servicePort: 80 + - address: null + name: envoy-gateway/gateway-1/http-2 + ports: + - containerPort: 8080 + name: http-2 + protocol: HTTP + servicePort: 8080 + metadata: + labels: + gateway.envoyproxy.io/owning-gateway-name: gateway-1 + gateway.envoyproxy.io/owning-gateway-namespace: envoy-gateway + name: envoy-gateway/gateway-1 +xdsIR: + envoy-gateway/gateway-1: + accessLog: + text: + - path: /dev/stdout + http: + - address: 0.0.0.0 + headers: + enableEnvoyHeaders: true + hostnames: + - '*' + isHTTP2: false + name: envoy-gateway/gateway-1/http-1 + path: + escapedSlashesAction: UnescapeAndRedirect + mergeSlashes: true + port: 10080 + - address: 0.0.0.0 + headers: + enableEnvoyHeaders: true + hostnames: + - '*' + isHTTP2: false + name: envoy-gateway/gateway-1/http-2 + path: + escapedSlashesAction: UnescapeAndRedirect + mergeSlashes: true + port: 8080 diff --git a/internal/ir/xds.go b/internal/ir/xds.go index 1d1f3efa5ab..89e9ad5a602 100644 --- a/internal/ir/xds.go +++ b/internal/ir/xds.go @@ -211,9 +211,8 @@ type HTTPListener struct { IsHTTP2 bool `json:"isHTTP2" yaml:"isHTTP2"` // TCPKeepalive configuration for the listener TCPKeepalive *TCPKeepalive `json:"tcpKeepalive,omitempty" yaml:"tcpKeepalive,omitempty"` - // SuppressEnvoyHeaders controls if "x-envoy-" headers are suppressed by the HTTP Router filter - // Refer to https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/http/router/v3/router.proto#extensions-filters-http-router-v3-router - SuppressEnvoyHeaders bool `json:"suppressEnvoyHeaders,omitempty" yaml:"suppressEnvoyHeaders,omitempty"` + // Headers configures special header management for the listener + Headers *HeaderSettings `json:"headers,omitempty" yaml:"headers,omitempty"` // EnableProxyProtocol enables the listener to interpret proxy protocol header EnableProxyProtocol bool `json:"enableProxyProtocol,omitempty" yaml:"enableProxyProtocol,omitempty"` // ClientIPDetection controls how the original client IP address is determined for requests. @@ -370,6 +369,15 @@ type HTTP10Settings struct { DefaultHost *string `json:"defaultHost,omitempty" yaml:"defaultHost,omitempty"` } +// HeaderSettings provides configuration related to header processing on the listener. +// +k8s:deepcopy-gen=true +type HeaderSettings struct { + // EnableEnvoyHeaders controls if "x-envoy-" headers are added by the HTTP Router filter. + // The default is to suppress these headers. + // Refer to https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/http/router/v3/router.proto#extensions-filters-http-router-v3-router + EnableEnvoyHeaders bool `json:"enableEnvoyHeaders,omitempty" yaml:"enableEnvoyHeaders,omitempty"` +} + // HTTPRoute holds the route information associated with the HTTP Route // +k8s:deepcopy-gen=true type HTTPRoute struct { diff --git a/internal/ir/zz_generated.deepcopy.go b/internal/ir/zz_generated.deepcopy.go index a60b841001f..a0bb675b814 100644 --- a/internal/ir/zz_generated.deepcopy.go +++ b/internal/ir/zz_generated.deepcopy.go @@ -654,6 +654,11 @@ func (in *HTTPListener) DeepCopyInto(out *HTTPListener) { *out = new(TCPKeepalive) (*in).DeepCopyInto(*out) } + if in.Headers != nil { + in, out := &in.Headers, &out.Headers + *out = new(HeaderSettings) + **out = **in + } if in.ClientIPDetection != nil { in, out := &in.ClientIPDetection, &out.ClientIPDetection *out = new(ClientIPDetectionSettings) @@ -907,6 +912,21 @@ func (in *HTTPTimeout) DeepCopy() *HTTPTimeout { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HeaderSettings) DeepCopyInto(out *HeaderSettings) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HeaderSettings. +func (in *HeaderSettings) DeepCopy() *HeaderSettings { + if in == nil { + return nil + } + out := new(HeaderSettings) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HealthCheck) DeepCopyInto(out *HealthCheck) { *out = *in diff --git a/internal/xds/filters/wellknown.go b/internal/xds/filters/wellknown.go index 3ac7861edab..e6f01090781 100644 --- a/internal/xds/filters/wellknown.go +++ b/internal/xds/filters/wellknown.go @@ -36,12 +36,12 @@ var ( } ) -func GenerateRouterFilter(suppressEnvoyHeaders bool) *hcm.HttpFilter { +func GenerateRouterFilter(enableEnvoyHeaders bool) *hcm.HttpFilter { return &hcm.HttpFilter{ Name: wellknown.Router, ConfigType: &hcm.HttpFilter_TypedConfig{ TypedConfig: protocov.ToAny(&httprouter.Router{ - SuppressEnvoyHeaders: suppressEnvoyHeaders, + SuppressEnvoyHeaders: !enableEnvoyHeaders, }), }, } diff --git a/internal/xds/translator/httpfilters.go b/internal/xds/translator/httpfilters.go index d2100f70b51..ac9df2dae30 100644 --- a/internal/xds/translator/httpfilters.go +++ b/internal/xds/translator/httpfilters.go @@ -12,6 +12,7 @@ import ( routev3 "github.com/envoyproxy/go-control-plane/envoy/config/route/v3" hcmv3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3" "github.com/envoyproxy/go-control-plane/pkg/wellknown" + "k8s.io/utils/ptr" "github.com/envoyproxy/gateway/internal/xds/filters" "github.com/envoyproxy/gateway/internal/xds/types" @@ -170,7 +171,8 @@ func (t *Translator) patchHCMWithFilters( t.patchHCMWithRateLimit(mgr, irListener) // Add the router filter - mgr.HttpFilters = append(mgr.HttpFilters, filters.GenerateRouterFilter(irListener.SuppressEnvoyHeaders)) + headerSettings := ptr.Deref(irListener.Headers, ir.HeaderSettings{}) + mgr.HttpFilters = append(mgr.HttpFilters, filters.GenerateRouterFilter(headerSettings.EnableEnvoyHeaders)) // Sort the filters in the correct order. mgr.HttpFilters = sortHTTPFilters(mgr.HttpFilters) diff --git a/internal/xds/translator/listener.go b/internal/xds/translator/listener.go index 665f2e2e7b3..a558e935595 100644 --- a/internal/xds/translator/listener.go +++ b/internal/xds/translator/listener.go @@ -170,6 +170,8 @@ func (t *Translator) addXdsHTTPFilterChain(xdsListener *listenerv3.Listener, irL }, }, HttpProtocolOptions: http1ProtocolOptions(irListener.HTTP1), + // Hide the Envoy proxy in the Server header by default + ServerHeaderTransformation: hcmv3.HttpConnectionManager_PASS_THROUGH, // Add HTTP2 protocol options // Set it by default to also support HTTP1.1 to HTTP2 Upgrades Http2ProtocolOptions: http2ProtocolOptions(), diff --git a/internal/xds/translator/testdata/in/xds-ir/suppress-envoy-headers.yaml b/internal/xds/translator/testdata/in/xds-ir/suppress-envoy-headers.yaml index 9eaf2996e88..f26d13b084e 100644 --- a/internal/xds/translator/testdata/in/xds-ir/suppress-envoy-headers.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/suppress-envoy-headers.yaml @@ -20,7 +20,8 @@ http: - name: secret-2 serverCertificate: [99, 101, 114, 116, 45, 100, 97, 116, 97] privateKey: [107, 101, 121, 45, 100, 97, 116, 97] - suppressEnvoyHeaders: true + headers: + enableEnvoyHeaders: true routes: - name: "first-route" hostname: "*" diff --git a/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.listeners.yaml b/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.listeners.yaml index 00b88ec33bb..c5835215d89 100644 --- a/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.listeners.yaml +++ b/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: extension-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/extension-xds-ir/http-route.listeners.yaml b/internal/xds/translator/testdata/out/extension-xds-ir/http-route.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/extension-xds-ir/http-route.listeners.yaml +++ b/internal/xds/translator/testdata/out/extension-xds-ir/http-route.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/accesslog.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/accesslog.listeners.yaml index 8b64c852a8f..a3bf0b5bc88 100644 --- a/internal/xds/translator/testdata/out/xds-ir/accesslog.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/accesslog.listeners.yaml @@ -127,6 +127,7 @@ - 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 @@ -135,6 +136,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/basic-auth.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/basic-auth.listeners.yaml index ab0592b760b..ca39c5cd5a7 100644 --- a/internal/xds/translator/testdata/out/xds-ir/basic-auth.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/basic-auth.listeners.yaml @@ -22,6 +22,7 @@ - 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 @@ -30,6 +31,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/circuit-breaker.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/circuit-breaker.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/circuit-breaker.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/circuit-breaker.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/client-ip-detection.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/client-ip-detection.listeners.yaml index 19c18f54b11..1b04678800a 100755 --- a/internal/xds/translator/testdata/out/xds-ir/client-ip-detection.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/client-ip-detection.listeners.yaml @@ -17,12 +17,14 @@ - name: envoy.filters.http.router typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router + suppressEnvoyHeaders: true normalizePath: true rds: configSource: ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/cors.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/cors.listeners.yaml index c48a6d76424..b9858e6777a 100644 --- a/internal/xds/translator/testdata/out/xds-ir/cors.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/cors.listeners.yaml @@ -20,6 +20,7 @@ - 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 @@ -28,6 +29,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/ext-auth.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/ext-auth.listeners.yaml index 8eeef0c36a9..0e516bddb0d 100755 --- a/internal/xds/translator/testdata/out/xds-ir/ext-auth.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ext-auth.listeners.yaml @@ -42,6 +42,7 @@ - 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 @@ -50,6 +51,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/fault-injection.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/fault-injection.listeners.yaml index d396bfb96b0..7586adc78b0 100755 --- a/internal/xds/translator/testdata/out/xds-ir/fault-injection.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/fault-injection.listeners.yaml @@ -20,6 +20,7 @@ - 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 @@ -28,6 +29,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/health-check.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/health-check.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/health-check.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/health-check.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-dns-cluster.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-dns-cluster.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-dns-cluster.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-dns-cluster.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-mirrors.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-mirrors.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-mirrors.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-mirrors.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-partial-invalid.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-partial-invalid.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-partial-invalid.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-partial-invalid.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-regex.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-regex.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-regex.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-regex.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-fullpath.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-fullpath.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-fullpath.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-fullpath.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-with-stripped-host-port.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-with-stripped-host-port.listeners.yaml index 1ddd025c99e..1eae91bee81 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-with-stripped-host-port.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-with-stripped-host-port.listeners.yaml @@ -13,6 +13,7 @@ - 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 @@ -21,6 +22,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http1-preserve-case.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http1-preserve-case.listeners.yaml index 8827d4b75fa..51679103175 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http1-preserve-case.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http1-preserve-case.listeners.yaml @@ -17,6 +17,7 @@ - name: envoy.filters.http.router typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router + suppressEnvoyHeaders: true httpProtocolOptions: headerKeyFormat: statefulFormatter: @@ -31,6 +32,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket @@ -56,6 +58,7 @@ - name: envoy.filters.http.router typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router + suppressEnvoyHeaders: true httpProtocolOptions: enableTrailers: true headerKeyFormat: @@ -71,6 +74,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: second-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http1-trailers.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http1-trailers.listeners.yaml index de340721dfb..59592df658a 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http1-trailers.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http1-trailers.listeners.yaml @@ -17,6 +17,7 @@ - name: envoy.filters.http.router typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router + suppressEnvoyHeaders: true httpProtocolOptions: enableTrailers: true mergeSlashes: true @@ -27,6 +28,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http10.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http10.listeners.yaml index 890a2c5437c..cb4e1c75776 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http10.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http10.listeners.yaml @@ -17,6 +17,7 @@ - name: envoy.filters.http.router typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router + suppressEnvoyHeaders: true httpProtocolOptions: acceptHttp10: true defaultHostForHttp10: foo.com @@ -28,6 +29,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/http2-route.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http2-route.listeners.yaml index 52a0307d76a..299ae39cd94 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http2-route.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http2-route.listeners.yaml @@ -25,6 +25,7 @@ - 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 @@ -33,6 +34,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http useRemoteAddress: true name: first-listener diff --git a/internal/xds/translator/testdata/out/xds-ir/http3.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http3.listeners.yaml index d345cc14e96..d3db1540bc4 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http3.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http3.listeners.yaml @@ -20,6 +20,7 @@ - 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 @@ -28,6 +29,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: envoy-gateway/gateway-1/tls + serverHeaderTransformation: PASS_THROUGH statPrefix: https upgradeConfigs: - upgradeType: websocket @@ -69,6 +71,7 @@ - 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 @@ -77,6 +80,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: envoy-gateway/gateway-1/tls + serverHeaderTransformation: PASS_THROUGH statPrefix: https upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-add-op-without-value.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-add-op-without-value.listeners.yaml index f7bc0d01fc5..d0e88f02b41 100644 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-add-op-without-value.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-add-op-without-value.listeners.yaml @@ -28,6 +28,7 @@ - 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 @@ -36,6 +37,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: https upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.envoypatchpolicies.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.envoypatchpolicies.yaml index 9ff692421b9..8d9f6918bd1 100644 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.envoypatchpolicies.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.envoypatchpolicies.yaml @@ -3,8 +3,8 @@ status: conditions: - lastTransitionTime: null - message: 'unable to unmarshal xds resource {"name":"first-listener","address":{"socket_address":{"address":"0.0.0.0","port_value":10080}},"default_filter_chain":{"filters":[{"name":"envoy.filters.network.http_connection_manager","typed_config":{"@type":"type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager","stat_prefix":"http","rds":{"config_source":{"ads":{},"resource_api_version":"V3"},"route_config_name":"first-listener"},"http_filters":[{"name":"envoy.filters.http.router","typed_config":{"@type":"type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"}}],"common_http_protocol_options":{"headers_with_underscores_action":"REJECT_REQUEST"},"http2_protocol_options":{"max_concurrent_streams":100,"initial_stream_window_size":65536,"initial_connection_window_size":1048576},"use_remote_address":true,"upgrade_configs":[{"upgrade_type":"websocket"}],"normalize_path":true,"merge_slashes":true,"path_with_escaped_slashes_action":"UNESCAPE_AND_REDIRECT"}}]},"per_connection_buffer_limit_bytes":32768,"this":{"path":{"never":{"existed":{"name":"envoy.filters.http.ratelimit","typed_config":{"@type":"type.googleapis.com/envoy.extensions.filters.http.ratelimit.v3.RateLimit","domain":"eg-ratelimit","failure_mode_deny":true,"rate_limit_service":{"grpc_service":{"envoy_grpc":{"cluster_name":"rate-limit-cluster"}},"transport_api_version":"V3"},"timeout":"1s"}}}}}}, - err:proto: (line 1:1023): unknown field "this"' + message: 'unable to unmarshal xds resource {"name":"first-listener","address":{"socket_address":{"address":"0.0.0.0","port_value":10080}},"default_filter_chain":{"filters":[{"name":"envoy.filters.network.http_connection_manager","typed_config":{"@type":"type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager","stat_prefix":"http","rds":{"config_source":{"ads":{},"resource_api_version":"V3"},"route_config_name":"first-listener"},"http_filters":[{"name":"envoy.filters.http.router","typed_config":{"@type":"type.googleapis.com/envoy.extensions.filters.http.router.v3.Router","suppress_envoy_headers":true}}],"common_http_protocol_options":{"headers_with_underscores_action":"REJECT_REQUEST"},"http2_protocol_options":{"max_concurrent_streams":100,"initial_stream_window_size":65536,"initial_connection_window_size":1048576},"server_header_transformation":"PASS_THROUGH","use_remote_address":true,"upgrade_configs":[{"upgrade_type":"websocket"}],"normalize_path":true,"merge_slashes":true,"path_with_escaped_slashes_action":"UNESCAPE_AND_REDIRECT"}}]},"per_connection_buffer_limit_bytes":32768,"this":{"path":{"never":{"existed":{"name":"envoy.filters.http.ratelimit","typed_config":{"@type":"type.googleapis.com/envoy.extensions.filters.http.ratelimit.v3.RateLimit","domain":"eg-ratelimit","failure_mode_deny":true,"rate_limit_service":{"grpc_service":{"envoy_grpc":{"cluster_name":"rate-limit-cluster"}},"transport_api_version":"V3"},"timeout":"1s"}}}}}}, + err:proto: (line 1:1099): unknown field "this"' reason: Invalid status: "False" type: Programmed diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-move-op-with-value.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-move-op-with-value.listeners.yaml index f7bc0d01fc5..d0e88f02b41 100644 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-move-op-with-value.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-move-op-with-value.listeners.yaml @@ -28,6 +28,7 @@ - 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 @@ -36,6 +37,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: https upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch.listeners.yaml index f7bc0d01fc5..d0e88f02b41 100644 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch.listeners.yaml @@ -28,6 +28,7 @@ - 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 @@ -36,6 +37,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: https upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/jwt-custom-extractor.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/jwt-custom-extractor.listeners.yaml index 4821c111463..b8a88fd7937 100644 --- a/internal/xds/translator/testdata/out/xds-ir/jwt-custom-extractor.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jwt-custom-extractor.listeners.yaml @@ -45,6 +45,7 @@ - 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 @@ -53,6 +54,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/jwt-multi-route-multi-provider.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/jwt-multi-route-multi-provider.listeners.yaml index 02225f01410..df761c63a07 100644 --- a/internal/xds/translator/testdata/out/xds-ir/jwt-multi-route-multi-provider.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jwt-multi-route-multi-provider.listeners.yaml @@ -101,6 +101,7 @@ - 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 @@ -109,6 +110,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/jwt-multi-route-single-provider.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/jwt-multi-route-single-provider.listeners.yaml index f1ecd3d2cc7..e16c2673208 100644 --- a/internal/xds/translator/testdata/out/xds-ir/jwt-multi-route-single-provider.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jwt-multi-route-single-provider.listeners.yaml @@ -79,6 +79,7 @@ - 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 @@ -87,6 +88,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/jwt-ratelimit.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/jwt-ratelimit.listeners.yaml index 61dbfd641a6..72c2f332e63 100644 --- a/internal/xds/translator/testdata/out/xds-ir/jwt-ratelimit.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jwt-ratelimit.listeners.yaml @@ -48,6 +48,7 @@ - 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 @@ -56,6 +57,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/jwt-single-route-single-match.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/jwt-single-route-single-match.listeners.yaml index 2f307e89115..945509a0522 100644 --- a/internal/xds/translator/testdata/out/xds-ir/jwt-single-route-single-match.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jwt-single-route-single-match.listeners.yaml @@ -38,6 +38,7 @@ - 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 @@ -46,6 +47,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/listener-proxy-protocol.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/listener-proxy-protocol.listeners.yaml index 5d4a7fbce0f..4df723a0307 100644 --- a/internal/xds/translator/testdata/out/xds-ir/listener-proxy-protocol.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/listener-proxy-protocol.listeners.yaml @@ -20,6 +20,7 @@ - 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 @@ -28,6 +29,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: https upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/listener-tcp-keepalive.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/listener-tcp-keepalive.listeners.yaml index 09334586970..203f36be5a5 100644 --- a/internal/xds/translator/testdata/out/xds-ir/listener-tcp-keepalive.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/listener-tcp-keepalive.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket @@ -55,6 +57,7 @@ - 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 @@ -63,6 +66,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: second-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/load-balancer.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/load-balancer.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/load-balancer.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/load-balancer.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/local-ratelimit.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/local-ratelimit.listeners.yaml index d9d4a248f2d..3841aa65768 100644 --- a/internal/xds/translator/testdata/out/xds-ir/local-ratelimit.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/local-ratelimit.listeners.yaml @@ -21,6 +21,7 @@ - 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 @@ -29,6 +30,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/metrics-virtual-host.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/metrics-virtual-host.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/metrics-virtual-host.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/metrics-virtual-host.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/mixed-tls-jwt-authn.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/mixed-tls-jwt-authn.listeners.yaml index 096b2e7add4..85bb8b4ac73 100644 --- a/internal/xds/translator/testdata/out/xds-ir/mixed-tls-jwt-authn.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/mixed-tls-jwt-authn.listeners.yaml @@ -37,6 +37,7 @@ - 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 @@ -45,6 +46,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: https upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.listeners.yaml index 632271fe590..102fe74e070 100644 --- a/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: third-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket @@ -47,6 +49,7 @@ - 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 @@ -55,6 +58,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: https upgradeConfigs: - upgradeType: websocket @@ -89,6 +93,7 @@ - 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 @@ -97,6 +102,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: second-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: https upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/oidc.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/oidc.listeners.yaml index aec460ab569..1ad1450a466 100644 --- a/internal/xds/translator/testdata/out/xds-ir/oidc.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/oidc.listeners.yaml @@ -85,6 +85,7 @@ - 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 @@ -93,6 +94,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/path-settings.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/path-settings.listeners.yaml index c2a3253485a..88def256e95 100644 --- a/internal/xds/translator/testdata/out/xds-ir/path-settings.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/path-settings.listeners.yaml @@ -17,6 +17,7 @@ - name: envoy.filters.http.router typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router + suppressEnvoyHeaders: true normalizePath: true pathWithEscapedSlashesAction: UNESCAPE_AND_FORWARD rds: @@ -24,6 +25,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/proxy-protocol-upstream.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/proxy-protocol-upstream.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/proxy-protocol-upstream.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/proxy-protocol-upstream.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.listeners.yaml index 664151e574d..be0d4a05bfd 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.listeners.yaml @@ -27,6 +27,7 @@ - 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 @@ -35,6 +36,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.listeners.yaml index 664151e574d..be0d4a05bfd 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.listeners.yaml @@ -27,6 +27,7 @@ - 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 @@ -35,6 +36,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit.listeners.yaml index 664151e574d..be0d4a05bfd 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit.listeners.yaml @@ -27,6 +27,7 @@ - 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 @@ -35,6 +36,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/simple-tls.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/simple-tls.listeners.yaml index bfefb01d958..3fd6384f903 100644 --- a/internal/xds/translator/testdata/out/xds-ir/simple-tls.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/simple-tls.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: https upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/suppress-envoy-headers.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/suppress-envoy-headers.listeners.yaml index d6373f2d41b..9c68dc1ab54 100644 --- a/internal/xds/translator/testdata/out/xds-ir/suppress-envoy-headers.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/suppress-envoy-headers.listeners.yaml @@ -20,7 +20,6 @@ - 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 @@ -29,6 +28,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: https upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/timeout.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/timeout.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/timeout.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/timeout.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/tls-with-ciphers-versions-alpn.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/tls-with-ciphers-versions-alpn.listeners.yaml index 9262e69ff1c..a404ab4d9f6 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tls-with-ciphers-versions-alpn.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tls-with-ciphers-versions-alpn.listeners.yaml @@ -20,6 +20,7 @@ - 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 @@ -28,6 +29,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: https upgradeConfigs: - upgradeType: websocket diff --git a/internal/xds/translator/testdata/out/xds-ir/tracing.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/tracing.listeners.yaml index ab0c03da06a..e27bb6fec3a 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tracing.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tracing.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http tracing: clientSampling: From 446997b80deff70bff9fea8e9b626115b5299062 Mon Sep 17 00:00:00 2001 From: Arko Dasgupta Date: Tue, 13 Feb 2024 15:49:37 -0800 Subject: [PATCH 2/3] bug: fix merge race (#2604) Between https://github.com/envoyproxy/gateway/pull/2585 & https://github.com/envoyproxy/gateway/pull/2581 Signed-off-by: Arko Dasgupta --- .../testdata/out/xds-ir/upstream-tcpkeepalive.listeners.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/xds/translator/testdata/out/xds-ir/upstream-tcpkeepalive.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/upstream-tcpkeepalive.listeners.yaml index 73ee1b42ef6..046589e0fd8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/upstream-tcpkeepalive.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/upstream-tcpkeepalive.listeners.yaml @@ -17,6 +17,7 @@ - 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 @@ -25,6 +26,7 @@ ads: {} resourceApiVersion: V3 routeConfigName: first-listener + serverHeaderTransformation: PASS_THROUGH statPrefix: http upgradeConfigs: - upgradeType: websocket From 765903a6e10f60e5c7163ccbb49eb05d562d0151 Mon Sep 17 00:00:00 2001 From: Arko Dasgupta Date: Tue, 13 Feb 2024 17:46:49 -0800 Subject: [PATCH 3/3] feat: downstream mTLS (#2490) * feat: downstream mTLS Relates to https://github.com/envoyproxy/gateway/pull/2483 Signed-off-by: Arko Dasgupta * configmap provider logic Signed-off-by: Arko Dasgupta * gatewayapi translation Signed-off-by: Arko Dasgupta * fix charts Signed-off-by: Arko Dasgupta * tests Signed-off-by: Arko Dasgupta * lint Signed-off-by: Arko Dasgupta --------- Signed-off-by: Arko Dasgupta --- api/v1alpha1/tls_types.go | 6 +- api/v1alpha1/zz_generated.deepcopy.go | 6 +- ...y.envoyproxy.io_clienttrafficpolicies.yaml | 101 +++---- charts/gateway-helm/templates/_rbac.tpl | 1 + internal/gatewayapi/clienttrafficpolicy.go | 91 +++++- internal/gatewayapi/helpers.go | 8 +- internal/gatewayapi/resource.go | 12 + .../clienttrafficpolicy-http3.out.yaml | 2 +- .../testdata/clienttrafficpolicy-mtls.in.yaml | 118 ++++++++ .../clienttrafficpolicy-mtls.out.yaml | 273 ++++++++++++++++++ .../clienttrafficpolicy-tls-settings.out.yaml | 2 +- .../testdata/gateway-infrastructure.out.yaml | 2 +- ...her-namespace-allowed-by-refgrant.out.yaml | 2 +- ...ith-tls-terminate-and-passthrough.out.yaml | 2 +- ...ith-same-algorithm-different-fqdn.out.yaml | 4 +- ...-valid-multiple-tls-configuration.out.yaml | 4 +- ...ener-with-valid-tls-configuration.out.yaml | 2 +- ...teway-with-stale-status-condition.out.yaml | 2 +- ...wo-listeners-with-different-ports.out.yaml | 2 +- ...teway-with-listener-tls-terminate.out.yaml | 2 +- internal/gatewayapi/translator.go | 30 +- internal/gatewayapi/validate.go | 86 ++++-- internal/gatewayapi/zz_generated.deepcopy.go | 11 + internal/ir/xds.go | 11 + internal/ir/zz_generated.deepcopy.go | 25 ++ internal/provider/kubernetes/controller.go | 162 +++++++++-- internal/provider/kubernetes/indexers.go | 56 ++++ internal/provider/kubernetes/predicates.go | 45 ++- internal/xds/translator/listener.go | 37 ++- .../testdata/in/xds-ir/mutual-tls.yaml | 34 +++ .../testdata/out/xds-ir/http3.listeners.yaml | 1 - .../out/xds-ir/mutual-tls.clusters.yaml | 14 + .../out/xds-ir/mutual-tls.endpoints.yaml | 12 + .../out/xds-ir/mutual-tls.listeners.yaml | 56 ++++ .../out/xds-ir/mutual-tls.routes.yaml | 12 + .../out/xds-ir/mutual-tls.secrets.yaml | 16 + internal/xds/translator/translator.go | 17 +- internal/xds/translator/translator_test.go | 4 + site/content/en/latest/api/extension_types.md | 2 +- 39 files changed, 1114 insertions(+), 159 deletions(-) create mode 100644 internal/gatewayapi/testdata/clienttrafficpolicy-mtls.in.yaml create mode 100644 internal/gatewayapi/testdata/clienttrafficpolicy-mtls.out.yaml create mode 100644 internal/xds/translator/testdata/in/xds-ir/mutual-tls.yaml create mode 100644 internal/xds/translator/testdata/out/xds-ir/mutual-tls.clusters.yaml create mode 100644 internal/xds/translator/testdata/out/xds-ir/mutual-tls.endpoints.yaml create mode 100644 internal/xds/translator/testdata/out/xds-ir/mutual-tls.listeners.yaml create mode 100644 internal/xds/translator/testdata/out/xds-ir/mutual-tls.routes.yaml create mode 100644 internal/xds/translator/testdata/out/xds-ir/mutual-tls.secrets.yaml diff --git a/api/v1alpha1/tls_types.go b/api/v1alpha1/tls_types.go index d6eb14c638f..18729f0a68a 100644 --- a/api/v1alpha1/tls_types.go +++ b/api/v1alpha1/tls_types.go @@ -6,7 +6,7 @@ package v1alpha1 import ( - corev1 "k8s.io/api/core/v1" + gwapiv1 "sigs.k8s.io/gateway-api/apis/v1" ) // +kubebuilder:validation:XValidation:rule="has(self.minVersion) && self.minVersion == '1.3' ? !has(self.ciphers) : true", message="setting ciphers has no effect if the minimum possible TLS version is 1.3" @@ -115,7 +115,7 @@ type ClientValidationContext struct { // the Certificate Authorities that can be used // as a trust anchor to validate the certificates presented by the client. // - // A single reference to a Kubernetes ConfigMap, + // A single reference to a Kubernetes ConfigMap or a Kubernetes Secret, // with the CA certificate in a key named `ca.crt` is currently supported. // // References to a resource in different namespace are invalid UNLESS there @@ -124,5 +124,5 @@ type ClientValidationContext struct { // // +kubebuilder:validation:MaxItems=8 // +optional - CACertificateRefs []corev1.ObjectReference `json:"caCertificateRefs,omitempty"` + CACertificateRefs []gwapiv1.SecretObjectReference `json:"caCertificateRefs,omitempty"` } diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index abd1571ac13..42c79369168 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -510,8 +510,10 @@ func (in *ClientValidationContext) DeepCopyInto(out *ClientValidationContext) { *out = *in if in.CACertificateRefs != nil { in, out := &in.CACertificateRefs, &out.CACertificateRefs - *out = make([]corev1.ObjectReference, len(*in)) - copy(*out, *in) + *out = make([]apisv1.SecretObjectReference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } } diff --git a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_clienttrafficpolicies.yaml b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_clienttrafficpolicies.yaml index 69a51c47cc1..0af72696802 100644 --- a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_clienttrafficpolicies.yaml +++ b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_clienttrafficpolicies.yaml @@ -243,77 +243,56 @@ spec: to Kubernetes objects that contain TLS certificates of the Certificate Authorities that can be used as a trust anchor to validate the certificates presented by the client. \n - A single reference to a Kubernetes ConfigMap, with the CA - certificate in a key named `ca.crt` is currently supported. - \n References to a resource in different namespace are invalid - UNLESS there is a ReferenceGrant in the target namespace - that allows the certificate to be attached." + A single reference to a Kubernetes ConfigMap or a Kubernetes + Secret, with the CA certificate in a key named `ca.crt` + is currently supported. \n References to a resource in different + namespace are invalid UNLESS there is a ReferenceGrant in + the target namespace that allows the certificate to be attached." items: - description: "ObjectReference contains enough information - to let you inspect or modify the referred object. --- - New uses of this type are discouraged because of difficulty - describing its usage when embedded in APIs. 1. Ignored - fields. It includes many fields which are not generally - honored. For instance, ResourceVersion and FieldPath - are both very rarely valid in actual usage. 2. Invalid - usage help. It is impossible to add specific help for - individual usage. In most embedded usages, there are - particular restrictions like, \"must refer only to types - A and B\" or \"UID not honored\" or \"name must be restricted\". - Those cannot be well described when embedded. 3. Inconsistent - validation. Because the usages are different, the validation - rules are different by usage, which makes it hard for - users to predict what will happen. 4. The fields are both - imprecise and overly precise. Kind is not a precise mapping - to a URL. This can produce ambiguity during interpretation - and require a REST mapping. In most cases, the dependency - is on the group,resource tuple and the version of the - actual struct is irrelevant. 5. We cannot easily change - it. Because this type is embedded in many locations, - updates to this type will affect numerous schemas. Don't - make new APIs embed an underspecified API type they do - not control. \n Instead of using this type, create a locally - provided and used type that is well-focused on your reference. - For example, ServiceReferences for admission registration: - https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 - ." + description: "SecretObjectReference identifies an API object + including its namespace, defaulting to Secret. \n The + API object must be valid in the cluster; the Group and + Kind must be registered in the cluster for this reference + to be valid. \n References to objects with invalid Group + and Kind are not valid, and must be rejected by the implementation, + with appropriate Conditions set on the containing object." properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: 'If referring to a piece of an object instead - of an entire object, this string should contain a - valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container - within a pod, this would take on a value like: "spec.containers{name}" - (where "name" refers to the name of the container - that triggered the event) or if no container name - is specified "spec.containers[2]" (container with - index 2 in this pod). This syntax is chosen only to - have some well-defined way of referencing a part of - an object. TODO: this design is not final and this - field is subject to change in the future.' + group: + default: "" + description: Group is the group of the referent. For + example, "gateway.networking.k8s.io". When unspecified + or empty string, core API group is inferred. + maxLength: 253 + pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ type: string kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + default: Secret + description: Kind is kind of the referent. For example + "Secret". + maxLength: 63 + minLength: 1 + pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + description: Name is the name of the referent. + maxLength: 253 + minLength: 1 type: string namespace: - description: 'Namespace of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' - type: string - resourceVersion: - description: 'Specific resourceVersion to which this - reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' - type: string - uid: - description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + description: "Namespace is the namespace of the referenced + object. When unspecified, the local namespace is inferred. + \n Note that when a namespace different than the local + namespace is specified, a ReferenceGrant object is + required in the referent namespace to allow that namespace's + owner to accept the reference. See the ReferenceGrant + documentation for details. \n Support: Core" + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string + required: + - name type: object - x-kubernetes-map-type: atomic maxItems: 8 type: array type: object diff --git a/charts/gateway-helm/templates/_rbac.tpl b/charts/gateway-helm/templates/_rbac.tpl index 40bd819ee78..9c80ff3a868 100644 --- a/charts/gateway-helm/templates/_rbac.tpl +++ b/charts/gateway-helm/templates/_rbac.tpl @@ -29,6 +29,7 @@ Namespaced apiGroups: - "" resources: +- configmaps - secrets - services verbs: diff --git a/internal/gatewayapi/clienttrafficpolicy.go b/internal/gatewayapi/clienttrafficpolicy.go index db88d9dec6b..b6ef8f345fa 100644 --- a/internal/gatewayapi/clienttrafficpolicy.go +++ b/internal/gatewayapi/clienttrafficpolicy.go @@ -32,11 +32,12 @@ func hasSectionName(policy *egv1a1.ClientTrafficPolicy) bool { return policy.Spec.TargetRef.SectionName != nil } -func (t *Translator) ProcessClientTrafficPolicies(clientTrafficPolicies []*egv1a1.ClientTrafficPolicy, +func (t *Translator) ProcessClientTrafficPolicies(resources *Resources, gateways []*GatewayContext, xdsIR XdsIRMap, infraIR InfraIRMap) []*egv1a1.ClientTrafficPolicy { var res []*egv1a1.ClientTrafficPolicy + clientTrafficPolicies := resources.ClientTrafficPolicies // Sort based on timestamp sort.Slice(clientTrafficPolicies, func(i, j int) bool { return clientTrafficPolicies[i].CreationTimestamp.Before(&(clientTrafficPolicies[j].CreationTimestamp)) @@ -93,7 +94,7 @@ func (t *Translator) ProcessClientTrafficPolicies(clientTrafficPolicies []*egv1a var err error for _, l := range gateway.listeners { if string(l.Name) == section { - err = t.translateClientTrafficPolicyForListener(&policy.Spec, l, xdsIR, infraIR) + err = t.translateClientTrafficPolicyForListener(policy, l, xdsIR, infraIR, resources) break } } @@ -180,7 +181,7 @@ func (t *Translator) ProcessClientTrafficPolicies(clientTrafficPolicies []*egv1a continue } - err = t.translateClientTrafficPolicyForListener(&policy.Spec, l, xdsIR, infraIR) + err = t.translateClientTrafficPolicyForListener(policy, l, xdsIR, infraIR, resources) } if err != nil { @@ -286,7 +287,8 @@ func resolveCTPolicyTargetRef(policy *egv1a1.ClientTrafficPolicy, gateways []*Ga return gateway } -func (t *Translator) translateClientTrafficPolicyForListener(policySpec *egv1a1.ClientTrafficPolicySpec, l *ListenerContext, xdsIR XdsIRMap, infraIR InfraIRMap) error { +func (t *Translator) translateClientTrafficPolicyForListener(policy *egv1a1.ClientTrafficPolicy, l *ListenerContext, + xdsIR XdsIRMap, infraIR InfraIRMap, resources *Resources) error { // Find IR irKey := irStringKey(l.gateway.Namespace, l.gateway.Name) // It must exist since we've already finished processing the gateways @@ -308,27 +310,27 @@ func (t *Translator) translateClientTrafficPolicyForListener(policySpec *egv1a1. // IR must exist since we're past validation if httpIR != nil { // Translate TCPKeepalive - translateListenerTCPKeepalive(policySpec.TCPKeepalive, httpIR) + translateListenerTCPKeepalive(policy.Spec.TCPKeepalive, httpIR) // Translate Proxy Protocol - translateListenerProxyProtocol(policySpec.EnableProxyProtocol, httpIR) + translateListenerProxyProtocol(policy.Spec.EnableProxyProtocol, httpIR) // Translate Client IP Detection - translateClientIPDetection(policySpec.ClientIPDetection, httpIR) + translateClientIPDetection(policy.Spec.ClientIPDetection, httpIR) // Translate Header Settings - translateListenerHeaderSettings(policySpec.Headers, httpIR) + translateListenerHeaderSettings(policy.Spec.Headers, httpIR) // Translate Path Settings - translatePathSettings(policySpec.Path, httpIR) + translatePathSettings(policy.Spec.Path, httpIR) // Translate HTTP1 Settings - if err := translateHTTP1Settings(policySpec.HTTP1, httpIR); err != nil { + if err := translateHTTP1Settings(policy.Spec.HTTP1, httpIR); err != nil { return err } // enable http3 if set and TLS is enabled - if httpIR.TLS != nil && policySpec.HTTP3 != nil { + if httpIR.TLS != nil && policy.Spec.HTTP3 != nil { httpIR.HTTP3 = &ir.HTTP3Settings{} var proxyListenerIR *ir.ProxyListener for _, proxyListener := range infraIR[irKey].Proxy.Listeners { @@ -343,7 +345,9 @@ func (t *Translator) translateClientTrafficPolicyForListener(policySpec *egv1a1. } // Translate TLS parameters - translateListenerTLSParameters(policySpec.TLS, httpIR) + if err := t.translateListenerTLSParameters(policy, httpIR, resources); err != nil { + return err + } } return nil } @@ -452,13 +456,17 @@ func translateHTTP1Settings(http1Settings *egv1a1.HTTP1Settings, httpIR *ir.HTTP return nil } -func translateListenerTLSParameters(tlsParams *egv1a1.TLSSettings, httpIR *ir.HTTPListener) { +func (t *Translator) translateListenerTLSParameters(policy *egv1a1.ClientTrafficPolicy, + httpIR *ir.HTTPListener, resources *Resources) error { // Return if this listener isn't a TLS listener. There has to be // at least one certificate defined, which would cause httpIR to // have a TLS structure. if httpIR.TLS == nil { - return + return nil } + + tlsParams := policy.Spec.TLS + // Make sure that the negotiated TLS protocol version is as expected if TLS is used, // regardless of if TLS parameters were used in the ClientTrafficPolicy or not httpIR.TLS.MinVersion = ptr.To(ir.TLSv12) @@ -473,10 +481,12 @@ func translateListenerTLSParameters(tlsParams *egv1a1.TLSSettings, httpIR *ir.HT httpIR.TLS.ALPNProtocols[i] = string(tlsParams.ALPNProtocols[i]) } } + // Return early if not set if tlsParams == nil { - return + return nil } + if tlsParams.MinVersion != nil { httpIR.TLS.MinVersion = ptr.To(ir.TLSVersion(*tlsParams.MinVersion)) } @@ -492,4 +502,55 @@ func translateListenerTLSParameters(tlsParams *egv1a1.TLSSettings, httpIR *ir.HT if len(tlsParams.SignatureAlgorithms) > 0 { httpIR.TLS.SignatureAlgorithms = tlsParams.SignatureAlgorithms } + + if tlsParams.ClientValidation != nil { + from := crossNamespaceFrom{ + group: egv1a1.GroupName, + kind: KindClientTrafficPolicy, + namespace: policy.Namespace, + } + + irCACert := &ir.TLSCACertificate{ + Name: irTLSCACertName(policy.Namespace, policy.Name), + } + + for _, caCertRef := range tlsParams.ClientValidation.CACertificateRefs { + if caCertRef.Kind == nil || string(*caCertRef.Kind) == KindSecret { // nolint + secret, err := t.validateSecretRef(false, from, caCertRef, resources) + if err != nil { + return err + } + + secretBytes, ok := secret.Data[caCertKey] + if !ok || len(secretBytes) == 0 { + return fmt.Errorf( + "caCertificateRef not found in secret %s", caCertRef.Name) + } + + irCACert.Certificate = append(irCACert.Certificate, secretBytes...) + + } else if string(*caCertRef.Kind) == KindConfigMap { + configMap, err := t.validateConfigMapRef(false, from, caCertRef, resources) + if err != nil { + return err + } + + configMapBytes, ok := configMap.Data[caCertKey] + if !ok || len(configMapBytes) == 0 { + return fmt.Errorf( + "caCertificateRef not found in configMap %s", caCertRef.Name) + } + + irCACert.Certificate = append(irCACert.Certificate, configMapBytes...) + } else { + return fmt.Errorf("unsupported caCertificateRef kind:%s", string(*caCertRef.Kind)) + } + } + + if len(irCACert.Certificate) > 0 { + httpIR.TLS.CACertificate = irCACert + } + } + + return nil } diff --git a/internal/gatewayapi/helpers.go b/internal/gatewayapi/helpers.go index 813dfdf1306..4c4ef61aece 100644 --- a/internal/gatewayapi/helpers.go +++ b/internal/gatewayapi/helpers.go @@ -26,6 +26,8 @@ const ( L4Protocol = "L4" L7Protocol = "L7" + + caCertKey = "ca.crt" ) type protocolPort struct { @@ -389,7 +391,11 @@ func irTLSConfigs(tlsSecrets []*v1.Secret) *ir.TLSConfig { } func irTLSListenerConfigName(secret *v1.Secret) string { - return fmt.Sprintf("%s-%s", secret.Namespace, secret.Name) + return fmt.Sprintf("%s/%s", secret.Namespace, secret.Name) +} + +func irTLSCACertName(namespace, name string) string { + return fmt.Sprintf("%s/%s/%s", namespace, name, caCertKey) } func isMergeGatewaysEnabled(resources *Resources) bool { diff --git a/internal/gatewayapi/resource.go b/internal/gatewayapi/resource.go index 6dc630ddc72..0cea818a637 100644 --- a/internal/gatewayapi/resource.go +++ b/internal/gatewayapi/resource.go @@ -40,6 +40,7 @@ type Resources struct { ServiceImports []*mcsapi.ServiceImport `json:"serviceImports,omitempty" yaml:"serviceImports,omitempty"` EndpointSlices []*discoveryv1.EndpointSlice `json:"endpointSlices,omitempty" yaml:"endpointSlices,omitempty"` Secrets []*v1.Secret `json:"secrets,omitempty" yaml:"secrets,omitempty"` + ConfigMaps []*v1.ConfigMap `json:"configMaps,omitempty" yaml:"configMaps,omitempty"` EnvoyProxy *egv1a1.EnvoyProxy `json:"envoyProxy,omitempty" yaml:"envoyProxy,omitempty"` ExtensionRefFilters []unstructured.Unstructured `json:"extensionRefFilters,omitempty" yaml:"extensionRefFilters,omitempty"` EnvoyPatchPolicies []*egv1a1.EnvoyPatchPolicy `json:"envoyPatchPolicies,omitempty" yaml:"envoyPatchPolicies,omitempty"` @@ -57,6 +58,7 @@ func NewResources() *Resources { Services: []*v1.Service{}, EndpointSlices: []*discoveryv1.EndpointSlice{}, Secrets: []*v1.Secret{}, + ConfigMaps: []*v1.ConfigMap{}, ReferenceGrants: []*gwapiv1b1.ReferenceGrant{}, Namespaces: []*v1.Namespace{}, ExtensionRefFilters: []unstructured.Unstructured{}, @@ -107,6 +109,16 @@ func (r *Resources) GetSecret(namespace, name string) *v1.Secret { return nil } +func (r *Resources) GetConfigMap(namespace, name string) *v1.ConfigMap { + for _, configMap := range r.ConfigMaps { + if configMap.Namespace == namespace && configMap.Name == name { + return configMap + } + } + + return nil +} + func (r *Resources) GetEndpointSlicesForBackend(svcNamespace, svcName string, backendKind string) []*discoveryv1.EndpointSlice { var endpointSlices []*discoveryv1.EndpointSlice for _, endpointSlice := range r.EndpointSlices { diff --git a/internal/gatewayapi/testdata/clienttrafficpolicy-http3.out.yaml b/internal/gatewayapi/testdata/clienttrafficpolicy-http3.out.yaml index 49ba2bb9f81..1ffbde52972 100644 --- a/internal/gatewayapi/testdata/clienttrafficpolicy-http3.out.yaml +++ b/internal/gatewayapi/testdata/clienttrafficpolicy-http3.out.yaml @@ -157,7 +157,7 @@ xdsIR: alpnProtocols: - h3 certificates: - - name: envoy-gateway-tls-secret-1 + - name: envoy-gateway/tls-secret-1 privateKey: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2UUlCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktjd2dnU2pBZ0VBQW9JQkFRQ2QwZlBDYWtweE1nUnUKT0VXQjFiQk5FM3ZseW55aTZWbkV2VWF1OUhvakR2UHVPTFJIaGI4MmoyY1ovMHhnL1lKR09LelBuV2JERkxGNApHdWh3dDRENmFUR0xYNklPODEwTDZ0SXZIWGZNUXRJS2VwdTZ3K3p1WVo4bG1yejB1RjZlWEtqamVIbHhyb2ZrCnVNekM3OUVaU0lYZlZlczJ1SmdVRSs4VGFzSDUzQ2Y4MFNSRGlIeEdxckttdVNjWCtwejBreGdCZ1VWYTVVS20KUWdTZDFmVUxLOUEwNXAxOXkrdURPM204bVhRNkxVQ0N1STFwZHNROGFlNS9zamlxa0VjWlJjMTdWYVgxWjVVaQpvcGZnNW9SY05VTG9VTHNiek9aNTR0YlVDUmdSV2VLbGZxaElINEZ6OUlkVlUyR3dFdEdhMmV6TjgyMVBaQ3QzCjZhbVRIelJsQWdNQkFBRUNnZ0VBWTFGTUlLNDVXTkVNUHJ6RTZUY3NNdVV2RkdhQVZ4bVk5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OAo5TGhlbmx5bzQzaDVjYTZINUxqTXd1L1JHVWlGMzFYck5yaVlGQlB2RTJyQitkd24vTkVrUTRoOFJxcXlwcmtuCkYvcWM5Sk1ZQVlGRld1VkNwa0lFbmRYMUN5dlFOT2FkZmN2cmd6dDV2SmwwT2kxQWdyaU5hWGJFUEdudWY3STQKcXBCSEdVWE5lMVdsOVdlVklxS1g0T2FFWERWQzZGQzdHOHptZWVMVzFBa1lFVm5pcFg2b1NCK0JjL1NIVlZOaApzQkxSbXRuc3pmTnRUMlFyZCttcGt4ODBaUUlEQVFBQk1BMEdDU3FHU0liM0RRRUJDd1VBQTRJQkFRQ1VKOElDCkJveUVqT3V3enBHYVJoR044QjRqT1B6aHVDT0V0ZDM3UzAybHUwN09IenlCdmJzVEd6S3dCZ0x5bVdmR2tINEIKajdDTHNwOEZ6TkhLWnVhQmdwblo5SjZETE9Od2ZXZTJBWXA3TGRmT0tWQlVkTVhRaU9tN2pKOUhob0Ntdk1ONwpic2pjaFdKb013ckZmK3dkQUthdHowcUFQeWhMeWUvRnFtaVZ4a09SWmF3K1Q5bURaK0g0OXVBU2d1SnVOTXlRClY2RXlYNmd0Z1dxMzc2SHZhWE1TLzNoYW1Zb1ZXWEk1TXhpUE9ZeG5BQmtKQjRTQ2dJUmVqYkpmVmFRdG9RNGEKejAyaVVMZW5ESUllUU9Zb2JLY01CWGYxQjRQQVFtc2VocVZJYnpzUUNHaTU0VkRyczZiWmQvN0pzMXpDcHBncwpKaUQ1SXFNaktXRHdxN2FLCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K maxVersion: "1.3" diff --git a/internal/gatewayapi/testdata/clienttrafficpolicy-mtls.in.yaml b/internal/gatewayapi/testdata/clienttrafficpolicy-mtls.in.yaml new file mode 100644 index 00000000000..05ff5b87294 --- /dev/null +++ b/internal/gatewayapi/testdata/clienttrafficpolicy-mtls.in.yaml @@ -0,0 +1,118 @@ +clientTrafficPolicies: +- apiVersion: gateway.envoyproxy.io/v1alpha1 + kind: ClientTrafficPolicy + metadata: + namespace: envoy-gateway + name: target-gateway-1 + spec: + targetRef: + group: gateway.networking.k8s.io + kind: Gateway + name: gateway-1 + namespace: envoy-gateway + tls: + clientValidation: + caCertificateRefs: + - name: tls-secret-1 + namespace: envoy-gateway +- apiVersion: gateway.envoyproxy.io/v1alpha1 + kind: ClientTrafficPolicy + metadata: + namespace: envoy-gateway + name: target-gateway-2 + spec: + targetRef: + group: gateway.networking.k8s.io + kind: Gateway + name: gateway-2 + namespace: envoy-gateway + tls: + clientValidation: + caCertificateRefs: + - kind: ConfigMap + name: ca-configmap + namespace: envoy-gateway +gateways: +- apiVersion: gateway.networking.k8s.io/v1 + kind: Gateway + metadata: + namespace: envoy-gateway + name: gateway-1 + spec: + gatewayClassName: envoy-gateway-class + listeners: + - name: http-1 + protocol: HTTPS + port: 443 + allowedRoutes: + namespaces: + from: Same + tls: + mode: Terminate + certificateRefs: + - name: tls-secret-1 + namespace: envoy-gateway + - name: http-2 + protocol: HTTP + port: 8080 + allowedRoutes: + namespaces: + from: Same +- apiVersion: gateway.networking.k8s.io/v1 + kind: Gateway + metadata: + namespace: envoy-gateway + name: gateway-2 + spec: + gatewayClassName: envoy-gateway-class + listeners: + - name: http-1 + protocol: HTTPS + port: 443 + allowedRoutes: + namespaces: + from: Same + tls: + mode: Terminate + certificateRefs: + - name: tls-secret-1 + namespace: envoy-gateway +configMaps: +- apiVersion: v1 + kind: ConfigMap + metadata: + name: ca-configmap + namespace: envoy-gateway + data: + ca.crt: | + -----BEGIN CERTIFICATE----- + MIIDOzCCAiOgAwIBAgIUc41kpE9wK+NHgRGvBIgw8SCaz/8wDQYJKoZIhvcNAQEL + BQAwLTEVMBMGA1UECgwMZXhhbXBsZSBJbmMuMRQwEgYDVQQDDAtleGFtcGxlLmNv + bTAeFw0yNDAxMjYyMzE1MzFaFw0yNTAxMjUyMzE1MzFaMC0xFTATBgNVBAoMDGV4 + YW1wbGUgSW5jLjEUMBIGA1UEAwwLZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEB + AQUAA4IBDwAwggEKAoIBAQDCLhZ5DnCVE5JJ97yOocpRwclbl0UwX3cI+1ZZNltl + W6jRgy1GuN6Vr7CBmI/mPtgGs9T7DNRMl5gJJkNHSZomI6GjuP1KUhuvlfbZPWNo + p45T235Z82Gg8ORJHT5mn1QRK+bz9ruJfyldMMlicUJv/Yft6zNURxQ7BU9ciGe1 + tM+UMSxkop3dovVptELnkTDJSwt5dn+nj6j/Gr95z90/e2gjfVTtmArAG3xh/2B1 + /D6NXhwPMzYrplnM3lOpxzflOVgjMUloL1oI7sm6c+2A14NeBrW/ofB9RD7DWBHd + 76j+hcAWFsxYmsHo5Ox/tFeTk7GRdkHEELLWFBvYG0BTAgMBAAGjUzBRMB0GA1Ud + DgQWBBSrLbcQPpEx+Dt+hYE/yrjt6rOV6TAfBgNVHSMEGDAWgBSrLbcQPpEx+Dt+ + hYE/yrjt6rOV6TAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCF + 4jltqxVaKZaVML7HNQSwegy+gZ1xalymMNo7Ipc8zOyUUI47weEf/p+nkq8oxi/m + mLZoeMSdXg+gebYMMcURgtl9QfuF0aYCB3AlCxlpdH4Lk3uXNTLQXJiLQRTNsBu/ + LJ6UYvLFKPwodvRKL8KWKEgLVJmrTe3g8iL3SSnw00hWieuCdSsxNl/47ThgYXrg + u1PRBUt5g+XoWpUSOCMOFWlBJqwJYKfRA3E6ff44IUJsb7qUHHAe1wa1YDfuD+T5 + At9/m+M7GyW9oEbSQsPTGfYqP59QE+1iei6qiG+7kn4iRxJqhgm5N5o86QSk0Maz + Cz4jTEKdNvXYVFfh6Zqr + -----END CERTIFICATE----- +secrets: +- apiVersion: v1 + kind: Secret + metadata: + namespace: envoy-gateway + name: tls-secret-1 + type: kubernetes.io/tls + data: + ca.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURPekNDQWlPZ0F3SUJBZ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i/testdata/clienttrafficpolicy-mtls.out.yaml new file mode 100644 index 00000000000..31c3ae82535 --- /dev/null +++ b/internal/gatewayapi/testdata/clienttrafficpolicy-mtls.out.yaml @@ -0,0 +1,273 @@ +clientTrafficPolicies: +- apiVersion: gateway.envoyproxy.io/v1alpha1 + kind: ClientTrafficPolicy + metadata: + creationTimestamp: null + name: target-gateway-1 + namespace: envoy-gateway + spec: + targetRef: + group: gateway.networking.k8s.io + kind: Gateway + name: gateway-1 + namespace: envoy-gateway + tls: + clientValidation: + caCertificateRefs: + - group: null + kind: null + name: tls-secret-1 + namespace: envoy-gateway + status: + conditions: + - lastTransitionTime: null + message: ClientTrafficPolicy has been accepted. + reason: Accepted + status: "True" + type: Accepted +- apiVersion: gateway.envoyproxy.io/v1alpha1 + kind: ClientTrafficPolicy + metadata: + creationTimestamp: null + name: target-gateway-2 + namespace: envoy-gateway + spec: + targetRef: + group: gateway.networking.k8s.io + kind: Gateway + name: gateway-2 + namespace: envoy-gateway + tls: + clientValidation: + caCertificateRefs: + - group: null + kind: ConfigMap + name: ca-configmap + namespace: envoy-gateway + status: + conditions: + - lastTransitionTime: null + message: ClientTrafficPolicy has been accepted. + reason: Accepted + status: "True" + type: Accepted +gateways: +- apiVersion: gateway.networking.k8s.io/v1 + kind: Gateway + metadata: + creationTimestamp: null + name: gateway-1 + namespace: envoy-gateway + spec: + gatewayClassName: envoy-gateway-class + listeners: + - allowedRoutes: + namespaces: + from: Same + name: http-1 + port: 443 + protocol: HTTPS + tls: + certificateRefs: + - group: null + kind: null + name: tls-secret-1 + namespace: envoy-gateway + mode: Terminate + - allowedRoutes: + namespaces: + from: Same + name: http-2 + port: 8080 + protocol: HTTP + status: + listeners: + - attachedRoutes: 0 + conditions: + - lastTransitionTime: null + message: Sending translated listener configuration to the data plane + reason: Programmed + status: "True" + type: Programmed + - lastTransitionTime: null + message: Listener has been successfully translated + reason: Accepted + status: "True" + type: Accepted + - lastTransitionTime: null + message: Listener references have been resolved + reason: ResolvedRefs + status: "True" + type: ResolvedRefs + name: http-1 + supportedKinds: + - group: gateway.networking.k8s.io + kind: HTTPRoute + - group: gateway.networking.k8s.io + kind: GRPCRoute + - attachedRoutes: 0 + conditions: + - lastTransitionTime: null + message: Sending translated listener configuration to the data plane + reason: Programmed + status: "True" + type: Programmed + - lastTransitionTime: null + message: Listener has been successfully translated + reason: Accepted + status: "True" + type: Accepted + - lastTransitionTime: null + message: Listener references have been resolved + reason: ResolvedRefs + status: "True" + type: ResolvedRefs + name: http-2 + supportedKinds: + - group: gateway.networking.k8s.io + kind: HTTPRoute + - group: gateway.networking.k8s.io + kind: GRPCRoute +- apiVersion: gateway.networking.k8s.io/v1 + kind: Gateway + metadata: + creationTimestamp: null + name: gateway-2 + namespace: envoy-gateway + spec: + gatewayClassName: envoy-gateway-class + listeners: + - allowedRoutes: + namespaces: + from: Same + name: http-1 + port: 443 + protocol: HTTPS + tls: + certificateRefs: + - group: null + kind: null + name: tls-secret-1 + namespace: envoy-gateway + mode: Terminate + status: + listeners: + - attachedRoutes: 0 + conditions: + - lastTransitionTime: null + message: Sending translated listener configuration to the data plane + reason: Programmed + status: "True" + type: Programmed + - lastTransitionTime: null + message: Listener has been successfully translated + reason: Accepted + status: "True" + type: Accepted + - lastTransitionTime: null + message: Listener references have been resolved + reason: ResolvedRefs + status: "True" + type: ResolvedRefs + name: http-1 + supportedKinds: + - group: gateway.networking.k8s.io + kind: HTTPRoute + - group: gateway.networking.k8s.io + kind: GRPCRoute +infraIR: + envoy-gateway/gateway-1: + proxy: + listeners: + - address: null + name: envoy-gateway/gateway-1/http-1 + ports: + - containerPort: 10443 + name: http-1 + protocol: HTTPS + servicePort: 443 + - address: null + name: envoy-gateway/gateway-1/http-2 + ports: + - containerPort: 8080 + name: http-2 + protocol: HTTP + servicePort: 8080 + metadata: + labels: + gateway.envoyproxy.io/owning-gateway-name: gateway-1 + gateway.envoyproxy.io/owning-gateway-namespace: envoy-gateway + name: envoy-gateway/gateway-1 + envoy-gateway/gateway-2: + proxy: + listeners: + - address: null + name: envoy-gateway/gateway-2/http-1 + ports: + - containerPort: 10443 + name: http-1 + protocol: HTTPS + servicePort: 443 + metadata: + labels: + gateway.envoyproxy.io/owning-gateway-name: gateway-2 + gateway.envoyproxy.io/owning-gateway-namespace: envoy-gateway + name: envoy-gateway/gateway-2 +xdsIR: + envoy-gateway/gateway-1: + accessLog: + text: + - path: /dev/stdout + http: + - address: 0.0.0.0 + hostnames: + - '*' + isHTTP2: false + name: envoy-gateway/gateway-1/http-1 + path: + escapedSlashesAction: UnescapeAndRedirect + mergeSlashes: true + port: 10443 + tls: + caCertificate: + certificate: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURPekNDQWlPZ0F3SUJBZ0lVYzQxa3BFOXdLK05IZ1JHdkJJZ3c4U0Nhei84d0RRWUpLb1pJaHZjTkFRRUwKQlFBd0xURVZNQk1HQTFVRUNnd01aWGhoYlhCc1pTQkpibU11TVJRd0VnWURWUVFEREF0bGVHRnRjR3hsTG1OdgpiVEFlRncweU5EQXhNall5TXpFMU16RmFGdzB5TlRBeE1qVXlNekUxTXpGYU1DMHhGVEFUQmdOVkJBb01ER1Y0CllXMXdiR1VnU1c1akxqRVVNQklHQTFVRUF3d0xaWGhoYlhCc1pTNWpiMjB3Z2dFaU1BMEdDU3FHU0liM0RRRUIKQVFVQUE0SUJEd0F3Z2dFS0FvSUJBUURDTGhaNURuQ1ZFNUpKOTd5T29jcFJ3Y2xibDBVd1gzY0krMVpaTmx0bApXNmpSZ3kxR3VONlZyN0NCbUkvbVB0Z0dzOVQ3RE5STWw1Z0pKa05IU1pvbUk2R2p1UDFLVWh1dmxmYlpQV05vCnA0NVQyMzVaODJHZzhPUkpIVDVtbjFRUksrYno5cnVKZnlsZE1NbGljVUp2L1lmdDZ6TlVSeFE3QlU5Y2lHZTEKdE0rVU1TeGtvcDNkb3ZWcHRFTG5rVERKU3d0NWRuK25qNmovR3I5NXo5MC9lMmdqZlZUdG1BckF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W4yV1Z1OFEyK0RqRnFoc3B1WHp0NnhVK2RoVVBxUnV1Ckt6c1l4TDNpMVlWZ2pDQWtBUmp4SGhMWHYwdkFUWUVRMlJ6Uko5c2ZGcWVCMHVxSk5WL0lHamJFSzQ2eTQ5QU0KNzU4TUY4T0R6cVR2Q3hMRjJYd3BScjdjSDFuZ2J4eUJ6cEdlbkpsVTI2Q2hJT1BMZUV1NTUyUVJYVGwrU2JlQQpXUzNpS01Pb3F5NGV0b0ExNWFueW43Zm01YnpINEcyZ3Yxd1pWYlBkT1dNQWRZU2I5NDIvR09CSWUzSnIyVHo3CjRJdDRROWFERnF1aG9iOTVQMUhHQkxSQ2Y5QT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= + maxVersion: "1.3" + minVersion: "1.2" + - address: 0.0.0.0 + hostnames: + - '*' + isHTTP2: false + name: envoy-gateway/gateway-1/http-2 + path: + escapedSlashesAction: UnescapeAndRedirect + mergeSlashes: true + port: 8080 + envoy-gateway/gateway-2: + accessLog: + text: + - path: /dev/stdout + http: + - address: 0.0.0.0 + hostnames: + - '*' + isHTTP2: false + name: envoy-gateway/gateway-2/http-1 + path: + escapedSlashesAction: UnescapeAndRedirect + mergeSlashes: true + port: 10443 + tls: + caCertificate: + certificate: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURPekNDQWlPZ0F3SUJBZ0lVYzQxa3BFOXdLK05IZ1JHdkJJZ3c4U0Nhei84d0RRWUpLb1pJaHZjTkFRRUwKQlFBd0xURVZNQk1HQTFVRUNnd01aWGhoYlhCc1pTQkpibU11TVJRd0VnWURWUVFEREF0bGVHRnRjR3hsTG1OdgpiVEFlRncweU5EQXhNall5TXpFMU16RmFGdzB5TlRBeE1qVXlNekUxTXpGYU1DMHhGVEFUQmdOVkJBb01ER1Y0CllXMXdiR1VnU1c1akxqRVVNQklHQTFVRUF3d0xaWGhoYlhCc1pTNWpiMjB3Z2dFaU1BMEdDU3FHU0liM0RRRUIK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05JZ3RwVkNvRExLdmJMNjFuZE51bGUzL21EbS92MgpTeVRIdWQxUzVkcXNwOGtKZHU4WFVSZmMyWUVsRktXdkJ0bmpoL2pyTE1YRmNhaFYvb3hKckNIdXQvUENMYkJUCkFqVGV1U0RhdVM3T0hiSlJES3dtSDdvVnZ5SUNhSXlhWWNaTkFnTUJBQUV3RFFZSktvWklodmNOQVFFTEJRQUQKZ2dFQkFHeW5yNGNPMWFZbjRNQk90aVJ2WHFJdllHNnpxZXNrNGpQbU96TjdiUTdyRzdNUngzSVQ2SW4zVFI4RApHbFAxVE54TTg5cXZRcXp4VERsdER3bXluTlV1SEdEUW4yV1Z1OFEyK0RqRnFoc3B1WHp0NnhVK2RoVVBxUnV1Ckt6c1l4TDNpMVlWZ2pDQWtBUmp4SGhMWHYwdkFUWUVRMlJ6Uko5c2ZGcWVCMHVxSk5WL0lHamJFSzQ2eTQ5QU0KNzU4TUY4T0R6cVR2Q3hMRjJYd3BScjdjSDFuZ2J4eUJ6cEdlbkpsVTI2Q2hJT1BMZUV1NTUyUVJYVGwrU2JlQQpXUzNpS01Pb3F5NGV0b0ExNWFueW43Zm01YnpINEcyZ3Yxd1pWYlBkT1dNQWRZU2I5NDIvR09CSWUzSnIyVHo3CjRJdDRROWFERnF1aG9iOTVQMUhHQkxSQ2Y5QT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= + maxVersion: "1.3" + minVersion: "1.2" diff --git a/internal/gatewayapi/testdata/clienttrafficpolicy-tls-settings.out.yaml b/internal/gatewayapi/testdata/clienttrafficpolicy-tls-settings.out.yaml index 13154cdb100..70adfea5072 100644 --- a/internal/gatewayapi/testdata/clienttrafficpolicy-tls-settings.out.yaml +++ b/internal/gatewayapi/testdata/clienttrafficpolicy-tls-settings.out.yaml @@ -150,7 +150,7 @@ xdsIR: alpnProtocols: - h2 certificates: - - name: envoy-gateway-tls-secret-1 + - name: envoy-gateway/tls-secret-1 privateKey: LS0tLS1CRUdJTiBQUklWQVRF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hQmdwblo5SjZETE9Od2ZXZTJBWXA3TGRmT0tWQlVkTVhRaU9tN2pKOUhob0Ntdk1ONwpic2pjaFdKb013ckZmK3dkQUthdHowcUFQeWhMeWUvRnFtaVZ4a09SWmF3K1Q5bURaK0g0OXVBU2d1SnVOTXlRClY2RXlYNmd0Z1dxMzc2SHZhWE1TLzNoYW1Zb1ZXWEk1TXhpUE9ZeG5BQmtKQjRTQ2dJUmVqYkpmVmFRdG9RNGEKejAyaVVMZW5ESUllUU9Zb2JLY01CWGYxQjRQQVFtc2VocVZJYnpzUUNHaTU0VkRyczZiWmQvN0pzMXpDcHBncwpKaUQ1SXFNaktXRHdxN2FLCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K ciphers: diff --git a/internal/gatewayapi/testdata/gateway-infrastructure.out.yaml b/internal/gatewayapi/testdata/gateway-infrastructure.out.yaml index 34d5ebda862..57e77d7b5f5 100644 --- a/internal/gatewayapi/testdata/gateway-infrastructure.out.yaml +++ b/internal/gatewayapi/testdata/gateway-infrastructure.out.yaml @@ -144,6 +144,6 @@ xdsIR: prefix: / tls: certificates: - - name: default-tls-secret-1 + - name: default/tls-secret-1 privateKey: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2UUlCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktjd2dnU2pBZ0VBQW9JQkFRQ2QwZlBDYWtweE1nUnUKT0VXQjFiQk5FM3ZseW55aTZWbkV2VWF1OUhvakR2UHVPTFJIaGI4MmoyY1ovMHhnL1lKR09LelBuV2JERkxGNApHdWh3dDRENmFUR0xYNklPODEwTDZ0SXZIWGZNUXRJS2VwdTZ3K3p1WVo4bG1yejB1RjZlWEtqamVIbHhyb2ZrCnVNekM3OUVaU0lYZlZlczJ1SmdVRSs4VGFzSDUzQ2Y4MFNSRGlIeEdxckttdVNjWCtwejBreGdCZ1VWYTVVS20KUWdTZDFmVUxLOUEwNXAxOXkrdURPM204bVhRNkxVQ0N1STFwZHNROG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ateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.out.yaml index 7165c0b5780..f72ccd5db18 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.out.yaml @@ -133,6 +133,6 @@ xdsIR: prefix: / tls: certificates: - - name: default-tls-secret-1 + - name: default/tls-secret-1 privateKey: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2UUlCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktjd2dnU2pBZ0VBQW9JQkFRQ2QwZlBDYWtweE1nUnUKT0VXQjFiQk5FM3ZseW55aTZWbkV2VWF1OUhvakR2UHVPTFJIaGI4MmoyY1ovMHhnL1lKR09LelBuV2JERkxGNApHdWh3dDRENmFUR0xYNklPODEwTDZ0SXZIWGZNUXRJS2VwdTZ3K3p1WVo4bG1yejB1RjZlWEtqamVIbHhyb2ZrCnVNekM3OUVaU0lYZlZlczJ1SmdVRSs4VGFzSDUzQ2Y4MFNSRGlIeEdxckttdVNjWCtwejBreGdCZ1VWYTVVS20KUWdTZDFmVUxLOUEwNXAxOXkrdURPM204bVhRNkxVQ0N1STFwZHNROGFlNS9zamlxa0VjWlJjMTdWYVgxWjVVaQpvcGZnNW9SY05VTG9VTHNiek9aNTR0YlVDUmdSV2VLbGZxaElINEZ6OUlkVlUyR3dFdEdhMmV6TjgyMVBaQ3QzCjZhbVRIelJsQWdNQkFBRUNnZ0VBWTFGTUlLNDVXTkVNUHJ6RTZUY3NNdVV2RkdhQVZ4bVk5NW5SMEtwajdvb3IKY21CVys2ZXN0TTQ4S1AwaitPbXd3VFpMY29Cd3VoWGN0V1Bob1lXcDhteWUxRUlEdjNyaHRHMDdocEQ1NGg2dgpCZzh3ejdFY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0lFbmRYMUN5dlFOT2FkZmN2cmd6dDV2SmwwT2kxQWdyaU5hWGJFUEdudWY3STQKcXBCSEdVWE5lMVdsOVdlVklxS1g0T2FFWERWQzZGQzdHOHptZWVMVzFBa1lFVm5pcFg2b1NCK0JjL1NIVlZOaApzQkxSbXRuc3pmTnRUMlFyZCttcGt4ODBaUUlEQVFBQk1BMEdDU3FHU0liM0RRRUJDd1VBQTRJQkFRQ1VKOElDCkJveUVqT3V3enBHYVJoR044QjRqT1B6aHVDT0V0ZDM3UzAybHUwN09IenlCdmJzVEd6S3dCZ0x5bVdmR2tINEIKajdDTHNwOEZ6TkhLWnVhQmdwblo5SjZETE9Od2ZXZTJBWXA3TGRmT0tWQlVkTVhRaU9tN2pKOUhob0Ntdk1ONwpic2pjaFdKb013ckZmK3dkQUthdHowcUFQeWhMeWUvRnFtaVZ4a09SWmF3K1Q5bURaK0g0OXVBU2d1SnVOTXlRClY2RXlYNmd0Z1dxMzc2SHZhWE1TLzNoYW1Zb1ZXWEk1TXhpUE9ZeG5BQmtKQjRTQ2dJUmVqYkpmVmFRdG9RNGEKejAyaVVMZW5ESUllUU9Zb2JLY01CWGYxQjRQQVFtc2VocVZJYnpzUUNHaTU0VkRyczZiWmQvN0pzMXpDcHBncwpKaUQ1SXFNaktXRHdxN2FLCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.out.yaml index 03bff1ce9d8..e8683486282 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.out.yaml @@ -202,7 +202,7 @@ xdsIR: prefix: / tls: certificates: - - name: envoy-gateway-tls-secret-1 + - name: envoy-gateway/tls-secret-1 privateKey: LS0tLS1CRUdJTiBQUklWQVRFIEtF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wblo5SjZETE9Od2ZXZTJBWXA3TGRmT0tWQlVkTVhRaU9tN2pKOUhob0Ntdk1ONwpic2pjaFdKb013ckZmK3dkQUthdHowcUFQeWhMeWUvRnFtaVZ4a09SWmF3K1Q5bURaK0g0OXVBU2d1SnVOTXlRClY2RXlYNmd0Z1dxMzc2SHZhWE1TLzNoYW1Zb1ZXWEk1TXhpUE9ZeG5BQmtKQjRTQ2dJUmVqYkpmVmFRdG9RNGEKejAyaVVMZW5ESUllUU9Zb2JLY01CWGYxQjRQQVFtc2VocVZJYnpzUUNHaTU0VkRyczZiWmQvN0pzMXpDcHBncwpKaUQ1SXFNaktXRHdxN2FLCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K tcp: diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration-with-same-algorithm-different-fqdn.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration-with-same-algorithm-different-fqdn.out.yaml index 4ed7fc048bf..e2cd9a173fe 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration-with-same-algorithm-different-fqdn.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration-with-same-algorithm-different-fqdn.out.yaml @@ -135,9 +135,9 @@ xdsIR: prefix: / tls: certificates: - - name: envoy-gateway-tls-secret-ecdsa-1 + - name: envoy-gateway/tls-secret-ecdsa-1 privateKey: LS0tLS1CRUdJTiBFQyBQUklWQVRFIEtFWS0tLS0tCk1IY0NBUUVFSUxEbnZNM1RKM3NHYm9EeTF4T3dqSVppVFNWeWZXVWF5YVExcWdrdUdacEtvQW9HQ0NxR1NNNDkKQXdFSG9VUURRZ0FFSDVWdHJjenJQS091alV5RTMyaDU2UnVrdHUzSVhTVnJJMkNibXh5UUpqcEY3di9rNVNqTQpSVXZjUnBCdmpnQWROaGhUNGNUMXV4YW1TMFlmQ2JXMVhRPT0KLS0tLS1FTkQgRUMgUFJJ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ZBVEUgS0VZLS0tLS0K serverCertificate: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJZakNCNlFJSkFNcDhYTGNsWGJ2NU1Bb0dDQ3FHU000OUJBTUNNQnN4R1RBWEJnTlZCQU1NRUhSbGMzUXUKWlhoaGJYQnNaUzVqYjIwd0hoY05Nak13TlRJMU1UUXhNRFF5V2hjTk1qUXdOVEkwTVRReE1EUXlXakFiTVJrdwpGd1lEVlFRRERCQjBaWE4wTG1WNFlXMXdiR1V1WTI5dE1IWXdFQVlIS29aSXpqMENBUVlGSzRFRUFDSURZZ0FFCmVNdEhDM2hJZXEyUXNka3RTaS9aTlIvTUtOYXZTbTNITm43dEdvZ2ZxYXFuOEFTZ0hJYTd5VVUrK1Bzb0RENmsKZisrQ2U3dXNkMG1RTzFTbmRZSVdqMlFMaUl6ME5aSDhCL1FyNGk3SjBJS3dzUWxVbnVuWnF2NUtZOVRMUWEwbgpNQW9HQ0NxR1NNNDlCQU1DQTJnQU1HVUNNUUNHVGpQa2hqZE1KcWUrVjFGRWpteUk2andEV0FDalhucFRuaXhVCnM2dUNKZjVNNUw1TmpGYmkydGplMGlES0UxVUNNQXdxSjZmOUs2bUhUd2JxVGkzTVNFMmQxODl6aUcyWVZCaUQKYmVXcHc0UjF5ZTdHRFJvVm9veG9ob2lERjdsNm13PT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration.out.yaml index c8df40b5660..741785be4b6 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration.out.yaml @@ -135,9 +135,9 @@ xdsIR: prefix: / tls: certificates: - - name: envoy-gateway-tls-secret-1 + - name: envoy-gateway/tls-secret-1 privateKey: L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JCd05DQUFRZmxXMnR6T3M4Cm82Nk5USVRmYUhucEc2UzI3Y2hkSldzallKdWJISkFtT2tYdS8rVGxLTXhGUzl4R2tHK09BQjAyR0ZQaHhQVzcKRnFaTFJoOEp0YlZkTUFvR0NDcUdTTTQ5QkFNQ0EwZ0FNRVVDSVFEdlplU1pBZ1VWV2VpM3o0ZEhOTEd0aHpiaQoxRHZ0anRQekhYZ1R3WS92YmdJZ05KWStNcTRweFJnNit3eU04R1R4czVUV3k5Zml5RGhMUEU5QnhlbEsxSjQ9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml index 3bfd5c50811..bc02d7f9543 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml @@ -132,6 +132,6 @@ xdsIR: prefix: / tls: certificates: - - name: envoy-gateway-tls-secret-1 + - name: envoy-gateway/tls-secret-1 privateKey: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2UUlCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktjd2dnU2pBZ0VBQW9JQkFRQ2QwZlBDYWtweE1nUnUKT0VXQjFiQk5FM3ZseW55aTZWbkV2VWF1OUhvakR2UHVPTFJIaGI4MmoyY1ovMHhnL1lKR09LelBuV2JERkxGNApHdWh3dDRENmFUR0xYNklPODEwTDZ0SXZIWGZNUXRJS2VwdTZ3K3p1WVo4bG1yejB1RjZlWEtqamVIbHhyb2ZrCnVNekM3OUVaU0lYZlZlczJ1SmdVRSs4VGFzSDUzQ2Y4MFNSRGlIeEdxckttdVNjWCtwejBreGdCZ1VWYTVVS20KUWdTZDFmVUxLOUEwNXAxOXkrdURPM204bVhRNkxVQ0N1STFwZHNROGFlNS9zamlxa0VjW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.yaml b/internal/gatewayapi/testdata/gateway-with-stale-status-condition.out.yaml index 987cff5897e..aae3821da4d 100644 --- a/internal/gatewayapi/testdata/gateway-with-stale-status-condition.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-stale-status-condition.out.yaml @@ -132,6 +132,6 @@ xdsIR: prefix: / tls: certificates: - - name: default-tls-secret-1 + - name: default/tls-secret-1 privateKey: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2UUlCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktjd2dnU2pBZ0VBQW9JQkFRQ2QwZlBDYWtweE1nUnUKT0VXQjFiQk5FM3ZseW55aTZWbkV2VWF1OUhvakR2UHVPTFJIaGI4MmoyY1ovMHhnL1lKR09LelBuV2JERkxGNApHdWh3dDRENmFUR0xYNklPODEwTDZ0SXZIWGZNUXRJS2VwdTZ3K3p1WVo4bG1yejB1RjZlWEtqamVIbHhyb2ZrCnVNekM3OUVaU0lYZlZlczJ1SmdVRSs4VGFzSDUzQ2Y4MFNSRGlIeEdxckttdVNjWCtwejBreGdCZ1VWYTVVS20KUWdTZDFmVUxLOUEwNXAxOXkrdURPM204bVhRNkxVQ0N1STFwZHNROGFlNS9zamlxa0VjWlJjMTdWYVgxWjVVaQpvcGZnNW9SY05VTG9VTHNiek9aNTR0YlVDUmdSV2VLbGZxaElINEZ6OUlkVlUyR3dFdEdhMmV6TjgyMVBaQ3QzCjZhbVRIelJsQWdNQkFBRUNnZ0VBWTFGTUlLNDVXTkVNUHJ6RTZUY3NNdVV2RkdhQVZ4bVk5NW5SMEtwajdvb3IKY21CVys2ZXN0TTQ4S1AwaitPbXd3VFpMY29Cd3VoWGN0V1Bob1lXcDhteWUxRUlEdjNyaHRHMDdocEQ1NGg2dgpCZzh3ejdFYStzMk9sT0N6UnlKNzBSY281YlhjWDNGaGJjdnFlRWJwaFFyQnpOSEtLMjZ4cmZqNWZIT3p6T1FGCmJHdUZ3SDVic3JGdFhlajJXM3c4eW90N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HptZWVMVzFBa1lFVm5pcFg2b1NCK0JjL1NIVlZOaApzQkxSbXRuc3pmTnRUMlFyZCttcGt4ODBaUUlEQVFBQk1BMEdDU3FHU0liM0RRRUJDd1VBQTRJQkFRQ1VKOElDCkJveUVqT3V3enBHYVJoR044QjRqT1B6aHVDT0V0ZDM3UzAybHUwN09IenlCdmJzVEd6S3dCZ0x5bVdmR2tINEIKajdDTHNwOEZ6TkhLWnVhQmdwblo5SjZETE9Od2ZXZTJBWXA3TGRmT0tWQlVkTVhRaU9tN2pKOUhob0Ntdk1ONwpic2pjaFdKb013ckZmK3dkQUthdHowcUFQeWhMeWUvRnFtaVZ4a09SWmF3K1Q5bURaK0g0OXVBU2d1SnVOTXlRClY2RXlYNmd0Z1dxMzc2SHZhWE1TLzNoYW1Zb1ZXWEk1TXhpUE9ZeG5BQmtKQjRTQ2dJUmVqYkpmVmFRdG9RNGEKejAyaVVMZW5ESUllUU9Zb2JLY01CWGYxQjRQQVFtc2VocVZJYnpzUUNHaTU0VkRyczZiWmQvN0pzMXpDcHBncwpKaUQ1SXFNaktXRHdxN2FLCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml index ebaafcee77f..fbb816e0e08 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml @@ -196,6 +196,6 @@ xdsIR: prefix: / tls: certificates: - - name: envoy-gateway-tls-secret-1 + - name: envoy-gateway/tls-secret-1 privateKey: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2UUlCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktjd2dnU2pBZ0VBQW9JQkFRQ2QwZlBDYWtwe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cUFQeWhMeWUvRnFtaVZ4a09SWmF3K1Q5bURaK0g0OXVBU2d1SnVOTXlRClY2RXlYNmd0Z1dxMzc2SHZhWE1TLzNoYW1Zb1ZXWEk1TXhpUE9ZeG5BQmtKQjRTQ2dJUmVqYkpmVmFRdG9RNGEKejAyaVVMZW5ESUllUU9Zb2JLY01CWGYxQjRQQVFtc2VocVZJYnpzUUNHaTU0VkRyczZiWmQvN0pzMXpDcHBncwpKaUQ1SXFNaktXRHdxN2FLCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K diff --git a/internal/gatewayapi/testdata/tcproute-attaching-to-gateway-with-listener-tls-terminate.out.yaml b/internal/gatewayapi/testdata/tcproute-attaching-to-gateway-with-listener-tls-terminate.out.yaml index f70ca85e266..5a2f7ef478a 100644 --- a/internal/gatewayapi/testdata/tcproute-attaching-to-gateway-with-listener-tls-terminate.out.yaml +++ b/internal/gatewayapi/testdata/tcproute-attaching-to-gateway-with-listener-tls-terminate.out.yaml @@ -112,6 +112,6 @@ xdsIR: tls: terminate: certificates: - - name: envoy-gateway-tls-secret-1 + - name: envoy-gateway/tls-secret-1 privateKey: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2UUlCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktjd2dnU2pBZ0VBQW9JQkFRQ2QwZlBDYWtweE1nUnUKT0VXQjFiQk5FM3ZseW55aTZWbkV2VWF1OUhvakR2UHVPTFJIaGI4MmoyY1ovMHhnL1lKR09LelBuV2JERkxGNApHdWh3dDRENmFUR0xYNklPODEwTDZ0SXZIWGZNUXRJS2VwdTZ3K3p1WVo4bG1yejB1RjZlWEtqamVIbHhyb2ZrCnVNekM3OUVaU0lYZlZlczJ1SmdVRSs4VGFzSDUzQ2Y4MFNSRGlIeEdxckttdVNjWCtwejBreGdCZ1VWYTVVS20KUWdTZDFmVUxLOUEwNXAxOXkrdURPM204bVhRNkxVQ0N1STFwZHNROGFlNS9zamlxa0VjWlJjM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bd0490066..5163deca337 100644 --- a/internal/gatewayapi/translator.go +++ b/internal/gatewayapi/translator.go @@ -15,19 +15,21 @@ import ( ) const ( - KindEnvoyProxy = "EnvoyProxy" - KindGateway = "Gateway" - KindGatewayClass = "GatewayClass" - KindGRPCRoute = "GRPCRoute" - KindHTTPRoute = "HTTPRoute" - KindNamespace = "Namespace" - KindTLSRoute = "TLSRoute" - KindTCPRoute = "TCPRoute" - KindUDPRoute = "UDPRoute" - KindService = "Service" - KindServiceImport = "ServiceImport" - KindSecret = "Secret" - KindSecurityPolicy = "SecurityPolicy" + KindConfigMap = "ConfigMap" + KindClientTrafficPolicy = "ClientTrafficPolicy" + KindEnvoyProxy = "EnvoyProxy" + KindGateway = "Gateway" + KindGatewayClass = "GatewayClass" + KindGRPCRoute = "GRPCRoute" + KindHTTPRoute = "HTTPRoute" + KindNamespace = "Namespace" + KindTLSRoute = "TLSRoute" + KindTCPRoute = "TCPRoute" + KindUDPRoute = "UDPRoute" + KindService = "Service" + KindServiceImport = "ServiceImport" + KindSecret = "Secret" + KindSecurityPolicy = "SecurityPolicy" GroupMultiClusterService = "multicluster.x-k8s.io" // OwningGatewayNamespaceLabel is the owner reference label used for managed infra. @@ -152,7 +154,7 @@ func (t *Translator) Translate(resources *Resources) *TranslateResult { t.ProcessEnvoyPatchPolicies(resources.EnvoyPatchPolicies, xdsIR) // Process ClientTrafficPolicies - clientTrafficPolicies := t.ProcessClientTrafficPolicies(resources.ClientTrafficPolicies, gateways, xdsIR, infraIR) + clientTrafficPolicies := t.ProcessClientTrafficPolicies(resources, gateways, xdsIR, infraIR) // Process all Addresses for all relevant Gateways. t.ProcessAddresses(gateways, xdsIR, infraIR, resources) diff --git a/internal/gatewayapi/validate.go b/internal/gatewayapi/validate.go index 5511da30361..e694f1f9e7a 100644 --- a/internal/gatewayapi/validate.go +++ b/internal/gatewayapi/validate.go @@ -735,23 +735,76 @@ func (t *Translator) validateHostname(hostname string) error { func (t *Translator) validateSecretRef( allowCrossNamespace bool, from crossNamespaceFrom, - secretRef gwapiv1b1.SecretObjectReference, + secretObjRef gwapiv1b1.SecretObjectReference, resources *Resources) (*v1.Secret, error) { - if secretRef.Group != nil && string(*secretRef.Group) != "" { - return nil, errors.New("secret ref group must be unspecified/empty") - } - if secretRef.Kind != nil && string(*secretRef.Kind) != KindSecret { - return nil, fmt.Errorf("secret ref kind must be %s", KindSecret) + if err := t.validateSecretObjectRef(allowCrossNamespace, from, secretObjRef, resources); err != nil { + return nil, err } secretNamespace := from.namespace + if secretObjRef.Namespace != nil { + secretNamespace = string(*secretObjRef.Namespace) + } + secret := resources.GetSecret(secretNamespace, string(secretObjRef.Name)) + + if secret == nil { + return nil, fmt.Errorf( + "secret %s/%s does not exist", secretNamespace, secretObjRef.Name) + } + + return secret, nil +} + +func (t *Translator) validateConfigMapRef( + allowCrossNamespace bool, + from crossNamespaceFrom, + secretObjRef gwapiv1b1.SecretObjectReference, + resources *Resources) (*v1.ConfigMap, error) { + + if err := t.validateSecretObjectRef(allowCrossNamespace, from, secretObjRef, resources); err != nil { + return nil, err + } + + configMapNamespace := from.namespace + if secretObjRef.Namespace != nil { + configMapNamespace = string(*secretObjRef.Namespace) + } + configMap := resources.GetConfigMap(configMapNamespace, string(secretObjRef.Name)) + + if configMap == nil { + return nil, fmt.Errorf( + "configmap %s/%s does not exist", configMapNamespace, secretObjRef.Name) + } + + return configMap, nil +} + +func (t *Translator) validateSecretObjectRef( + allowCrossNamespace bool, + from crossNamespaceFrom, + secretRef gwapiv1b1.SecretObjectReference, + resources *Resources) error { + var kind string + if secretRef.Group != nil && string(*secretRef.Group) != "" { + return errors.New("secret ref group must be unspecified/empty") + } + + if secretRef.Kind == nil { // nolint + kind = KindSecret + } else if string(*secretRef.Kind) == KindSecret { + kind = KindSecret + } else if string(*secretRef.Kind) == KindConfigMap { + kind = KindConfigMap + } else { + return fmt.Errorf("secret ref kind must be %s", KindSecret) + } if secretRef.Namespace != nil && string(*secretRef.Namespace) != "" && string(*secretRef.Namespace) != from.namespace { if !allowCrossNamespace { - return nil, fmt.Errorf( + return fmt.Errorf( "secret ref namespace must be unspecified/empty or %s", from.namespace) } @@ -760,29 +813,20 @@ func (t *Translator) validateSecretRef( from, crossNamespaceTo{ group: "", - kind: KindSecret, + kind: kind, namespace: string(*secretRef.Namespace), name: string(secretRef.Name), }, resources.ReferenceGrants, ) { - return nil, - fmt.Errorf( - "certificate ref to secret %s/%s not permitted by any ReferenceGrant", - *secretRef.Namespace, secretRef.Name) + return fmt.Errorf( + "certificate ref to secret %s/%s not permitted by any ReferenceGrant", + *secretRef.Namespace, secretRef.Name) } - secretNamespace = string(*secretRef.Namespace) - } - - secret := resources.GetSecret(secretNamespace, string(secretRef.Name)) - - if secret == nil { - return nil, fmt.Errorf( - "secret %s/%s does not exist", secretNamespace, secretRef.Name) } - return secret, nil + return nil } // TODO: zhaohuabing combine this function with the one in the route translator diff --git a/internal/gatewayapi/zz_generated.deepcopy.go b/internal/gatewayapi/zz_generated.deepcopy.go index 56335dc5bc9..eb31a82d5e9 100644 --- a/internal/gatewayapi/zz_generated.deepcopy.go +++ b/internal/gatewayapi/zz_generated.deepcopy.go @@ -160,6 +160,17 @@ func (in *Resources) DeepCopyInto(out *Resources) { } } } + if in.ConfigMaps != nil { + in, out := &in.ConfigMaps, &out.ConfigMaps + *out = make([]*corev1.ConfigMap, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(corev1.ConfigMap) + (*in).DeepCopyInto(*out) + } + } + } if in.EnvoyProxy != nil { in, out := &in.EnvoyProxy, &out.EnvoyProxy *out = new(apiv1alpha1.EnvoyProxy) diff --git a/internal/ir/xds.go b/internal/ir/xds.go index 89e9ad5a602..39038b0f7db 100644 --- a/internal/ir/xds.go +++ b/internal/ir/xds.go @@ -275,6 +275,8 @@ const ( type TLSConfig struct { // Certificates contains the set of certificates associated with this listener Certificates []TLSCertificate `json:"certificates,omitempty" yaml:"certificates,omitempty"` + // CACertificate to verify the client + CACertificate *TLSCACertificate `json:"caCertificate,omitempty" yaml:"caCertificate,omitempty"` // MinVersion defines the minimal version of the TLS protocol supported by this listener. MinVersion *TLSVersion `json:"minVersion,omitempty" yaml:"version,omitempty"` // MaxVersion defines the maximal version of the TLS protocol supported by this listener. @@ -300,6 +302,15 @@ type TLSCertificate struct { PrivateKey []byte `json:"privateKey,omitempty" yaml:"privateKey,omitempty"` } +// TLSCACertificate holds CA Certificate to validate clients +// +k8s:deepcopy-gen=true +type TLSCACertificate struct { + // Name of the Secret object. + Name string `json:"name" yaml:"name"` + // Certificate content. + Certificate []byte `json:"certificate,omitempty" yaml:"certificate,omitempty"` +} + func (t TLSCertificate) Validate() error { var errs error if len(t.ServerCertificate) == 0 { diff --git a/internal/ir/zz_generated.deepcopy.go b/internal/ir/zz_generated.deepcopy.go index a0bb675b814..800cc33f1ed 100644 --- a/internal/ir/zz_generated.deepcopy.go +++ b/internal/ir/zz_generated.deepcopy.go @@ -1792,6 +1792,26 @@ func (in *TLS) DeepCopy() *TLS { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TLSCACertificate) DeepCopyInto(out *TLSCACertificate) { + *out = *in + if in.Certificate != nil { + in, out := &in.Certificate, &out.Certificate + *out = make([]byte, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSCACertificate. +func (in *TLSCACertificate) DeepCopy() *TLSCACertificate { + if in == nil { + return nil + } + out := new(TLSCACertificate) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TLSCertificate) DeepCopyInto(out *TLSCertificate) { *out = *in @@ -1827,6 +1847,11 @@ func (in *TLSConfig) DeepCopyInto(out *TLSConfig) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.CACertificate != nil { + in, out := &in.CACertificate, &out.CACertificate + *out = new(TLSCACertificate) + (*in).DeepCopyInto(*out) + } if in.MinVersion != nil { in, out := &in.MinVersion, &out.MinVersion *out = new(TLSVersion) diff --git a/internal/provider/kubernetes/controller.go b/internal/provider/kubernetes/controller.go index 515783dc4f1..3240d7b90b7 100644 --- a/internal/provider/kubernetes/controller.go +++ b/internal/provider/kubernetes/controller.go @@ -31,7 +31,7 @@ import ( gwapiv1b1 "sigs.k8s.io/gateway-api/apis/v1beta1" mcsapi "sigs.k8s.io/mcs-api/pkg/apis/v1alpha1" - "github.com/envoyproxy/gateway/api/v1alpha1" + egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1" "github.com/envoyproxy/gateway/api/v1alpha1/validation" "github.com/envoyproxy/gateway/internal/envoygateway/config" "github.com/envoyproxy/gateway/internal/gatewayapi" @@ -50,7 +50,7 @@ type gatewayAPIReconciler struct { store *kubernetesProviderStore namespace string namespaceLabel *metav1.LabelSelector - envoyGateway *v1alpha1.EnvoyGateway + envoyGateway *egv1a1.EnvoyGateway mergeGateways bool resources *message.ProviderResources @@ -74,7 +74,7 @@ func newGatewayAPIController(mgr manager.Manager, cfg *config.Server, su status. byNamespaceSelector := cfg.EnvoyGateway.Provider != nil && cfg.EnvoyGateway.Provider.Kubernetes != nil && cfg.EnvoyGateway.Provider.Kubernetes.Watch != nil && - cfg.EnvoyGateway.Provider.Kubernetes.Watch.Type == v1alpha1.KubernetesWatchModeTypeNamespaceSelector && + cfg.EnvoyGateway.Provider.Kubernetes.Watch.Type == egv1a1.KubernetesWatchModeTypeNamespaceSelector && (cfg.EnvoyGateway.Provider.Kubernetes.Watch.NamespaceSelector.MatchLabels != nil || len(cfg.EnvoyGateway.Provider.Kubernetes.Watch.NamespaceSelector.MatchExpressions) > 0) @@ -115,7 +115,7 @@ type resourceMappings struct { allAssociatedNamespaces map[string]struct{} // Map for storing backendRefs' NamespaceNames referred by various Route objects. allAssociatedBackendRefs map[gwapiv1.BackendObjectReference]struct{} - // Map for storing referenceGrant NamespaceNames for BackendRefs, SecretRefs. + // Map for storing referenceGrant NamespaceNames for BackendRefs, SecretRefs, ConfigMapRefs. allAssociatedRefGrants map[types.NamespacedName]*gwapiv1b1.ReferenceGrant // extensionRefFilters is a map of filters managed by an extension. // The key is the namespaced name of the filter and the value is the @@ -251,7 +251,7 @@ func (r *gatewayAPIReconciler) Reconcile(ctx context.Context, _ reconcile.Reques } // Add all EnvoyPatchPolicies - envoyPatchPolicies := v1alpha1.EnvoyPatchPolicyList{} + envoyPatchPolicies := egv1a1.EnvoyPatchPolicyList{} if err := r.client.List(ctx, &envoyPatchPolicies); err != nil { return reconcile.Result{}, fmt.Errorf("error listing EnvoyPatchPolicies: %w", err) } @@ -260,13 +260,13 @@ func (r *gatewayAPIReconciler) Reconcile(ctx context.Context, _ reconcile.Reques policy := policy // Discard Status to reduce memory consumption in watchable // It will be recomputed by the gateway-api layer - policy.Status = v1alpha1.EnvoyPatchPolicyStatus{} + policy.Status = egv1a1.EnvoyPatchPolicyStatus{} resourceTree.EnvoyPatchPolicies = append(resourceTree.EnvoyPatchPolicies, &policy) } // Add all ClientTrafficPolicies - clientTrafficPolicies := v1alpha1.ClientTrafficPolicyList{} + clientTrafficPolicies := egv1a1.ClientTrafficPolicyList{} if err := r.client.List(ctx, &clientTrafficPolicies); err != nil { return reconcile.Result{}, fmt.Errorf("error listing ClientTrafficPolicies: %w", err) } @@ -275,13 +275,16 @@ func (r *gatewayAPIReconciler) Reconcile(ctx context.Context, _ reconcile.Reques policy := policy // Discard Status to reduce memory consumption in watchable // It will be recomputed by the gateway-api layer - policy.Status = v1alpha1.ClientTrafficPolicyStatus{} + policy.Status = egv1a1.ClientTrafficPolicyStatus{} resourceTree.ClientTrafficPolicies = append(resourceTree.ClientTrafficPolicies, &policy) } + // Add the referenced ConfigMaps in ClientTrafficPolicies to the resourceTree + r.processCtpConfigMapRefs(ctx, resourceTree, resourceMap) + // Add all BackendTrafficPolicies - backendTrafficPolicies := v1alpha1.BackendTrafficPolicyList{} + backendTrafficPolicies := egv1a1.BackendTrafficPolicyList{} if err := r.client.List(ctx, &backendTrafficPolicies); err != nil { return reconcile.Result{}, fmt.Errorf("error listing BackendTrafficPolicies: %w", err) } @@ -290,12 +293,12 @@ func (r *gatewayAPIReconciler) Reconcile(ctx context.Context, _ reconcile.Reques policy := policy // Discard Status to reduce memory consumption in watchable // It will be recomputed by the gateway-api layer - policy.Status = v1alpha1.BackendTrafficPolicyStatus{} + policy.Status = egv1a1.BackendTrafficPolicyStatus{} resourceTree.BackendTrafficPolicies = append(resourceTree.BackendTrafficPolicies, &policy) } // Add all SecurityPolicies - securityPolicies := v1alpha1.SecurityPolicyList{} + securityPolicies := egv1a1.SecurityPolicyList{} if err := r.client.List(ctx, &securityPolicies); err != nil { return reconcile.Result{}, fmt.Errorf("error listing SecurityPolicies: %w", err) } @@ -304,7 +307,7 @@ func (r *gatewayAPIReconciler) Reconcile(ctx context.Context, _ reconcile.Reques policy := policy // Discard Status to reduce memory consumption in watchable // It will be recomputed by the gateway-api layer - policy.Status = v1alpha1.SecurityPolicyStatus{} + policy.Status = egv1a1.SecurityPolicyStatus{} resourceTree.SecurityPolicies = append(resourceTree.SecurityPolicies, &policy) } @@ -474,6 +477,107 @@ func (r *gatewayAPIReconciler) processSecretRef( return nil } +// processCtpConfigMapRefs adds the referenced ConfigMaps in ClientTrafficPolicies +// to the resourceTree +func (r *gatewayAPIReconciler) processCtpConfigMapRefs( + ctx context.Context, resourceTree *gatewayapi.Resources, resourceMap *resourceMappings) { + for _, policy := range resourceTree.ClientTrafficPolicies { + tls := policy.Spec.TLS + + if tls != nil && tls.ClientValidation != nil { + for _, caCertRef := range tls.ClientValidation.CACertificateRefs { + if caCertRef.Kind != nil && string(*caCertRef.Kind) == gatewayapi.KindConfigMap { + if err := r.processConfigMapRef( + ctx, + resourceMap, + resourceTree, + gatewayapi.KindClientTrafficPolicy, + policy.Namespace, + policy.Name, + caCertRef); err != nil { + // we don't return an error here, because we want to continue + // reconciling the rest of the ClientTrafficPolicies despite that this + // reference is invalid. + // This ClientTrafficPolicy will be marked as invalid in its status + // when translating to IR because the referenced configmap can't be + // found. + r.log.Error(err, + "failed to process CACertificateRef for ClientTrafficPolicy", + "policy", policy, "caCertificateRef", caCertRef.Name) + } + } else if caCertRef.Kind == nil || string(*caCertRef.Kind) == gatewayapi.KindSecret { + if err := r.processSecretRef( + ctx, + resourceMap, + resourceTree, + gatewayapi.KindClientTrafficPolicy, + policy.Namespace, + policy.Name, + caCertRef); err != nil { + r.log.Error(err, + "failed to process CACertificateRef for SecurityPolicy", + "policy", policy, "caCertificateRef", caCertRef.Name) + } + } + } + } + } +} + +// processConfigMapRef adds the referenced ConfigMap to the resourceTree if it's valid. +// - If it exists in the same namespace as the owner. +// - If it exists in a different namespace, and there is a ReferenceGrant. +func (r *gatewayAPIReconciler) processConfigMapRef( + ctx context.Context, + resourceMap *resourceMappings, + resourceTree *gatewayapi.Resources, + ownerKind string, + ownerNS string, + ownerName string, + configMapRef gwapiv1b1.SecretObjectReference, +) error { + configMap := new(corev1.ConfigMap) + configMapNS := gatewayapi.NamespaceDerefOr(configMapRef.Namespace, ownerNS) + err := r.client.Get(ctx, + types.NamespacedName{Namespace: configMapNS, Name: string(configMapRef.Name)}, + configMap, + ) + if err != nil && !kerrors.IsNotFound(err) { + return fmt.Errorf("unable to find the ConfigMap: %s/%s", configMapNS, string(configMapRef.Name)) + } + + if configMapNS != ownerNS { + from := ObjectKindNamespacedName{ + kind: ownerKind, + namespace: ownerNS, + name: ownerName, + } + to := ObjectKindNamespacedName{ + kind: gatewayapi.KindConfigMap, + namespace: configMapNS, + name: configMap.Name, + } + refGrant, err := r.findReferenceGrant(ctx, from, to) + switch { + case err != nil: + return fmt.Errorf("failed to find ReferenceGrant: %w", err) + case refGrant == nil: + return fmt.Errorf( + "no matching ReferenceGrants found: from %s/%s to %s/%s", + from.kind, from.namespace, to.kind, to.namespace) + default: + // RefGrant found + resourceMap.allAssociatedRefGrants[utils.NamespacedName(refGrant)] = refGrant + r.log.Info("added ReferenceGrant to resource map", "namespace", refGrant.Namespace, + "name", refGrant.Name) + } + } + resourceMap.allAssociatedNamespaces[configMapNS] = struct{}{} // TODO Zhaohuabing do we need this line? + resourceTree.ConfigMaps = append(resourceTree.ConfigMaps, configMap) + r.log.Info("processing ConfigMap", "namespace", configMapNS, "name", string(configMapRef.Name)) + return nil +} + func (r *gatewayAPIReconciler) getNamespace(ctx context.Context, name string) (*corev1.Namespace, error) { nsKey := types.NamespacedName{Name: name} ns := new(corev1.Namespace) @@ -649,7 +753,7 @@ func (r *gatewayAPIReconciler) watchResources(ctx context.Context, mgr manager.M epPredicates = append(epPredicates, predicate.NewPredicateFuncs(r.hasMatchingNamespaceLabels)) } if err := c.Watch( - source.Kind(mgr.GetCache(), &v1alpha1.EnvoyProxy{}), + source.Kind(mgr.GetCache(), &egv1a1.EnvoyProxy{}), handler.EnqueueRequestsFromMapFunc(r.enqueueClass), epPredicates..., ); err != nil { @@ -835,6 +939,22 @@ func (r *gatewayAPIReconciler) watchResources(ctx context.Context, mgr manager.M return err } + // Watch ConfigMap CRUDs and process affected ClienTraffiPolicies. + configMapPredicates := []predicate.Predicate{ + predicate.GenerationChangedPredicate{}, + predicate.NewPredicateFuncs(r.validateConfigMapForReconcile), + } + if r.namespaceLabel != nil { + configMapPredicates = append(configMapPredicates, predicate.NewPredicateFuncs(r.hasMatchingNamespaceLabels)) + } + if err := c.Watch( + source.Kind(mgr.GetCache(), &corev1.ConfigMap{}), + handler.EnqueueRequestsFromMapFunc(r.enqueueClass), + configMapPredicates..., + ); err != nil { + return err + } + // Watch ReferenceGrant CRUDs and process affected Gateways. rgPredicates := []predicate.Predicate{predicate.GenerationChangedPredicate{}} if r.namespaceLabel != nil { @@ -872,7 +992,7 @@ func (r *gatewayAPIReconciler) watchResources(ctx context.Context, mgr manager.M if r.envoyGateway.ExtensionAPIs != nil && r.envoyGateway.ExtensionAPIs.EnableEnvoyPatchPolicy { // Watch EnvoyPatchPolicy CRUDs if err := c.Watch( - source.Kind(mgr.GetCache(), &v1alpha1.EnvoyPatchPolicy{}), + source.Kind(mgr.GetCache(), &egv1a1.EnvoyPatchPolicy{}), handler.EnqueueRequestsFromMapFunc(r.enqueueClass), eppPredicates..., ); err != nil { @@ -887,13 +1007,17 @@ func (r *gatewayAPIReconciler) watchResources(ctx context.Context, mgr manager.M } if err := c.Watch( - source.Kind(mgr.GetCache(), &v1alpha1.ClientTrafficPolicy{}), + source.Kind(mgr.GetCache(), &egv1a1.ClientTrafficPolicy{}), handler.EnqueueRequestsFromMapFunc(r.enqueueClass), ctpPredicates..., ); err != nil { return err } + if err := addCtpIndexers(ctx, mgr); err != nil { + return err + } + // Watch BackendTrafficPolicy btpPredicates := []predicate.Predicate{predicate.GenerationChangedPredicate{}} if r.namespaceLabel != nil { @@ -901,7 +1025,7 @@ func (r *gatewayAPIReconciler) watchResources(ctx context.Context, mgr manager.M } if err := c.Watch( - source.Kind(mgr.GetCache(), &v1alpha1.BackendTrafficPolicy{}), + source.Kind(mgr.GetCache(), &egv1a1.BackendTrafficPolicy{}), handler.EnqueueRequestsFromMapFunc(r.enqueueClass), btpPredicates..., ); err != nil { @@ -915,7 +1039,7 @@ func (r *gatewayAPIReconciler) watchResources(ctx context.Context, mgr manager.M } if err := c.Watch( - source.Kind(mgr.GetCache(), &v1alpha1.SecurityPolicy{}), + source.Kind(mgr.GetCache(), &egv1a1.SecurityPolicy{}), handler.EnqueueRequestsFromMapFunc(r.enqueueClass), spPredicates..., ); err != nil { @@ -953,7 +1077,7 @@ func (r *gatewayAPIReconciler) enqueueClass(_ context.Context, _ client.Object) } func (r *gatewayAPIReconciler) hasManagedClass(obj client.Object) bool { - ep, ok := obj.(*v1alpha1.EnvoyProxy) + ep, ok := obj.(*egv1a1.EnvoyProxy) if !ok { panic(fmt.Sprintf("unsupported object type %T", obj)) } @@ -991,7 +1115,7 @@ func (r *gatewayAPIReconciler) processParamsRef(ctx context.Context, gc *gwapiv1 return fmt.Errorf("unsupported parametersRef for gatewayclass %s", gc.Name) } - epList := new(v1alpha1.EnvoyProxyList) + epList := new(egv1a1.EnvoyProxyList) // The EnvoyProxy must be in the same namespace as EG. if err := r.client.List(ctx, epList, &client.ListOptions{Namespace: r.namespace}); err != nil { diff --git a/internal/provider/kubernetes/indexers.go b/internal/provider/kubernetes/indexers.go index 0931d19d907..f4daed5960e 100644 --- a/internal/provider/kubernetes/indexers.go +++ b/internal/provider/kubernetes/indexers.go @@ -35,6 +35,8 @@ const ( backendUDPRouteIndex = "backendUDPRouteIndex" secretSecurityPolicyIndex = "secretSecurityPolicyIndex" backendSecurityPolicyIndex = "backendSecurityPolicyIndex" + configMapCtpIndex = "configMapCtpIndex" + secretCtpIndex = "secretCtpIndex" ) func addReferenceGrantIndexers(ctx context.Context, mgr manager.Manager) error { @@ -425,3 +427,57 @@ func backendSecurityPolicyIndexFunc(rawObj client.Object) []string { // This should not happen because the CEL validation should catch it. return []string{} } + +// addCtpIndexers adds indexing on ClientTrafficPolicy, for ConfigMap or Secret objects that are +// referenced in ClientTrafficPolicy objects. This helps in querying for ClientTrafficPolicies that are +// affected by a particular ConfigMap or Secret CRUD. +func addCtpIndexers(ctx context.Context, mgr manager.Manager) error { + if err := mgr.GetFieldIndexer().IndexField(ctx, &v1alpha1.ClientTrafficPolicy{}, configMapCtpIndex, configMapCtpIndexFunc); err != nil { + return err + } + if err := mgr.GetFieldIndexer().IndexField(ctx, &v1alpha1.ClientTrafficPolicy{}, secretCtpIndex, secretCtpIndexFunc); err != nil { + return err + } + + return nil +} + +func configMapCtpIndexFunc(rawObj client.Object) []string { + ctp := rawObj.(*v1alpha1.ClientTrafficPolicy) + var configMapReferences []string + if ctp.Spec.TLS != nil && ctp.Spec.TLS.ClientValidation != nil { + for _, caCertRef := range ctp.Spec.TLS.ClientValidation.CACertificateRefs { + if caCertRef.Kind != nil && string(*caCertRef.Kind) == gatewayapi.KindConfigMap { + // If an explicit configmap namespace is not provided, use the ctp namespace to + // lookup the provided config map Name. + configMapReferences = append(configMapReferences, + types.NamespacedName{ + Namespace: gatewayapi.NamespaceDerefOr(caCertRef.Namespace, ctp.Namespace), + Name: string(caCertRef.Name), + }.String(), + ) + } + } + } + return configMapReferences +} + +func secretCtpIndexFunc(rawObj client.Object) []string { + ctp := rawObj.(*v1alpha1.ClientTrafficPolicy) + var secretReferences []string + if ctp.Spec.TLS != nil && ctp.Spec.TLS.ClientValidation != nil { + for _, caCertRef := range ctp.Spec.TLS.ClientValidation.CACertificateRefs { + if caCertRef.Kind == nil || (string(*caCertRef.Kind) == gatewayapi.KindSecret) { + // If an explicit namespace is not provided, use the ctp namespace to + // lookup the provided secrent Name. + secretReferences = append(secretReferences, + types.NamespacedName{ + Namespace: gatewayapi.NamespaceDerefOr(caCertRef.Namespace, ctp.Namespace), + Name: string(caCertRef.Name), + }.String(), + ) + } + } + } + return secretReferences +} diff --git a/internal/provider/kubernetes/predicates.go b/internal/provider/kubernetes/predicates.go index 237044423d7..a4145bac29d 100644 --- a/internal/provider/kubernetes/predicates.go +++ b/internal/provider/kubernetes/predicates.go @@ -21,7 +21,7 @@ import ( gwapiv1a2 "sigs.k8s.io/gateway-api/apis/v1alpha2" mcsapi "sigs.k8s.io/mcs-api/pkg/apis/v1alpha1" - "github.com/envoyproxy/gateway/api/v1alpha1" + egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1" "github.com/envoyproxy/gateway/internal/gatewayapi" "github.com/envoyproxy/gateway/internal/provider/utils" ) @@ -148,6 +148,10 @@ func (r *gatewayAPIReconciler) validateSecretForReconcile(obj client.Object) boo return true } + if r.isCtpReferencingSecret(&nsName) { + return true + } + return false } @@ -174,7 +178,7 @@ func (r *gatewayAPIReconciler) isGatewayReferencingSecret(nsName *types.Namespac } func (r *gatewayAPIReconciler) isSecurityPolicyReferencingSecret(nsName *types.NamespacedName) bool { - spList := &v1alpha1.SecurityPolicyList{} + spList := &egv1a1.SecurityPolicyList{} if err := r.client.List(context.Background(), spList, &client.ListOptions{ FieldSelector: fields.OneTermEqualSelector(secretSecurityPolicyIndex, nsName.String()), }); err != nil { @@ -185,6 +189,18 @@ func (r *gatewayAPIReconciler) isSecurityPolicyReferencingSecret(nsName *types.N return len(spList.Items) > 0 } +func (r *gatewayAPIReconciler) isCtpReferencingSecret(nsName *types.NamespacedName) bool { + ctpList := &egv1a1.ClientTrafficPolicyList{} + if err := r.client.List(context.Background(), ctpList, &client.ListOptions{ + FieldSelector: fields.OneTermEqualSelector(secretCtpIndex, nsName.String()), + }); err != nil { + r.log.Error(err, "unable to find associated ClientTrafficPolicies") + return false + } + + return len(ctpList.Items) > 0 +} + // validateServiceForReconcile tries finding the owning Gateway of the Service // if it exists, finds the Gateway's Deployment, and further updates the Gateway // status Ready condition. All Services are pushed for reconciliation. @@ -227,7 +243,7 @@ func (r *gatewayAPIReconciler) validateServiceForReconcile(obj client.Object) bo } func (r *gatewayAPIReconciler) isSecurityPolicyReferencingBackend(nsName *types.NamespacedName) bool { - spList := &v1alpha1.SecurityPolicyList{} + spList := &egv1a1.SecurityPolicyList{} if err := r.client.List(context.Background(), spList, &client.ListOptions{ FieldSelector: fields.OneTermEqualSelector(backendSecurityPolicyIndex, nsName.String()), }); err != nil { @@ -452,3 +468,26 @@ func (r *gatewayAPIReconciler) handleNode(obj client.Object) bool { r.store.addNode(node) return true } + +// validateConfigMapForReconcile checks whether the ConfigMap belongs to a valid ClientTrafficPolicy. +func (r *gatewayAPIReconciler) validateConfigMapForReconcile(obj client.Object) bool { + configMap, ok := obj.(*corev1.ConfigMap) + if !ok { + r.log.Info("unexpected object type, bypassing reconciliation", "object", obj) + return false + } + + ctpList := &egv1a1.ClientTrafficPolicyList{} + if err := r.client.List(context.Background(), ctpList, &client.ListOptions{ + FieldSelector: fields.OneTermEqualSelector(configMapCtpIndex, utils.NamespacedName(configMap).String()), + }); err != nil { + r.log.Error(err, "unable to find associated ClientTrafficPolicy") + return false + } + + if len(ctpList.Items) == 0 { + return false + } + + return true +} diff --git a/internal/xds/translator/listener.go b/internal/xds/translator/listener.go index a558e935595..fcc6a2a6e8b 100644 --- a/internal/xds/translator/listener.go +++ b/internal/xds/translator/listener.go @@ -389,7 +389,6 @@ func buildDownstreamQUICTransportSocket(tlsConfig *ir.TLSConfig) (*corev3.Transp TlsParams: buildTLSParams(tlsConfig), AlpnProtocols: buildALPNProtocols(tlsConfig.ALPNProtocols), }, - RequireClientCertificate: &wrappers.BoolValue{Value: false}, }, } @@ -402,6 +401,16 @@ func buildDownstreamQUICTransportSocket(tlsConfig *ir.TLSConfig) (*corev3.Transp }) } + if tlsConfig.CACertificate != nil { + tlsCtx.DownstreamTlsContext.RequireClientCertificate = &wrappers.BoolValue{Value: true} + tlsCtx.DownstreamTlsContext.CommonTlsContext.ValidationContextType = &tlsv3.CommonTlsContext_ValidationContextSdsSecretConfig{ + ValidationContextSdsSecretConfig: &tlsv3.SdsSecretConfig{ + Name: tlsConfig.CACertificate.Name, + SdsConfig: makeConfigSource(), + }, + } + } + tlsCtxAny, err := anypb.New(tlsCtx) if err != nil { return nil, err @@ -432,6 +441,16 @@ func buildXdsDownstreamTLSSocket(tlsConfig *ir.TLSConfig) (*corev3.TransportSock }) } + if tlsConfig.CACertificate != nil { + tlsCtx.RequireClientCertificate = &wrappers.BoolValue{Value: true} + tlsCtx.CommonTlsContext.ValidationContextType = &tlsv3.CommonTlsContext_ValidationContextSdsSecretConfig{ + ValidationContextSdsSecretConfig: &tlsv3.SdsSecretConfig{ + Name: tlsConfig.CACertificate.Name, + SdsConfig: makeConfigSource(), + }, + } + } + tlsCtxAny, err := anypb.New(tlsCtx) if err != nil { return nil, err @@ -494,8 +513,7 @@ func buildALPNProtocols(alpn []string) []string { return alpn } -func buildXdsDownstreamTLSSecret(tlsConfig ir.TLSCertificate) *tlsv3.Secret { - // Build the tls secret +func buildXdsTLSCertSecret(tlsConfig ir.TLSCertificate) *tlsv3.Secret { return &tlsv3.Secret{ Name: tlsConfig.Name, Type: &tlsv3.Secret_TlsCertificate{ @@ -511,6 +529,19 @@ func buildXdsDownstreamTLSSecret(tlsConfig ir.TLSCertificate) *tlsv3.Secret { } } +func buildXdsTLSCaCertSecret(caCertificate *ir.TLSCACertificate) *tlsv3.Secret { + return &tlsv3.Secret{ + Name: caCertificate.Name, + Type: &tlsv3.Secret_ValidationContext{ + ValidationContext: &tlsv3.CertificateValidationContext{ + TrustedCa: &corev3.DataSource{ + Specifier: &corev3.DataSource_InlineBytes{InlineBytes: caCertificate.Certificate}, + }, + }, + }, + } +} + func buildXdsUDPListener(clusterName string, udpListener *ir.UDPListener, accesslog *ir.AccessLog) (*listenerv3.Listener, error) { if udpListener == nil { return nil, errors.New("udp listener is nil") diff --git a/internal/xds/translator/testdata/in/xds-ir/mutual-tls.yaml b/internal/xds/translator/testdata/in/xds-ir/mutual-tls.yaml new file mode 100644 index 00000000000..ea7ebf48a4d --- /dev/null +++ b/internal/xds/translator/testdata/in/xds-ir/mutual-tls.yaml @@ -0,0 +1,34 @@ +http: +- name: "first-listener" + address: "0.0.0.0" + port: 10080 + hostnames: + - "*" + path: + mergeSlashes: true + escapedSlashesAction: UnescapeAndRedirect + tls: + alpnProtocols: + - h2 + - http/1.1 + certificates: + - name: secret-1 + # byte slice representation of "key-data" + serverCertificate: [99, 101, 114, 116, 45, 100, 97, 116, 97] + # byte slice representation of "key-data" + privateKey: [107, 101, 121, 45, 100, 97, 116, 97] + - name: secret-2 + serverCertificate: [99, 101, 114, 116, 45, 100, 97, 116, 97] + privateKey: [107, 101, 121, 45, 100, 97, 116, 97] + caCertificate: + name: ca-cert + certificate: [99, 101, 114, 116, 45, 100, 97, 116, 97] + routes: + - name: "first-route" + hostname: "*" + destination: + name: "first-route-dest" + settings: + - endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/out/xds-ir/http3.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http3.listeners.yaml index d3db1540bc4..5c05193ce62 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http3.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http3.listeners.yaml @@ -47,7 +47,6 @@ sdsConfig: ads: {} resourceApiVersion: V3 - requireClientCertificate: false name: envoy-gateway/gateway-1/tls-quic udpListenerConfig: downstreamSocketConfig: {} diff --git a/internal/xds/translator/testdata/out/xds-ir/mutual-tls.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/mutual-tls.clusters.yaml new file mode 100644 index 00000000000..c8692b81602 --- /dev/null +++ b/internal/xds/translator/testdata/out/xds-ir/mutual-tls.clusters.yaml @@ -0,0 +1,14 @@ +- commonLbConfig: + localityWeightedLbConfig: {} + connectTimeout: 10s + dnsLookupFamily: V4_ONLY + edsClusterConfig: + edsConfig: + ads: {} + resourceApiVersion: V3 + serviceName: first-route-dest + lbPolicy: LEAST_REQUEST + name: first-route-dest + outlierDetection: {} + perConnectionBufferLimitBytes: 32768 + type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/mutual-tls.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/mutual-tls.endpoints.yaml new file mode 100644 index 00000000000..3b3f2d09076 --- /dev/null +++ b/internal/xds/translator/testdata/out/xds-ir/mutual-tls.endpoints.yaml @@ -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 diff --git a/internal/xds/translator/testdata/out/xds-ir/mutual-tls.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/mutual-tls.listeners.yaml new file mode 100644 index 00000000000..eee06c74b93 --- /dev/null +++ b/internal/xds/translator/testdata/out/xds-ir/mutual-tls.listeners.yaml @@ -0,0 +1,56 @@ +- address: + socketAddress: + address: 0.0.0.0 + portValue: 10080 + 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 + mergeSlashes: true + normalizePath: true + pathWithEscapedSlashesAction: UNESCAPE_AND_REDIRECT + rds: + configSource: + ads: {} + resourceApiVersion: V3 + routeConfigName: first-listener + statPrefix: https + upgradeConfigs: + - upgradeType: websocket + useRemoteAddress: true + 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 + - name: secret-2 + sdsConfig: + ads: {} + resourceApiVersion: V3 + validationContextSdsSecretConfig: + name: ca-cert + sdsConfig: + ads: {} + resourceApiVersion: V3 + requireClientCertificate: true + name: first-listener + perConnectionBufferLimitBytes: 32768 diff --git a/internal/xds/translator/testdata/out/xds-ir/mutual-tls.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/mutual-tls.routes.yaml new file mode 100644 index 00000000000..2734c7cc42a --- /dev/null +++ b/internal/xds/translator/testdata/out/xds-ir/mutual-tls.routes.yaml @@ -0,0 +1,12 @@ +- ignorePortInHostMatching: true + name: first-listener + virtualHosts: + - domains: + - '*' + name: first-listener/* + routes: + - match: + prefix: / + name: first-route + route: + cluster: first-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/mutual-tls.secrets.yaml b/internal/xds/translator/testdata/out/xds-ir/mutual-tls.secrets.yaml new file mode 100644 index 00000000000..052882baf5f --- /dev/null +++ b/internal/xds/translator/testdata/out/xds-ir/mutual-tls.secrets.yaml @@ -0,0 +1,16 @@ +- name: secret-1 + tlsCertificate: + certificateChain: + inlineBytes: Y2VydC1kYXRh + privateKey: + inlineBytes: a2V5LWRhdGE= +- name: secret-2 + tlsCertificate: + certificateChain: + inlineBytes: Y2VydC1kYXRh + privateKey: + inlineBytes: a2V5LWRhdGE= +- name: ca-cert + validationContext: + trustedCa: + inlineBytes: Y2VydC1kYXRh diff --git a/internal/xds/translator/translator.go b/internal/xds/translator/translator.go index cb6da9cc772..3e8de622b4f 100644 --- a/internal/xds/translator/translator.go +++ b/internal/xds/translator/translator.go @@ -185,11 +185,18 @@ func (t *Translator) processHTTPListenerXdsTranslation( // 1:1 between IR TLSListenerConfig and xDS Secret if httpListener.TLS != nil { for t := range httpListener.TLS.Certificates { - secret := buildXdsDownstreamTLSSecret(httpListener.TLS.Certificates[t]) + secret := buildXdsTLSCertSecret(httpListener.TLS.Certificates[t]) if err := tCtx.AddXdsResource(resourcev3.SecretType, secret); err != nil { errs = errors.Join(errs, err) } } + + if httpListener.TLS.CACertificate != nil { + caSecret := buildXdsTLSCaCertSecret(httpListener.TLS.CACertificate) + if err := tCtx.AddXdsResource(resourcev3.SecretType, caSecret); err != nil { + errs = errors.Join(errs, err) + } + } } // store virtual hosts by domain @@ -357,11 +364,17 @@ func processTCPListenerXdsTranslation(tCtx *types.ResourceVersionTable, tcpListe if tcpListener.TLS != nil && tcpListener.TLS.Terminate != nil { for _, s := range tcpListener.TLS.Terminate.Certificates { - secret := buildXdsDownstreamTLSSecret(s) + secret := buildXdsTLSCertSecret(s) if err := tCtx.AddXdsResource(resourcev3.SecretType, secret); err != nil { errs = errors.Join(errs, err) } } + if tcpListener.TLS.Terminate.CACertificate != nil { + caSecret := buildXdsTLSCaCertSecret(tcpListener.TLS.Terminate.CACertificate) + if err := tCtx.AddXdsResource(resourcev3.SecretType, caSecret); err != nil { + errs = errors.Join(errs, err) + } + } } } return errs diff --git a/internal/xds/translator/translator_test.go b/internal/xds/translator/translator_test.go index a324c8a1442..2a3c34a2133 100644 --- a/internal/xds/translator/translator_test.go +++ b/internal/xds/translator/translator_test.go @@ -94,6 +94,10 @@ func TestTranslateXds(t *testing.T) { name: "simple-tls", requireSecrets: true, }, + { + name: "mutual-tls", + requireSecrets: true, + }, { name: "http3", requireSecrets: true, diff --git a/site/content/en/latest/api/extension_types.md b/site/content/en/latest/api/extension_types.md index b64355f7978..fee368f9d7f 100644 --- a/site/content/en/latest/api/extension_types.md +++ b/site/content/en/latest/api/extension_types.md @@ -313,7 +313,7 @@ _Appears in:_ | Field | Type | Required | Description | | --- | --- | --- | --- | -| `caCertificateRefs` | _[ObjectReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#objectreference-v1-core) array_ | false | CACertificateRefs contains one or more references to Kubernetes objects that contain TLS certificates of the Certificate Authorities that can be used as a trust anchor to validate the certificates presented by the client.

A single reference to a Kubernetes ConfigMap, with the CA certificate in a key named `ca.crt` is currently supported.

References to a resource in different namespace are invalid UNLESS there is a ReferenceGrant in the target namespace that allows the certificate to be attached. | +| `caCertificateRefs` | _[SecretObjectReference](https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1.SecretObjectReference) array_ | false | CACertificateRefs contains one or more references to Kubernetes objects that contain TLS certificates of the Certificate Authorities that can be used as a trust anchor to validate the certificates presented by the client.

A single reference to a Kubernetes ConfigMap or a Kubernetes Secret, with the CA certificate in a key named `ca.crt` is currently supported.

References to a resource in different namespace are invalid UNLESS there is a ReferenceGrant in the target namespace that allows the certificate to be attached. | #### Compression