fix(external-dns): restrict Cloudflare record scope - #2743
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_9adb831a-44cb-4300-9a28-9c9fedc07539) |
| - --exclude-target-net=10.0.0.0/8 | ||
| # Restrict Gateway HTTPRoute-derived records to this cluster's delegated | ||
| # DNS subtree while domainFilters still selects the Cloudflare zone apex. | ||
| - --regex-domain-filter=^([a-z0-9]([-a-z0-9]*[a-z0-9])?\.)*${external_dns_domain_regex}$ |
There was a problem hiding this comment.
[P1] Keep the Cloudflare apex discoverable
At the pinned ExternalDNS v0.21.0, setting --regex-domain-filter switches the shared domain filter to regex mode, so the domainFilters value above is ignored. The Cloudflare provider applies that same filter to zone.Name before it reads or applies records. This pattern accepts platform.devantler.tech and its descendants but rejects the actual Cloudflare zone apex devantler.tech, leaving Zones() empty and preventing reconciliation for every managed record. Configure an exact zone-ID filter so provider discovery bypasses the record-name regex (without publishing the identifier), or otherwise prove an equivalent boundary; add a rendered/behavioral guard showing the apex zone is discovered while sibling subdomains outside the delegated subtree are rejected.
✅
|
Closing as superseded by #2740, merged as 64767a9. That change removes Gateway API route verbs from the built-in edit role and enforces per-tenant hostname allow-lists, rejecting foreign hostnames, omitted hostnames, and unlisted tenant namespaces. It therefore closes this PRs stated untrusted-HTTPRoute input path while retaining Cloudflare apex discovery. The unresolved P1 remains valid at exact head 56feba6: ExternalDNS v0.21.0 applies regex-domain-filter during zone discovery, so this pattern rejects the actual devantler.tech zone and prevents reconciliation. Merging this duplicate would trade a remediated exposure for a production DNS outage. No merge was performed. |

Motivation
devantler.techby sourcing hostnames from Gateway HTTPRoutes that the shared Gateway accepts from all namespaces.Description
external_dns_domain_regextoprod(variables-cluster) containing an escaped form of the delegated domain (platform\.devantler\.tech) for safe use in an ExternalDNS regex filter.--regex-domain-filter=^([a-z0-9]([-a-z0-9]*[a-z0-9])?\.)*${external_dns_domain_regex}$to the Hetzner HelmRelease so HTTPRoute-derived hostnames are restricted to the cluster's delegated subtree whiledomainFiltersstill selects the Cloudflare zone apex.domainFilters(zone selection),registry: txtownership,--exclude-target-net=10.0.0.0/8, and--cloudflare-proxiedbehavior.Testing
python scripts/validate-naming.pyand it passed.python scripts/validate-embedded-json.pyand it passed.git diff --check(no whitespace/errors) and a YAML parse smoke-check via Ruby (YAML.load_stream) on the modified files; both succeeded.kubectl kustomize k8s/clusters/local/andkubectl kustomize k8s/clusters/prod/could not be executed in this environment becausekubectlis not installed (not run).Codex Task