Regional Compliance with Geofences and ISP Guardrails
Control access to regulated services (payments, health data, adtech) so that only traffic from approved regions and residential ISPs is allowed, while keeping location and network telemetry for analytics.
Scenario
- Product must serve only users inside approved countries/regions (e.g., EU + UK) for data residency.
- VPN/proxy egress from cloud providers should be rejected even if geolocated inside the region.
- Analytics needs city/country context to monitor adoption by market.
Controllers Used
maxmind-geoip— resolves client location for both auth and analytics.maxmind-asn— detects ISP/ASN to reject cloud or hosting exits.geofence-match(eu-uk-geo) — GeoJSON polygons for allowed regions.asn-match(residential-isp) — allowlist of consumer ISPs; block hosting ASNs by omission.
Policy
Allow only when inside the geofence and coming from an allowed ASN:
yaml
authorizationPolicy: "eu-uk-geo && residential-isp"1
Example Configuration
yaml
analysisControllers:
- name: geoip
type: maxmind-geoip
settings:
databasePath: config/GeoLite2-City.mmdb
- name: asn
type: maxmind-asn
settings:
databasePath: config/GeoLite2-ASN.mmdb
matchControllers:
- name: eu-uk-geo
type: geofence-match
settings:
featuresFile: config/eu-uk.geojson
- name: residential-isp
type: asn-match
settings:
asnList: config/residential-isp-allowlist.txt1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Request Flow
geoipadds headers (X-GeoIP-Country,X-GeoIP-City,X-GeoIP-Latitude,X-GeoIP-Longitude).asnaddsX-ASN-Number/X-ASN-Organizationso dashboards can separate consumer vs hosting traffic.geofence-matchvalidates the coordinates fall inside the approved polygons.asn-matchensures traffic is from residential ISPs, not cloud/VPN exits.
Value Delivered
- Satisfies data residency and licensing constraints.
- Reduces fraud by excluding cloud exit nodes even when geolocated correctly.
- Analytics can segment adoption by city/country while retaining privacy (no PII stored).
Operations Tips
- Version GeoJSON in Git; validate with
envoy-authz validate-geojsonbefore deploys. - Refresh MaxMind databases weekly.