Description

Ensure IP Geolocation is turned on for the zone, so that Cloudflare adds the CF-IPCountry header, containing the visitor's country code, to every request sent to your origin. Your application and logs can then use the visitor's country for security decisions and analysis.

Rationale

Knowing the country of each request helps detect unusual login locations, apply country-based rules in the application, and investigate attacks. Without the CF-IPCountry header, the origin sees only Cloudflare's IP addresses and has no reliable way to know where visitors come from.

Impact

  • The origin receives the visitor's country in the CF-IPCountry header

  • Supports country-based security logic and logging

  • Geolocation is an estimate and should not be the only signal for strict controls

Default Value

IP Geolocation may be turned off for a zone. Cloudflare recommends the Add visitor location headers Managed Transform for more location detail.

Pre-Requisites

  • Cloudflare account with Administrator permissions for the zone

Test Plan

  1. Sign in to the Cloudflare dashboard at https://dash.cloudflare.com.

  2. Select your account and the domain (zone) you want to review.

  3. Go to Network.

  4. Verify that IP Geolocation is turned on.

  5. If it is off, follow the implementation steps.

Implementation Steps

  1. Sign in to the Cloudflare dashboard at https://dash.cloudflare.com.

  2. Select your account and the domain (zone) you want to review.

  3. Go to Network.

  4. For IP Geolocation, switch the toggle to On.

Backout Plan

  1. Sign in to the Cloudflare dashboard at https://dash.cloudflare.com.

  2. Select your account and the domain (zone) you want to review.

  3. Go to Network.

  4. For IP Geolocation, switch the toggle to Off.

Reference