-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxc_enhanced_firewall_policy.tf
120 lines (118 loc) · 3.93 KB
/
xc_enhanced_firewall_policy.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# F5 XC Enhanced Firewall Policy allows traffic ingress with specific AWS specific tag "prefix" with value "my-mcn-demo"
# Also allow well known CIDR blocks. This will eventually be less favorable by additional provider tagging support.
resource "volterra_enhanced_firewall_policy" "mcn-nc-efp" {
name = "${var.projectPrefix}-${local.buildSuffix}-enh-fw-pol"
namespace = "system"
disable = false
rule_list {
rules {
metadata {
name = "internet-to-aws"
disable = false
}
allow = true
advanced_action {
action = "LOG"
}
all_sources = true
destination_label_selector {
expressions = [
"aws.ves.io/prefix in (${var.projectPrefix}), aws.ves.io/owner in (${var.resourceOwner})"
]
}
applications {
applications = [
"APPLICATION_HTTP",
"APPLICATION_HTTPS"
]
}
}
rules {
metadata {
name = "internet-to-azure"
disable = false
}
allow = true
advanced_action {
action = "LOG"
}
all_sources = true
destination_prefix_list {
prefixes = [
"${var.azure_cidr[0].vnet[0].vnetCidr}"
]
}
applications {
applications = [
"APPLICATION_HTTP",
"APPLICATION_HTTPS"
]
}
}
rules {
metadata {
name = "allow-${var.projectPrefix}-awsvpc-prefix"
disable = false
}
allow = true
advanced_action {
action = "LOG"
}
source_label_selector {
expressions = [
"aws.ves.io/prefix in (${var.projectPrefix})"
]
}
outside_destinations = true
all_traffic = true
label_matcher {
keys = []
}
}
rules {
metadata {
name = "allow-trusted-prefixes"
disable = false
}
allow = true
advanced_action {
action = "LOG"
}
source_prefix_list {
prefixes = [
// "${var.aws_cidr}", // AWS
"${var.azure_cidr[0].vnet[0].vnetCidr}", // Azure
"${var.gcp_cidr[0].slo}", // GCP CE SLO subnet
"${var.gcp_cidr[0].proxysubnet}" // GCP ingress load balancers and proxy-only (SNAT) subnets
]
}
destination_label_selector {
expressions = [
"aws.ves.io/prefix in (${var.resourceOwner})"
]
}
applications {
applications = [
"APPLICATION_HTTP",
"APPLICATION_HTTPS"
]
}
label_matcher {
keys = []
}
}
rules {
metadata {
name = "deny-all"
disable = false
}
deny = true
advanced_action {
action = "LOG"
}
label_matcher {
keys = []
}
}
}
}