Replies: 3 comments 17 replies
-
@M4t7e Super insightful suggestions. @kube-hetzner/core FYI. I think we can do that, PR most welcome, but if possible in a backward compatible fashion for the rules that are actively used now, as for the others like 4 and 5, we can remove them, that makes much sense indeed! As for # 6, maybe we can whitlist only the deploying IP, but also have a variable that accepts a list of IPs, that way, if our IP changes, we can change that value, apply, and it will update the firewall for us to whitelist our current IP. Lastly for # 3, it's taken care of by # 6, because the kube-api can be accessed from the control planes directly just by SSH'ing and using kubectl inside any control-plane node. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply! I tested the removal yesterday with different scenarios and everything seems to be fine. I would skip the removal of rule 1, because there is already a setting ( For rule 6 I have no good idea how to solve that. Dynamically obtaining the public IP can be hard and depending on the network setup of the client, it can also be unstable. In some network setups this could lead to weird situations if the public IP can vary over time -> CGNAT, public IPv6 (lease times & PEX), mobile Hotspots, etc. I think this is only a good solution if you connect via a static IP (e.g. a bastion/jump-server or a VPN with stable IPs). I would create a PR for removal of rules 2,3,4 and 5 if you think that is okay. It is backwards compatible in the sense that it won't break the cluster. Everything internally will work fine. Only users who are connecting to Kube API via the public IP would see an issue. For those I can add a section to the readme (maybe close to that section: https://github.com/kube-hetzner/terraform-hcloud-kube-hetzner/tree/master#-installation) with an explanation and an example in the For production setups, I think users would probably use Flux or Argo CD and only connect to the control plane for administrative tasks. For users that mostly work with kubectl on the CP Nodes, we could also add the kubectl bash completion (I can also add a PR for that) to make the life a bit easier working there. TLDR:
What do you think? Could this be a way forward? |
Beta Was this translation helpful? Give feedback.
-
Thx for your support guys! 🙂 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello guys, I would like to review the current firewall rules and also discuss the security aspects with you. I see a few rules that seem to do nothing and others can also be harmful.
Current Inbound Rules:
Any IPv4
Any IPv6
Any IPv4
Any IPv6
Any IPv4
Any IPv6
10.0.0.0/8
127.0.0.1
169.254.169.254
213.239.246.21
10.0.0.0/8
127.0.0.1
169.254.169.254
213.239.246.21
Any IPv4
Any IPv6
Here my thoughts:
ping
). Would it hurt to disable it by default, and if one needs it, it can still be enabled viaextra_firewall_rules
?I think rules 1,2,4 and 5 can be deleted with no harm and no loss of functionality. Rules 3 and 6 are required for deployment, but what if we make it possible to optionally configure a static IP/network to access it from? For Rule 3, I would also prefer not to expose it to the public at all (the Kube API is a big attack surface and also just a small misconfiguration can have dramatic consequences), but I don't know if there is a suitable solution to achieve that?
Would anyone like to contribute their opinion on this?
Beta Was this translation helpful? Give feedback.
All reactions