[ Web Proxy ]
URL:
Viewing: https://developers.cloudflare.com/waf/custom-rules/use-cases/block-by-geographical-location/ [Back]  [Original]

Block traffic by geographical location Cloudflare Web Application Firewall (WAF) docsSkip to content
SearchCtrlKLog in
  1. Home
  2. /WAF
  3. /
  4. /Common use cases
  5. /Block traffic by geographical location

Block traffic by geographical location

Last updated May 5, 2026Copy as MarkdownView as MarkdownAgent setup
OverviewOther resources

This example custom rule blocks requests by autonomous system number (ASN), continent, or country of origin.

  • When incoming requests match:

    Field Operator Value Logic
    AS Num equals 131279 Or
    Continent equals Asia Or
    Country equals Korea, North

    If you are using the expression editor:
    (ip.src.asnum eq 131279) or (ip.src.continent eq "AS") or (ip.src.country eq "KP")

  • Then take action: Block

Other resources

PreviousBlock requests by attack scoreNextBlock traffic from specific countries

Was this helpful?

YesNo
Edit pageReport issue
[]

Web Proxy Viewer  |  New URL  |  Original Page