-
Notifications
You must be signed in to change notification settings - Fork 0
feat(gateway): trust forwarded client IPs only from trusted proxies #165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
seonghobae
wants to merge
10
commits into
main
Choose a base branch
from
work/gap-83-trusted-proxy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6e2e5ee
feat(gateway): trust forwarded client IPs only from trusted proxies
codex 3e75535
refactor(gateway): bootstrap trusted proxy policy
codex ae26fe5
test(gateway): reproduce mapped IPv6 trusted CIDR prefix
seonghobae c6c4819
test(gateway): keep mapped CIDR configuration fail closed
seonghobae 3415b74
docs(security): add peer-reviewed proxy trust evidence
seonghobae 77717ac
fix(gateway): canonicalize mapped trusted-proxy CIDRs
codex 29373ab
test(gateway): reject out-of-range trusted-proxy prefixes
seonghobae 4b96f4e
fix(gateway): restore fail-closed trusted-proxy CIDR grammar
seonghobae 95b9f3d
Merge remote-tracking branch 'origin/main' into work/gap-83-trusted-p…
codex 99581e0
docs: raise trusted-proxy doc coverage
codex File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
docs/papers/trusted-proxy-client-ip-attribution-sources.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Trusted proxy client IP attribution sources | ||
|
|
||
| This note records the standards, operational guidance, and peer-reviewed | ||
| security evidence that ground Wardnet's trusted-proxy client IP attribution | ||
| behavior. The implementation anchors trust in the direct transport peer and | ||
| considers forwarded metadata only when that peer belongs to an explicitly | ||
| configured trusted range. | ||
|
|
||
| ## Evidence synthesis | ||
|
|
||
| RFC 7239 defines forwarding metadata as information added by intermediaries; it | ||
| is not self-authenticating client truth. NGINX documents the trusted-proxy rule | ||
| explicitly and resolves recursive address chains to the last non-trusted hop. | ||
| Envoy documents the same right-to-left trust model for `X-Forwarded-For` with | ||
| trusted CIDR lists. | ||
|
|
||
| Pletinckx, Kruegel, and Vigna's NDSS 2025 Internet-scale measurement provides | ||
| independent empirical security evidence for the same boundary. Their study | ||
| shows that backends accepting proxy-supplied source identity from arbitrary | ||
| network sources can permit access-control bypass and other security failures. | ||
| For Wardnet, that supports direct-peer verification before forwarded metadata | ||
| can affect rate limiting, DNSBL decisions, or event attribution. The paper does | ||
| not prescribe Wardnet's exact HTTP malformed-chain algorithm; Wardnet's choice | ||
| to reject an incomplete or unparsable `X-Forwarded-For` chain and fall back to | ||
| the direct peer is a conservative fail-closed policy derived from the broader | ||
| untrusted-metadata threat. | ||
|
|
||
| ## References | ||
|
|
||
| - Nottingham, M. (Ed.), & Kamp, P. H. (Ed.). (2014). *Forwarded HTTP | ||
| extension* (RFC 7239). Internet Engineering Task Force. | ||
| https://datatracker.ietf.org/doc/html/rfc7239 | ||
| - NGINX, Inc. (n.d.). *Module ngx_http_realip_module*. | ||
| https://nginx.org/en/docs/http/ngx_http_realip_module.html | ||
| - Envoy contributors. (n.d.). *HTTP header manipulation*. | ||
| https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_conn_man/headers | ||
| - Pletinckx, S., Kruegel, C., & Vigna, G. (2025). A large-scale measurement | ||
| study of the PROXY protocol and its security implications. *Network and | ||
| Distributed System Security Symposium 2025*. | ||
| https://doi.org/10.14722/ndss.2025.242247 | ||
| Open-access paper: https://www.ndss-symposium.org/wp-content/uploads/2025-2247-paper.pdf | ||
|
|
||
| ## Redistribution note | ||
|
|
||
| The IETF, NGINX, Envoy, and NDSS source locations are linked directly so the | ||
| repository preserves authoritative origin and version context. The NDSS paper | ||
| is openly readable from the symposium site, but this repository does not vendor | ||
| a copy until redistribution terms for storing a derivative repository copy are | ||
| explicitly verified. Linkability and free access are not treated as permission | ||
| to redistribute a binary artifact. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.