-
Notifications
You must be signed in to change notification settings - Fork 0
/
firewalls.tf
69 lines (66 loc) · 1.48 KB
/
firewalls.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
resource "hcloud_firewall" "deny_all" {
name = "${var.pool.prefix}-deny-all"
}
resource "hcloud_firewall" "this" {
name = var.pool.prefix
rule {
description = "apiserver"
direction = "in"
protocol = "tcp"
port = "6443"
source_ips = ["::/0"]
}
rule {
description = "talos control planes"
direction = "in"
protocol = "tcp"
port = "50000"
source_ips = ["::/0"]
}
rule {
description = "talos workers"
direction = "in"
protocol = "tcp"
port = "50001"
source_ips = ["::/0"]
}
rule {
description = "https"
direction = "in"
protocol = "tcp"
port = "443"
source_ips = ["::/0"]
}
rule {
description = "http"
direction = "in"
protocol = "tcp"
port = "80"
source_ips = ["::/0"]
}
rule {
description = "healthz"
direction = "in"
protocol = "tcp"
port = "10256"
source_ips = ["::/0"]
}
# allows full access between cluster nodes
dynamic "rule" {
for_each = toset(["tcp", "udp"])
content {
direction = "in"
protocol = rule.value
port = "any"
source_ips = [for key, node in var.cluster.nodes : node.public_ip6_network_64]
}
}
dynamic "rule" {
for_each = toset(["icmp", "gre", "esp"])
content {
direction = "in"
protocol = rule.value
source_ips = [for key, node in var.cluster.nodes : node.public_ip6_network_64]
}
}
}