transport/internet/splithttp: per-request path randomization (pathPool)#6282
Closed
belotserkovtsev wants to merge 1 commit into
Closed
transport/internet/splithttp: per-request path randomization (pathPool)#6282belotserkovtsev wants to merge 1 commit into
belotserkovtsev wants to merge 1 commit into
Conversation
## What Adds an optional `pathPool` to xhttp settings. When session and seq are carried off the path (cookie/header/query), each request appends a random entry from the pool to the base path. A `*` in an entry is replaced with a random number, so a short list can cover id/cursor style paths. Empty by default, so nothing changes unless you set it. ## Why With session and seq off the path (cookies, say), every xhttp request still hits the same path. A stream of requests to one fixed path is easy for a CDN or WAF to match on. This pairs with custom session IDs (XTLS#6258): XTLS#6258 hides the session id value, `pathPool` spreads requests across ordinary-looking paths so there's no single path to key on. It also avoids stuffing junk query params, which just trades one signature for another. There's no built-in pool, on purpose. A fixed list baked into the binary would become a shared signature, so the operator supplies paths that match whatever traffic they want to blend into. ## Example ```json "xhttpSettings": { "mode": "packet-up", "path": "/api/v1", "extra": { "sessionPlacement": "cookie", "sessionKey": "sid", "seqPlacement": "cookie", "seqKey": "sq", "pathPool": ["timeline", "sync", "items/*", "users/*/feed", "search/suggest"] } } ``` Requests then look like: ``` GET /api/v1/items/48213 GET /api/v1/users/9921/feed GET /api/v1/timeline ``` instead of every request hitting `/api/v1/`. ## Notes - Client side only. The server already accepts anything after the configured path prefix (`strings.HasPrefix`) and reads session/seq from their placement, so it works against an unmodified server. No protocol change. - Active only when session and seq are both off the path. With path placement the pool is ignored. - Test added.
Member
|
我们倾向于已经发生了什么而不是根据推测继续加功能 不然总是可以找到乱七八糟的点来加固它 config会被各种配置淹没 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Adds an optional
pathPoolto xhttp settings. When session and seq are carriedoff the path (cookie/header/query), each request appends a random entry from the
pool to the base path. A
*in an entry is replaced with a random number, so ashort list can cover id/cursor style paths. Empty by default, so nothing changes
unless you set it.
Why
With session and seq off the path (cookies, say), every xhttp request still hits
the same path. A stream of requests to one fixed path is easy for a CDN or WAF to
match on. This pairs with custom session IDs (#6258): #6258 hides the session id
value,
pathPoolspreads requests across ordinary-looking paths so there's nosingle path to key on. It also avoids stuffing junk query params, which just
trades one signature for another.
There's no built-in pool, on purpose. A fixed list baked into the binary would
become a shared signature, so the operator supplies paths that match whatever
traffic they want to blend into.
Example
Requests then look like:
instead of every request hitting
/api/v1/.Notes
prefix (
strings.HasPrefix) and reads session/seq from their placement, so itworks against an unmodified server. No protocol change.
pool is ignored.