Skip to content

Convert public nginx routing to an explicit allowlist - #699

Open
svkrieger wants to merge 6 commits into
developfrom
change-nginx-public-routing-to-allowlist
Open

svkrieger wants to merge 6 commits into
developfrom
change-nginx-public-routing-to-allowlist

Conversation

@svkrieger

Copy link
Copy Markdown
Contributor

A short explanation of the proposed change:

Invert the gorouter-facing CC routing in nginx_external_endpoints.conf from allow-all-then-deny to deny-by-default. Only known public endpoints (/v3, /, /v2/info, /healthz, ssh_access, staging on local blobstore, and the existing upload paths) are proxied to CC; every other request 404s. This makes internal or newly added endpoints unreachable unless explicitly allowlisted, closing the gap where /internal/apps/.../ssh_access and future paths were exposed by the catch-all proxy.

404 (not 403) is used so unlisted paths don't leak their existence, matching the V2-disabled convention. The V2 API is served only when temporary_enable_v2 is set. Rendering tests cover the allow/deny paths, ssh_access, uploads, V2 toggling, and rate-limit placement.

An explanation of the use cases your change solves

Prevent internal endpoints being exposed through public interfaces

  • Links to any other associated PRs

  • I have viewed signed and have submitted the Contributor License Agreement

  • I have made this pull request to the develop branch

  • I have run CF Acceptance Tests on bosh lite

svkrieger and others added 6 commits September 29, 2026 15:12
Invert the gorouter-facing CC routing in nginx_external_endpoints.conf
from allow-all-then-deny to deny-by-default. Only known public endpoints
(/v3, /, /v2/info, /healthz, ssh_access, staging on local blobstore, and
the existing upload paths) are proxied to CC; every other request 404s.
This makes internal or newly added endpoints unreachable unless explicitly
allowlisted, closing the gap where /internal/apps/.../ssh_access and future
paths were exposed by the catch-all proxy.

404 (not 403) is used so unlisted paths don't leak their existence, matching
the V2-disabled convention. The V2 API is served only when temporary_enable_v2
is set. Rendering tests cover the allow/deny paths, ssh_access, uploads,
V2 toggling, and rate-limit placement.
- block /v3-non-sense, allow /v3 and /v3/* only
- v2 upload paths only if v2 is enabled
- remove obsolete 403 for some internal path (is now a 404)
- add missing configuration of rate limit zones (because it is not a nested location anymore)
- some whitespace cosmetics
- adapted nginx_spec
- json response with CF-NotFound error
- render rate-limit zones comment only if needed
- more warnings

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants