-
Notifications
You must be signed in to change notification settings - Fork 98
/
variables.tf
211 lines (165 loc) · 7.58 KB
/
variables.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# Network Security Group definition
variable "resource_group_name" {
type = string
description = "Name of the resource group"
}
# Custom security rules
# [name, priority, direction, access, protocol, source_port_range, destination_port_range, description]"
# All the fields are required.
variable "custom_rules" {
type = any
default = []
description = "Security rules for the network security group using this format name = [name, priority, direction, access, protocol, source_port_range, destination_port_range, source_address_prefix, destination_address_prefix, description]"
}
variable "destination_address_prefix" {
type = list(string)
default = ["*"]
description = "Destination address prefix to be applied to all predefined rules. list(string) only allowed one element (CIDR, `*`, source IP range or Tags). Example [\"10.0.3.0/24\"] or [\"VirtualNetwork\"]"
}
variable "destination_address_prefixes" {
type = list(string)
default = null
description = "Destination address prefix to be applied to all predefined rules. Example [\"10.0.3.0/32\",\"10.0.3.128/32\"]"
}
variable "location" {
# No default - if it's not specified, use the resource group location (see main.tf)
type = string
default = ""
description = "Location (Azure Region) for the network security group."
}
variable "predefined_rules" {
type = any
default = []
description = "Predefined rules"
}
variable "rules" {
type = map(any)
# [direction, access, protocol, source_port_range, destination_port_range, description]"
# The following info are in the submodules: source_address_prefix, destination_address_prefix
default = {
#ActiveDirectory
ActiveDirectory-AllowADReplication = ["Inbound", "Allow", "*", "*", "389", "AllowADReplication"]
ActiveDirectory-AllowADReplicationSSL = ["Inbound", "Allow", "*", "*", "636", "AllowADReplicationSSL"]
ActiveDirectory-AllowADGCReplication = ["Inbound", "Allow", "Tcp", "*", "3268", "AllowADGCReplication"]
ActiveDirectory-AllowADGCReplicationSSL = ["Inbound", "Allow", "Tcp", "*", "3269", "AllowADGCReplicationSSL"]
ActiveDirectory-AllowDNS = ["Inbound", "Allow", "*", "*", "53", "AllowDNS"]
ActiveDirectory-AllowKerberosAuthentication = ["Inbound", "Allow", "*", "*", "88", "AllowKerberosAuthentication"]
ActiveDirectory-AllowADReplicationTrust = ["Inbound", "Allow", "*", "*", "445", "AllowADReplicationTrust"]
ActiveDirectory-AllowSMTPReplication = ["Inbound", "Allow", "Tcp", "*", "25", "AllowSMTPReplication"]
ActiveDirectory-AllowRPCReplication = ["Inbound", "Allow", "Tcp", "*", "135", "AllowRPCReplication"]
ActiveDirectory-AllowFileReplication = ["Inbound", "Allow", "Tcp", "*", "5722", "AllowFileReplication"]
ActiveDirectory-AllowWindowsTime = ["Inbound", "Allow", "Udp", "*", "123", "AllowWindowsTime"]
ActiveDirectory-AllowPasswordChangeKerberes = ["Inbound", "Allow", "*", "*", "464", "AllowPasswordChangeKerberes"]
ActiveDirectory-AllowDFSGroupPolicy = ["Inbound", "Allow", "Udp", "*", "138", "AllowDFSGroupPolicy"]
ActiveDirectory-AllowADDSWebServices = ["Inbound", "Allow", "Tcp", "*", "9389", "AllowADDSWebServices"]
ActiveDirectory-AllowNETBIOSAuthentication = ["Inbound", "Allow", "Udp", "*", "137", "AllowNETBIOSAuthentication"]
ActiveDirectory-AllowNETBIOSReplication = ["Inbound", "Allow", "Tcp", "*", "139", "AllowNETBIOSReplication"]
#Cassandra
Cassandra = ["Inbound", "Allow", "Tcp", "*", "9042", "Cassandra"]
#Cassandra-JMX
Cassandra-JMX = ["Inbound", "Allow", "Tcp", "*", "7199", "Cassandra-JMX"]
#Cassandra-Thrift
Cassandra-Thrift = ["Inbound", "Allow", "Tcp", "*", "9160", "Cassandra-Thrift"]
#CouchDB
CouchDB = ["Inbound", "Allow", "Tcp", "*", "5984", "CouchDB"]
#CouchDB-HTTPS
CouchDB-HTTPS = ["Inbound", "Allow", "Tcp", "*", "6984", "CouchDB-HTTPS"]
#DNS-TCP
DNS-TCP = ["Inbound", "Allow", "Tcp", "*", "53", "DNS-TCP"]
#DNS-UDP
DNS-UDP = ["Inbound", "Allow", "Udp", "*", "53", "DNS-UDP"]
#DynamicPorts
DynamicPorts = ["Inbound", "Allow", "Tcp", "*", "49152-65535", "DynamicPorts"]
#ElasticSearch
ElasticSearch = ["Inbound", "Allow", "Tcp", "*", "9200-9300", "ElasticSearch"]
#FTP
FTP = ["Inbound", "Allow", "Tcp", "*", "21", "FTP"]
#HTTP
HTTP = ["Inbound", "Allow", "Tcp", "*", "80", "HTTP"]
#HTTPS
HTTPS = ["Inbound", "Allow", "Tcp", "*", "443", "HTTPS"]
#IMAP
IMAP = ["Inbound", "Allow", "Tcp", "*", "143", "IMAP"]
#IMAPS
IMAPS = ["Inbound", "Allow", "Tcp", "*", "993", "IMAPS"]
#Kestrel
Kestrel = ["Inbound", "Allow", "Tcp", "*", "22133", "Kestrel"]
#LDAP
LDAP = ["Inbound", "Allow", "Tcp", "*", "389", "LDAP"]
#MongoDB
MongoDB = ["Inbound", "Allow", "Tcp", "*", "27017", "MongoDB"]
#Memcached
Memcached = ["Inbound", "Allow", "Tcp", "*", "11211", "Memcached"]
#MSSQL
MSSQL = ["Inbound", "Allow", "Tcp", "*", "1433", "MSSQL"]
#MySQL
MySQL = ["Inbound", "Allow", "Tcp", "*", "3306", "MySQL"]
#Neo4J
Neo4J = ["Inbound", "Allow", "Tcp", "*", "7474", "Neo4J"]
#POP3
POP3 = ["Inbound", "Allow", "Tcp", "*", "110", "POP3"]
#POP3S
POP3S = ["Inbound", "Allow", "Tcp", "*", "995", "POP3S"]
#PostgreSQL
PostgreSQL = ["Inbound", "Allow", "Tcp", "*", "5432", "PostgreSQL"]
#RabbitMQ
RabbitMQ = ["Inbound", "Allow", "Tcp", "*", "5672", "RabbitMQ"]
#RDP
RDP = ["Inbound", "Allow", "Tcp", "*", "3389", "RDP"]
#Redis
Redis = ["Inbound", "Allow", "Tcp", "*", "6379", "Redis"]
#Riak
Riak = ["Inbound", "Allow", "Tcp", "*", "8093", "Riak"]
#Riak-JMX
Riak-JMX = ["Inbound", "Allow", "Tcp", "*", "8985", "Riak-JMX"]
#SMTP
SMTP = ["Inbound", "Allow", "Tcp", "*", "25", "SMTP"]
#SMTPS
SMTPS = ["Inbound", "Allow", "Tcp", "*", "465", "SMTPS"]
#SSH
SSH = ["Inbound", "Allow", "Tcp", "*", "22", "SSH"]
#WinRM
WinRM = ["Inbound", "Allow", "Tcp", "*", "5986", "WinRM"]
}
description = "Standard set of predefined rules"
}
variable "security_group_name" {
type = string
default = "nsg"
description = "Network security group name"
}
variable "source_address_prefix" {
type = list(string)
default = ["*"]
description = "Source address prefix to be applied to all predefined rules. list(string) only allowed one element (CIDR, `*`, source IP range or Tags). Example [\"10.0.3.0/24\"] or [\"VirtualNetwork\"]"
}
variable "source_address_prefixes" {
type = list(string)
default = null
description = "Destination address prefix to be applied to all predefined rules. Example [\"10.0.3.0/32\",\"10.0.3.128/32\"]"
}
variable "tags" {
type = map(string)
default = {}
description = "The tags to associate with your network security group."
}
# tflint-ignore: terraform_unused_declarations
variable "tracing_tags_enabled" {
type = bool
default = false
description = "Whether enable tracing tags that generated by BridgeCrew Yor."
nullable = false
}
# tflint-ignore: terraform_unused_declarations
variable "tracing_tags_prefix" {
type = string
default = "avm_"
description = "Default prefix for generated tracing tags"
nullable = false
}
variable "use_for_each" {
type = bool
default = false
description = "Choose wheter to use 'for_each' as iteration technic to generate the rules, defaults to false so we will use 'count' for compatibilty with previous module versions, but prefered method is 'for_each'"
nullable = false
}