fix: validate in-cluster server names and refuse link-local addresses #410
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.43) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 395 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.358
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #410"
general
weight: 0.35
chrisguidry
GetAPIURLbuilds the in-cluster URL fromspec.server.nameandspec.server.namespace, and nothing checked them. A name such aselsewhere.example.com/x?sent the operator's requests toelsewhere.example.com.ValidateAPIURL, renamed fromValidateRemoteAPIURL, checks them in Go for resources written before the rule.http://prefect.team-b.svc.cluster.local.:4200/api, so the host doesn't depend on the resolver's search domains. The operator reads the domain from/etc/resolv.conf.--cluster-domainand the chart'soperator.clusterDomainoverride it.prefect.io/allowed-api-urlsentries match with or without the dot. The operator doesn't use a proxy for in-cluster servers, becauseNO_PROXYentries such as.cluster.localdon't match a host that ends with a dot.fd00:ec2::254andfd20:ce::254, after DNS resolution. When the operator uses an HTTP proxy, the client refuses aremoteApiUrlwith one of those IP addresses. The proxy resolves host names, so the permissions guide says to block the addresses there too.127.0.0.1when it runs outside the cluster, and self-hosted servers often have private addresses.The permissions guide now lists what
remoteApiUrllets someone who writes a resource do.Rollout caveats
action: upper-case letters in spec.server.name or spec.server.namespaceare rejected, and an existing resource with them getsSyncedFalse. DNS ignores case, so they worked before.restart: PREFECT_API_URL changes on the workers of in-cluster servers, so their pods are replaced once. Onprocesswork pools, that interrupts the flow runs in progress.action: workers and flow runs with HTTP_PROXYneed.svc.cluster.local., with the dot, inNO_PROXY. Without it, they send API requests to the proxy in plain HTTP.action: Istio sidecars on workers and flow runs must be 1.27 or later. Earlier ones don't route a host that ends with a dot to the Service.watch: allowed-api-urls entries that end at .svc, such ashttp://prefect.team-b.svc:4200, no longer match. No release has the annotation yet.watch: clusters whose domain isn't cluster.local. The operator logs the domain it uses at startup.watch: Synced False on resources whose remoteApiUrl resolves to a link-local address. The message names the address.<details>
<summary>Session context</summary>
Found while reviewing how resources choose which Prefect API the operator calls. I tested the cluster domain on a kind cluster with the domain
k8s.example.internal: the operator detected it, and a work pool, a deployment, and a flow run used it. I repeated that with the default domain and a wildcard search domain on the node. With Istio 1.30 sidecars and strict mutual TLS, requests to the host with the dot succeeded.</details>
🤖 Generated with Claude Code