Skip to content

Restrict administrative token issuance and use by source network - #4174

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
Contributor

Summary

Add an operator-controlled, deployment-wide source-network policy for administrative token issuance,
refresh, and use, preserving ordinary tokens and default behavior when disabled.

  • Protect uaa.admin, cloud_controller.admin, cloud_controller.admin_read_only,
    cloud_controller.global_auditor, and zones.<id>.admin; optional exact additions extend this set.
  • Inspect resolved scopes, client-only authorities, retained refresh capabilities, and final claims.
  • Check validated bearer authentication before success/context publication on every resource chain.
  • Check validated JWT assertions and exchange subjects even when output scopes are ordinary;
    ordinary clients can still introspect administrative subject tokens.
  • Fail startup on invalid CIDRs; enabled with an empty allowlist denies protected tokens.
  • Use the current container-normalized remote address, never caller-provided forwarding headers.
  • Document configuration, denial behavior, proxy trust, and coordinated rollout; add REST Docs examples.

Configuration prefix: uaa.admin_token_network_policy with enabled, allowed_cidrs, and
additional_protected_scopes. Identity-zone/client configuration cannot weaken the deployment policy.

Validation

  • 136 focused server tests passed (policy, bearer filter, chain wiring, assertion/exchange authentication).
  • 76 token-service tests passed, including narrowed client scopes, retained administrative refresh
    scopes, and final enhancer overrides.
  • Full generateDocs succeeded: 126 docs tests and rendered Slate HTML.
  • Changed Markdown passes lint; git diff --check is clean.

Draft pending security/CI review, database/grant/zone integration coverage, and real-ingress forged-header
tests. No live deployment was changed. Operators must configure actual trusted proxies and NAT/VPN
egress; documentation addresses are not defaults. External transforming proxies/custom authentication
managers must preserve equivalent checks on original credentials.

Coordinated changes

UAA alone cannot enforce use at offline JWT resource servers. Companion draft PRs:

This is a network allowlist, not cryptographic binding to the original issuance IP or a complete
delegation/escalation boundary. Other resource servers need independent enforcement.

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

Projects

Development

Successfully merging this pull request may close these issues.

1 participant