-
Notifications
You must be signed in to change notification settings - Fork 798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let singleuser.cloudMetadata.blockWithIpTables only block TCP port 80 #3185
Let singleuser.cloudMetadata.blockWithIpTables only block TCP port 80 #3185
Conversation
bebf07c
to
7c7523c
Compare
7c7523c
to
f16a1b2
Compare
f16a1b2
to
231f12f
Compare
This sounds safer and less likely to have unexpected consequences, but I'm happy to go with the consensus. |
Its safer, but its harder to get done. To use I've created three rules below inside a dummy container started like
|
Looking through notes in https://book.hacktricks.xyz/pentesting-web/ssrf-server-side-request-forgery/cloud-ssrf, and testing that only port 80 seems to be relevant among 80 and 443 in GKE/EKS/AKS by practical tests, I'm starting to feel confident on just blocking TCP 80. I'll ask Yuvi later today about this. |
This should work
|
I think that strategy is quite clean, so i appreciate it more than others in a way. But, would doing this possibly make port 53 access to that ip allowed when it perhaps isnt to be |
Yes, but this is still more restrictive than option 1 which allows all ports except 80. The alternative, most secure option, is to keep the default |
Options overview
|
I chatted with Yuvi who were inclined towards the safest approach, and a varying behavior based on configuration. I was agreeing when we chatted yesterday. Now I'm having doubts again thinking about the growing complexity of things taking this path. The growing complexity stems from use of By working with What's clear to me is that I'm not comfortable with locking us into further maintenance effort involving |
I'm happy with deprecating (though not removing) iptables, and saying that
#3167 is related to Dataplane V2. According to
So we know that issue can be safely resolved without iptables, and without requiring k8s add-ons. |
A belated thought regarding |
I'm happy with the choice to provide a pre-defined rule specifically for 169.254.169.254:53 and not going more general in this case, thinking the combination of simple pre-defined boolean togglable rules + full freedom |
singleuser.cloudMetadata.blockWithIptables
block HTTP ports only #3180By blocking only TCP Port 80 on the cloud metadata server where the sensitive metadata API is exposed, as compared to all traffic which could include relevant DNS traffic for example when a GKE cluster is configured to use Cloud DNS instead of kube-dns (default).
singleuser.cloudMetadata.blockWithIpTables
#3184By adding a versionchanged note, and mentioning TCP Port 80 specifically in docs, and by failing if a config is ambiguous by both blocking via iptables and allowing access via NetworkPolicy.
Notes thinking about this
--destination-ports
, in plural instead of singular, allowing us to specify 80 and 443 (EDIT: didn't get this to work)! --destination-port 53
to block traffic except to port 53.all
or similar.I currently think that blocking only traffic to 169.254.169.254 TCP port 80 this is a clean solution thats easy to document, but I'd like quite good faith in that. Going to check this against GKE EKS AKS