From fa5a818e7fe54653e3131b1594fffff56b827126 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Wed, 1 Nov 2023 23:31:38 +0100 Subject: [PATCH] Added metrics endpoint to ufw allow list --- terraform/templates/cloud-init-k8s.tftpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/terraform/templates/cloud-init-k8s.tftpl b/terraform/templates/cloud-init-k8s.tftpl index d51b8ae..4b385df 100644 --- a/terraform/templates/cloud-init-k8s.tftpl +++ b/terraform/templates/cloud-init-k8s.tftpl @@ -15,9 +15,10 @@ runcmd: - printf "[sshd]\nenabled = true\nbanaction = iptables-multiport" > /etc/fail2ban/jail.local - systemctl enable fail2ban - ufw allow OpenSSH - - ufw allow 16443 comment Kubernetes + - ufw allow 16443 comment "Kubernetes API endpoint" - ufw allow 80 comment HTTP - ufw allow 443 comment HTTPS + - ufw allow to ${node_ip} port 9100 comment "Metrics endpoint" - ufw enable - sed -i -e '/^\(#\|\)PermitRootLogin/s/^.*$/PermitRootLogin no/' /etc/ssh/sshd_config - sed -i -e '/^\(#\|\)PasswordAuthentication/s/^.*$/PasswordAuthentication no/' /etc/ssh/sshd_config