We want to apply different rules to different classes of traffic.
At the very least, we'll have:
- HAProxy
- General rules for non-trusted traffic
- Rules for known clients
- Moat-mode rules
- Varnish
- General rules for non-trusted traffic (both cache hit and misses)
- Rules for known clients (both cache hit and misses)
- Rules for known clients
- Moat-mode rules
The easiest way to do this is to use the same strategy we've used for cache hits and misses:
- Create a dsl object for each group of objects. We need to figure out how many will be dc-dependent
- Add tags to haproxy/varnish actions, but not in the conftool sense of tags, but rather "where should this rule be applied", and we might have cases where we want to have more than a single tag.
Current status (2025-07-16):
- We've deployed 3 configuration changes introducing a new header: X-Trusted-Request, which conveys the trust level of a request on a scale from A (highest) to F (lowest):
- This header replaces the previous allowlist mechanism based on wikimedia_trust / wikimedia_nets.
- Requests marked with trust level A now bypass requestctl rules in both HAProxy and Varnish, and are exempt from bandwidth limits and silent-drop behavior.