homelab/infra/firewall.tf

121 lines
1.8 KiB
Terraform
Raw Normal View History

2022-09-03 07:01:47 +00:00
resource "hcloud_firewall" "prod" {
name= "prod"
2023-10-09 18:12:43 +00:00
2022-06-19 17:04:15 +00:00
rule {
direction ="in"
2023-10-09 18:12:43 +00:00
protocol = "icmp"
2022-06-19 17:04:15 +00:00
source_ips = [
"0.0.0.0/0",
"::/0"
]
}
rule {
direction ="in"
2023-10-09 18:12:43 +00:00
protocol = "udp"
port = "51820"
2022-06-19 17:04:15 +00:00
source_ips = [
"0.0.0.0/0",
"::/0"
]
}
2023-10-09 18:12:43 +00:00
rule {
2022-06-19 17:04:15 +00:00
direction ="in"
2023-10-09 18:12:43 +00:00
protocol = "tcp"
port = "80"
2022-06-19 17:04:15 +00:00
source_ips = [
"0.0.0.0/0",
"::/0"
]
}
rule {
direction ="in"
2023-10-09 18:12:43 +00:00
protocol = "tcp"
port = "443"
2022-06-19 17:04:15 +00:00
source_ips = [
"0.0.0.0/0",
"::/0"
]
}
2023-10-09 18:12:43 +00:00
}
resource "hcloud_firewall" "torrent" {
name = "torrent"
2022-06-19 17:04:15 +00:00
rule {
direction ="in"
2022-08-27 07:37:25 +00:00
protocol = "tcp"
port = "50000"
2022-06-19 17:04:15 +00:00
source_ips = [
"0.0.0.0/0",
"::/0"
]
2022-08-27 07:37:25 +00:00
2022-06-19 17:04:15 +00:00
}
2023-10-09 18:12:43 +00:00
rule {
2022-08-27 07:37:25 +00:00
direction ="in"
2023-10-09 18:12:43 +00:00
protocol = "udp"
port = "6881"
2022-06-19 17:04:15 +00:00
source_ips = [
"0.0.0.0/0",
"::/0"
]
}
2022-09-03 07:01:47 +00:00
}
resource "hcloud_firewall" "ssh" {
name= "ssh"
rule {
direction ="in"
protocol = "tcp"
port="22"
source_ips = [
"0.0.0.0/0",
"::/0"
]
}
2022-06-19 17:04:15 +00:00
}
2022-10-08 07:12:41 +00:00
resource "hcloud_firewall" "Gitea_SSH" {
name= "Gitea SSH"
rule {
direction ="in"
protocol = "tcp"
port="2222"
source_ips = [
"0.0.0.0/0",
"::/0"
]
}
}
2023-10-01 17:29:19 +00:00
resource "hcloud_firewall" "mail" {
name= "mail"
rule {
direction ="in"
protocol = "tcp"
port="25"
source_ips = [
"0.0.0.0/0",
"::/0"
]
}
rule {
direction ="in"
protocol = "tcp"
port="993"
source_ips = [
"0.0.0.0/0",
"::/0"
]
}
rule {
direction ="in"
protocol = "tcp"
port="465"
source_ips = [
"0.0.0.0/0",
"::/0"
]
}
}