hyperlane-xyz / hyperlane-monorepo

The home for Hyperlane core contracts, sdk packages, and other infrastructure
https://hyperlane.xyz
Other
295 stars 315 forks source link

Implement geolocation-based restrictions for web apps #1868

Closed jmrossy closed 2 months ago

jmrossy commented 1 year ago

Use Vercel's IP Geolocation service to restrict web app access for certain countries.

Comply with OFAC Comprehensively Sanctioned Countries List: Cuba, Iran, North Korea, Russia (and the following regions of Ukraine: Crimea, Donetsk and Luhansk), Syria

Comply with UK: Afghanistan, Belarus, Bosnia & Herzegovina, Central African Republic, Democratic Republic of the Congo, Guinea, Republic of Guinea-Bissau, Haiti, Iraq, Lebanon, Libya, Mali, Nicaragua, Somalia, South Sudan, Sudan, Venezuela, Yemen, Zimbabwe

Comply with FATF: Myanmar

Relevant resources:

https://vercel.com/docs/concepts/edge-network/headers#request-headers?utm_source=geo-ip-demo&utm_campaign=geo-ip-demo

https://github.com/vercel/examples/tree/main/edge-middleware/geolocation-country-block

https://edge-functions-geolocation.vercel.sh/

AlexBHarley commented 3 months ago

Summarising approaches here,

Cloudflare

Vercel middleware