Classify each forwarded-for entry as public or private, never the entry #44
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/xff-scope-classification"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
47 unanimous
xff_entries=2over 24 hours answered the count and left the classification open. Nothing distinguishes a spoofable public first entry from a private one our own fabric appended, and that single distinction settles four constants at once: this server'strusted_proxy_hops, webmail's depth 2, Synapse'sx_forwarded: true, and Mastodon's absence. Three of those record nothing and cannot be checked after the fact.The line gains one field:
One token per entry, in order, and never an address. An address in a log is the thing the rule against logging them exists to keep out, so the classification is the whole payload.
An entry that does not parse is
unparseablerather than assumed either way, because a port-bearing or obfuscated entry counted as public would manufacture the finding this exists to test.Ipv4Addr::is_globalandIpv6Addr::is_unique_localare unstable, so the v6 cases are the prefix tests they would perform:fc00::/7andfe80::/10.The order test was green and pinned nothing
Seven tests. Three mutations, and the third earned its keep.
It asserted only that the two orders differ, which survives reversing the chain because that reverses both sides. It pinned that the function is not set-valued while its name claimed it pinned order. Both sides are now named exactly,
public,privateandprivate,public, and it goes red under that reversal.Had I stopped at the
BTreeSetmutation, which reddened four tests and looked like ample proof, the weak test would have shipped under a name asserting a property no test held.Scope
No edge configuration is touched, which is what makes this a measurement rather than a decision. If entry two comes back public, choosing a hop count is Clark's gate, not mine.
oddie-apps/infrastructure#65labels theexternalTrafficPolicy: Clusterexplanation a candidate rather than the answer, and it should stay labelled that way until this line lands and reports.cargo clippy --all-targets -- -D warningsclean, 148 + 9 tests green.