-
Notifications
You must be signed in to change notification settings - Fork 5
/
security.tf
230 lines (209 loc) · 7.7 KB
/
security.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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
resource "aws_security_group" "aws_rke2_sg" {
vpc_id = aws_vpc.aws_rke2_vpc.id
depends_on = [aws_vpc.aws_rke2_vpc]
description = "AWS RKE2 Security Group"
name = "${var.prefix}-sg"
tags = {
Name = "${var.prefix}-sg"
}
}
#resource "aws_security_group_rule" "aws_rke2_sg_ingress" {
# type = "ingress"
# from_port = 0
# to_port = 0
# protocol = "-1"
# cidr_blocks = ["0.0.0.0/0"]
# security_group_id = aws_security_group.aws_rke2_sg.id
# depends_on = [aws_security_group.aws_rke2_sg]
# description = "Allow All Communication"
#}
resource "aws_security_group_rule" "aws_rke2_sg_ingress1" {
type = "ingress"
from_port = 22
to_port = 22
protocol = "TCP"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.aws_rke2_sg.id
depends_on = [aws_security_group.aws_rke2_sg]
description = "Allow SSH Communication"
}
resource "aws_security_group_rule" "aws_rke2_sg_ingress2" {
type = "ingress"
from_port = 80
to_port = 80
protocol = "TCP"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.aws_rke2_sg.id
depends_on = [aws_security_group.aws_rke2_sg]
description = "Allow Ingress Communication"
}
resource "aws_security_group_rule" "aws_rke2_sg_ingress3" {
type = "ingress"
from_port = 443
to_port = 443
protocol = "TCP"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.aws_rke2_sg.id
depends_on = [aws_security_group.aws_rke2_sg]
description = "Allow Secure Ingress Communication"
}
resource "aws_security_group_rule" "aws_rke2_sg_ingress4" {
type = "ingress"
from_port = 2376
to_port = 2376
protocol = "TCP"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.aws_rke2_sg.id
depends_on = [aws_security_group.aws_rke2_sg]
description = "Allow Rancher Provisioning Communication"
}
resource "aws_security_group_rule" "aws_rke2_sg_ingress5" {
type = "ingress"
from_port = 2379
to_port = 2380
protocol = "TCP"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.aws_rke2_sg.id
depends_on = [aws_security_group.aws_rke2_sg]
description = "Allow RKE2 ECTD Communication"
}
resource "aws_security_group_rule" "aws_rke2_sg_ingress6" {
type = "ingress"
from_port = 4789
to_port = 4789
protocol = "UDP"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.aws_rke2_sg.id
depends_on = [aws_security_group.aws_rke2_sg]
description = "Allow RKE2 Calico Communication"
}
resource "aws_security_group_rule" "aws_rke2_sg_ingress7" {
type = "ingress"
from_port = 5473
to_port = 5473
protocol = "TCP"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.aws_rke2_sg.id
depends_on = [aws_security_group.aws_rke2_sg]
description = "Allow RKE2 Calico Communication"
}
resource "aws_security_group_rule" "aws_rke2_sg_ingress8" {
type = "ingress"
from_port = 6443
to_port = 6443
protocol = "TCP"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.aws_rke2_sg.id
depends_on = [aws_security_group.aws_rke2_sg]
description = "Allow RKE2 Agent Communication"
}
resource "aws_security_group_rule" "aws_rke2_sg_ingress9" {
type = "ingress"
from_port = 8443
to_port = 8443
protocol = "TCP"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.aws_rke2_sg.id
depends_on = [aws_security_group.aws_rke2_sg]
description = "Allow Validation Ingress Communication"
}
resource "aws_security_group_rule" "aws_rke2_sg_ingress10" {
type = "ingress"
from_port = 8472
to_port = 8472
protocol = "UDP"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.aws_rke2_sg.id
depends_on = [aws_security_group.aws_rke2_sg]
description = "Allow RKE2 VXLAN Communication"
}
resource "aws_security_group_rule" "aws_rke2_sg_ingress11" {
type = "ingress"
from_port = 9345
to_port = 9345
protocol = "TCP"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.aws_rke2_sg.id
depends_on = [aws_security_group.aws_rke2_sg]
description = "Allow RKE2 Server Communication"
}
resource "aws_security_group_rule" "aws_rke2_sg_ingress12" {
type = "ingress"
from_port = 9796
to_port = 9796
protocol = "TCP"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.aws_rke2_sg.id
depends_on = [aws_security_group.aws_rke2_sg]
description = "Allow Rancher Monitoring Communication"
}
resource "aws_security_group_rule" "aws_rke2_sg_ingress13" {
type = "ingress"
from_port = 10250
to_port = 10252
protocol = "TCP"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.aws_rke2_sg.id
depends_on = [aws_security_group.aws_rke2_sg]
description = "Allow RKE2 Kubelet Communication"
}
resource "aws_security_group_rule" "aws_rke2_sg_ingress14" {
type = "ingress"
from_port = 10256
to_port = 10256
protocol = "TCP"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.aws_rke2_sg.id
depends_on = [aws_security_group.aws_rke2_sg]
description = "Allow RKE2 KubeProxy Communication"
}
resource "aws_security_group_rule" "aws_rke2_sg_ingress15" {
type = "ingress"
from_port = 30000
to_port = 32767
protocol = "TCP"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.aws_rke2_sg.id
depends_on = [aws_security_group.aws_rke2_sg]
description = "Allow RKE2 Miscellanous Communication"
}
resource "aws_security_group_rule" "aws_rke2_sg_ingress16" {
type = "ingress"
from_port = 30000
to_port = 32767
protocol = "UDP"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.aws_rke2_sg.id
depends_on = [aws_security_group.aws_rke2_sg]
description = "Allow RKE2 Miscellanous Communication"
}
resource "aws_security_group_rule" "aws_rke2_sg_ingress17" {
type = "ingress"
from_port = 10443
to_port = 10443
protocol = "TCP"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.aws_rke2_sg.id
depends_on = [aws_security_group.aws_rke2_sg]
description = "Allow Rancher NeuVector Communication"
}
resource "aws_security_group_rule" "aws_rke2_sg_ingress18" {
type = "ingress"
from_port = 11443
to_port = 11443
protocol = "TCP"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.aws_rke2_sg.id
depends_on = [aws_security_group.aws_rke2_sg]
description = "Allow Rancher NeuVector Communication"
}
resource "aws_security_group_rule" "aws_rke2_sg_egress1" {
type = "egress"
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.aws_rke2_sg.id
depends_on = [aws_security_group.aws_rke2_sg]
description = "Allow All Egress Communication"
}