rproxy should augment requests to the backend with ip info #379

Closed
opened 2026-11-13 19:44:34 +01:00 by sneak · 1 comment
Owner

at the very least, asn and country code. what else is easy and available?

at the very least, asn and country code. what else is easy and available?
Collaborator

PR: #382 (branch issue-379-lookup-headers-by-default).

The app could already get the AS number and country in X-Client-ASN and X-Client-Country, but only with SWW_WAF_ADD_LOOKUP_HEADERS=true. The PR makes true the default. The cost: with the default lookup source, GeoJS, a new client's first request waits for GeoJS's answer, up to 800 ms. Later requests from that client do not wait.

What else is easy and available:

  • Already looked up, nothing new to fetch:
    • the AS name, such as Hetzner Online GmbH, which both GeoJS and the IPinfo file give;
    • the tags waf gave the request, such as torexit, abuseipdb or a DNS blocklist's tag;
    • the client address waf settled on, which today the app must work out from X-Forwarded-For itself.
  • One more field read per answer:
    • both sources give the country name and the continent;
    • only GeoJS gives city, region, time zone and latitude and longitude, so these would be missing with the IPinfo file.

Question: add any of these as headers to the app?

  • AS name only (recommended): one more header, X-Client-AS-Name. Both sources have it, and it is already kept with each answer. The catch: some AS names hold non-ASCII letters, which a header cannot carry as they are.
  • AS name, tags and client address: three headers, all from what waf already knows.
  • None: AS number and country only, as the PR does.

Model: opus-5-5

PR: https://git.eeqj.de/sneak/smallwebwaf/pulls/382 (branch `issue-379-lookup-headers-by-default`). The app could already get the AS number and country in `X-Client-ASN` and `X-Client-Country`, but only with `SWW_WAF_ADD_LOOKUP_HEADERS=true`. The PR makes `true` the default. The cost: with the default lookup source, GeoJS, a new client's first request waits for GeoJS's answer, up to 800 ms. Later requests from that client do not wait. **What else is easy and available:** - **Already looked up, nothing new to fetch:** - the AS name, such as `Hetzner Online GmbH`, which both GeoJS and the IPinfo file give; - the tags `waf` gave the request, such as `torexit`, `abuseipdb` or a DNS blocklist's tag; - the client address `waf` settled on, which today the app must work out from `X-Forwarded-For` itself. - **One more field read per answer:** - both sources give the country name and the continent; - only GeoJS gives city, region, time zone and latitude and longitude, so these would be missing with the IPinfo file. **Question:** add any of these as headers to the app? - **AS name only** (recommended): one more header, `X-Client-AS-Name`. Both sources have it, and it is already kept with each answer. The catch: some AS names hold non-ASCII letters, which a header cannot carry as they are. - **AS name, tags and client address**: three headers, all from what `waf` already knows. - **None**: AS number and country only, as the PR does. Model: opus-5-5
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/smallwebwaf#379