Skip to content

Wire administrative token network policy and sanitize ingress headers - #720

Draft
vlast3k wants to merge 1 commit into
cloudfoundry:developfrom
vlast3k:admin-token-network-policy
Draft

vlast3k wants to merge 1 commit into
cloudfoundry:developfrom
vlast3k:admin-token-network-policy

Conversation

@vlast3k

@vlast3k vlast3k commented Nov 21, 2026 •

Copy link
Copy Markdown

Summary

Wire the administrative bearer-token network policy into the Cloud Controller BOSH job and establish
the Nginx source-address contract needed for enforcement over the Puma Unix socket.

  • Add cc.admin_token_network_policy.{enabled,allowed_cidrs,trusted_proxies,additional_protected_scopes}.
    Default disabled, empty lists, and no implicitly trusted proxies.
  • Render application configuration under admin_token_network_policy.
  • Overwrite canonical X-Real-IP and remove legacy X-Real_IP so caller headers cannot collide
    with the asserted source address when Rack normalizes names.
  • Supply those source headers and appended X-Forwarded-For on public upload forwarding too;
    retain existing public/internal API forwarding behavior.

Only explicitly trusted ingress peers may assert forwarded addresses. Enabled-empty allowlists deny
protected tokens. Ordinary tokens and default-disabled policy retain existing application behavior.

Validation

  • Configuration and Nginx rendering suites: 115 examples passed, including every public proxy location's
    source-header sanitization and internal ingress defaults.
  • git diff --check passes.
  • No application pin or live deployment was changed.

Coordinated changes and gate

Draft: requires a supporting Cloud Controller version. Configuration alone does not protect old
binaries. The application policy depends on these Nginx fixes; merge/release/rollout must be coordinated.
Actual Nginx/Puma forged-header tests, public/internal/upload paths, socket permissions, and the full
Cloud Controller application harness remain validation gates.

Operators must set matching UAA/CAPI allowlists and protected additions and inventory actual proxy/NAT
addresses. No production CIDRs or implicit broad private-network trust are introduced.

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.

1 participant