@@ -6,6 +6,8 @@ import "envoy/config/core/v3/base.proto";
6
6
7
7
import "google/protobuf/duration.proto" ;
8
8
9
+ import "xds/type/matcher/v3/matcher.proto" ;
10
+
9
11
import "udpa/annotations/status.proto" ;
10
12
import "validate/validate.proto" ;
11
13
@@ -19,9 +21,18 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
19
21
// Reverse Tunnel Network Filter :ref:`configuration overview <config_network_filters_reverse_tunnel>`.
20
22
// [#extension: envoy.filters.network.reverse_tunnel]
21
23
22
- // Configuration for the reverse tunnel network filter.
23
- // This filter handles reverse tunnel connection acceptance and rejection by processing
24
+ // The Reverse Tunnel filter handles reverse tunnel connection acceptance and rejection by processing
24
25
// HTTP requests where required identification values are provided via HTTP headers.
26
+ //
27
+ // The filter operates as a terminal filter when processing reverse tunnel requests, meaning it
28
+ // stops the filter chain after processing and manages connection lifecycle. It extracts node ID,
29
+ // cluster ID, and tenant ID from HTTP headers and optionally validates these values using the
30
+ // generic matcher framework.
31
+ //
32
+ // The filter supports configurable validation rules that can match against the extracted identifiers
33
+ // using various matcher types including string matching, regular expressions, and custom matchers.
34
+ // Requests that fail validation are rejected with HTTP 403 Forbidden.
35
+ // [#next-free-field: 6]
25
36
message ReverseTunnel {
26
37
// Ping interval for health checks on established reverse tunnel connections.
27
38
// If not specified, defaults to 2 seconds.
@@ -31,15 +42,70 @@ message ReverseTunnel {
31
42
}];
32
43
33
44
// Whether to automatically close connections after processing reverse tunnel requests.
34
- // When set to true, connections are closed after acceptance or rejection.
35
- // When set to false, connections remain open for potential reuse. Defaults to false.
45
+ // When set to `` true`` , connections are closed after acceptance or rejection.
46
+ // When set to `` false`` , connections remain open for potential reuse. Defaults to `` false`` .
36
47
bool auto_close_connections = 2 ;
37
48
38
49
// HTTP path to match for reverse tunnel requests.
39
- // If not specified, defaults to " /reverse_connections/request" .
50
+ // If not specified, defaults to `` /reverse_connections/request`` .
40
51
string request_path = 3 [(validate.rules ).string = {min_len : 1 max_len : 255 ignore_empty : true}];
41
52
42
53
// HTTP method to match for reverse tunnel requests.
43
54
// If not specified (``METHOD_UNSPECIFIED``), this defaults to ``GET``.
44
55
config.core.v3.RequestMethod request_method = 4 [(validate.rules ).enum = {defined_only : true}];
56
+
57
+ // Optional validation matcher to apply to node and cluster identifiers using the generic matcher framework.
58
+ // If specified, the matcher will be evaluated against the extracted ``node_id`` and ``cluster_id`` from
59
+ // the incoming reverse connection handshake. Requests that fail validation will be rejected with
60
+ // HTTP ``403 Forbidden``.
61
+ //
62
+ // The matcher can use various input types including:
63
+ //
64
+ // * Custom inputs like ``envoy.matching.inputs.reverse_tunnel_node_id`` and
65
+ // ``envoy.matching.inputs.reverse_tunnel_cluster_id`` to match against the extracted identifiers.
66
+ // * Standard inputs like dynamic metadata, filter state, or connection properties.
67
+ // * String matching, regular expressions, or custom matcher extensions.
68
+ //
69
+ // Example configuration for validating both ``node_id`` and ``cluster_id``:
70
+ //
71
+ // .. code-block:: yaml
72
+ //
73
+ // validation_matcher:
74
+ // matcher_list:
75
+ // matchers:
76
+ // - predicate:
77
+ // and_matcher:
78
+ // predicate:
79
+ // - predicate:
80
+ // single_predicate:
81
+ // input:
82
+ // name: envoy.matching.inputs.reverse_tunnel_node_id
83
+ // typed_config:
84
+ // "@type": type.googleapis.com/envoy.extensions.filters.network.reverse_tunnel.v3.NodeIdInput
85
+ // value_match:
86
+ // exact: expected-node
87
+ // - predicate:
88
+ // single_predicate:
89
+ // input:
90
+ // name: envoy.matching.inputs.reverse_tunnel_cluster_id
91
+ // typed_config:
92
+ // "@type": type.googleapis.com/envoy.extensions.filters.network.reverse_tunnel.v3.ClusterIdInput
93
+ // value_match:
94
+ // prefix: cluster-
95
+ // on_match:
96
+ // action:
97
+ // name: skip
98
+ // typed_config:
99
+ // "@type": type.googleapis.com/envoy.extensions.filters.common.matcher.action.v3.SkipFilter
100
+ xds.type.matcher.v3.Matcher validation_matcher = 5 ;
101
+ }
102
+
103
+ // Custom input for the generic matcher that provides the node ID value
104
+ // extracted from the ``x-envoy-reverse-tunnel-node-id`` HTTP header.
105
+ message NodeIdInput {
106
+ }
107
+
108
+ // Custom input for the generic matcher that provides the cluster ID value
109
+ // extracted from the ``x-envoy-reverse-tunnel-cluster-id`` HTTP header.
110
+ message ClusterIdInput {
45
111
}
0 commit comments