fix(security): block Hetzner metadata from pods - #2745
Conversation
|
|
@cursor review |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_a5aeaa80-b124-4f4d-b202-7f5b65ec827a) |
| # contains reusable cluster join material. Keep host/Talos boot-time metadata | ||
| # access intact, but prevent workloads from reading user-data after a node | ||
| # joins the cluster. | ||
| egressDeny: |
There was a problem hiding this comment.
[P1] Apply the IMDS deny to every endpoint
This egressDeny inherits the policy-level endpointSelector, which intentionally excludes every endpoint carrying k8s-app=kube-dns. The exception is cluster-wide rather than namespace-bound, so actual CoreDNS and any workload able to carry or spoof that label remain outside the metadata deny and can still reach 169.254.169.254 when their other egress policy permits it. Because that endpoint exposes reusable Talos join material, this defeats the stated security boundary. Put the IMDS deny in a separate prod-only CiliumClusterwideNetworkPolicy with endpointSelector: {} (leaving the mutual-auth CoreDNS carve-out on its original rule), and add negative coverage for both a normal pod and a kube-dns-labeled pod.
Motivation
Description
169.254.169.254/32) by extending the existingrequire-mutual-authcluster policy to include anegressDenyclause.docs/node-autoscaling.mdto document the metadata isolation guarantee so operators understand that pod egress to IMDS is blocked in the Hetzner overlay.Testing
python3 scripts/validate-naming.pyand it passed without naming violations.ruby -e 'require "yaml"; YAML.load_stream(File.read("...") )'which succeeded.git diff --checkwhich reported no whitespace or diff errors, andkubectl kustomizecould not be executed in this environment becausekubectlis not installed so overlay kustomize rendering was not run locally.Codex Task