Skip to content
Snippets Groups Projects
Verified Commit f97d8008 authored by Sheogorath's avatar Sheogorath :european_castle:
Browse files

fix(ssh): Only enable SSH on IPv4

parent 394a4cfc
No related branches found
No related tags found
1 merge request!2Draft: Makefile: Add all commands to deploy the kubernetes controlplane
...@@ -5,9 +5,6 @@ data "hcloud_ssh_keys" "all_keys" { ...@@ -5,9 +5,6 @@ data "hcloud_ssh_keys" "all_keys" {
data "http" "myipv4" { data "http" "myipv4" {
url = "https://api4.ipify.org" url = "https://api4.ipify.org"
} }
data "http" "myipv6" {
url = "https://api6.ipify.org"
}
resource "hcloud_firewall" "k8s-ssh" { resource "hcloud_firewall" "k8s-ssh" {
name = "k8s-ssh" name = "k8s-ssh"
...@@ -34,7 +31,6 @@ resource "hcloud_firewall" "k8s-ssh" { ...@@ -34,7 +31,6 @@ resource "hcloud_firewall" "k8s-ssh" {
port = "22" port = "22"
source_ips = [ source_ips = [
"${chomp(data.http.myipv4.body)}/32", "${chomp(data.http.myipv4.body)}/32",
"${replace(chomp(data.http.myipv6.body), "/^([0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+):.*/", "$1")}::/64",
] ]
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment