Skip to content

Commit 7c608cd

Browse files
author
Arko Dasgupta
committed
test
Signed-off-by: Arko Dasgupta <arko@tetrate.io>
1 parent ea8b8fd commit 7c608cd

File tree

5 files changed

+140
-0
lines changed

5 files changed

+140
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
tcp:
2+
- name: "tcp-listener-authorization"
3+
address: "::"
4+
port: 10080
5+
routes:
6+
- name: "tcp-route-authorization"
7+
authorization:
8+
defaultAction: Allow
9+
rules:
10+
- action: Deny
11+
name: deny-office
12+
principal:
13+
clientCIDRs:
14+
- cidr: 10.0.0.0/24
15+
distinct: false
16+
ip: 10.0.0.0
17+
isIPv6: false
18+
maskLen: 24
19+
- action: Allow
20+
name: allow-corp
21+
principal:
22+
clientCIDRs:
23+
- cidr: 192.168.100.0/24
24+
distinct: false
25+
ip: 192.168.100.0
26+
isIPv6: false
27+
maskLen: 24
28+
destination:
29+
name: "tcp-route-authorization-dest"
30+
settings:
31+
- endpoints:
32+
- host: "10.2.3.4"
33+
port: 50000
34+
name: "tcp-route-authorization-dest/backend/0"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
- circuitBreakers:
2+
thresholds:
3+
- maxRetries: 1024
4+
commonLbConfig: {}
5+
connectTimeout: 10s
6+
dnsLookupFamily: V4_PREFERRED
7+
edsClusterConfig:
8+
edsConfig:
9+
ads: {}
10+
resourceApiVersion: V3
11+
serviceName: tcp-route-authorization-dest
12+
ignoreHealthOnHostRemoval: true
13+
lbPolicy: LEAST_REQUEST
14+
loadBalancingPolicy:
15+
policies:
16+
- typedExtensionConfig:
17+
name: envoy.load_balancing_policies.least_request
18+
typedConfig:
19+
'@type': type.googleapis.com/envoy.extensions.load_balancing_policies.least_request.v3.LeastRequest
20+
localityLbConfig:
21+
localityWeightedLbConfig: {}
22+
name: tcp-route-authorization-dest
23+
perConnectionBufferLimitBytes: 32768
24+
type: EDS
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
- clusterName: tcp-route-authorization-dest
2+
endpoints:
3+
- lbEndpoints:
4+
- endpoint:
5+
address:
6+
socketAddress:
7+
address: 10.2.3.4
8+
portValue: 50000
9+
loadBalancingWeight: 1
10+
loadBalancingWeight: 1
11+
locality:
12+
region: tcp-route-authorization-dest/backend/0
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
- address:
2+
socketAddress:
3+
address: '::'
4+
portValue: 10080
5+
filterChains:
6+
- filters:
7+
- name: envoy.filters.network.rbac
8+
typedConfig:
9+
'@type': type.googleapis.com/envoy.extensions.filters.network.rbac.v3.RBAC
10+
matcher:
11+
matcherList:
12+
matchers:
13+
- onMatch:
14+
action:
15+
name: deny-office
16+
typedConfig:
17+
'@type': type.googleapis.com/envoy.config.rbac.v3.Action
18+
action: DENY
19+
name: DENY
20+
predicate:
21+
singlePredicate:
22+
customMatch:
23+
name: ip_matcher
24+
typedConfig:
25+
'@type': type.googleapis.com/envoy.extensions.matching.input_matchers.ip.v3.Ip
26+
cidrRanges:
27+
- addressPrefix: 10.0.0.0
28+
prefixLen: 24
29+
statPrefix: client_ip
30+
input:
31+
name: client_ip
32+
typedConfig:
33+
'@type': type.googleapis.com/envoy.extensions.matching.common_inputs.network.v3.SourceIPInput
34+
- onMatch:
35+
action:
36+
name: allow-corp
37+
typedConfig:
38+
'@type': type.googleapis.com/envoy.config.rbac.v3.Action
39+
name: ALLOW
40+
predicate:
41+
singlePredicate:
42+
customMatch:
43+
name: ip_matcher
44+
typedConfig:
45+
'@type': type.googleapis.com/envoy.extensions.matching.input_matchers.ip.v3.Ip
46+
cidrRanges:
47+
- addressPrefix: 192.168.100.0
48+
prefixLen: 24
49+
statPrefix: client_ip
50+
input:
51+
name: client_ip
52+
typedConfig:
53+
'@type': type.googleapis.com/envoy.extensions.matching.common_inputs.network.v3.SourceIPInput
54+
onNoMatch:
55+
action:
56+
name: default
57+
typedConfig:
58+
'@type': type.googleapis.com/envoy.config.rbac.v3.Action
59+
name: ALLOW
60+
statPrefix: tcp-10080
61+
- name: envoy.filters.network.tcp_proxy
62+
typedConfig:
63+
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
64+
cluster: tcp-route-authorization-dest
65+
statPrefix: tcp-10080
66+
name: tcp-route-authorization
67+
maxConnectionsToAcceptPerSocketEvent: 1
68+
name: tcp-listener-authorization
69+
perConnectionBufferLimitBytes: 32768
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

0 commit comments

Comments
 (0)