> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/zen-firewall/zen-features/blocking-traffic-by-country-with-zen-firewall.md).

# Blocking Traffic by Country with Zen Firewall

Zen Firewall by Aikido helps you control access to your application based on geographic location. This feature enhances your security measures by providing precise control over which countries can access your application.

> **Important**: Country blocking operates independently of the global "[Blocking/Detection Mode](/zen-firewall/zen-features/blocking-vs-detection-mode-in-zen-firewall.md)" setting. When you enable country blocks, they will always be enforced, even if Zen is in Detection Mode.

## Use Cases <a href="#use-cases" id="use-cases"></a>

* 🛡️ **Comply with Regulations**: Restrict access from countries based on compliance requirements
* 💰 **Reduce Fraud**: Block traffic from high-risk regions known for malicious activities
* 🔒 **Data Protection**: Limit access to specific geographic regions for data sovereignty
* ⚡ **Focus Resources**: Optimize performance by serving only your target markets

## How to monitor or block country traffic <a href="#how-to-block-country-traffic" id="how-to-block-country-traffic"></a>

Select a specific app and continue to the **Firewall** tab. Click the "**Manage Countries**" next to "**Block Traffic by Countries**" to configure Country blocking.

![Firewall settings interface for blocking attacks, bots, Tor traffic, threat IPs, and countries.](https://3149773201-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-1e1837b35b09fd7b13286f246176b074acae7cce%2FScreenshot%202025-10-30%20at%2012.03.07.png?alt=media)

You can either **select the countries to allow**, or **select the ones to block** using the blocking mode. Use the **Countries** dropdown to select the lists you want to enable and click on "**Save Changes**".

![Interface for selecting and blocking IPs from specific countries.](https://3149773201-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-40c26d005ad7f3a177486065490f2c778293da38%2FScreenshot%202025-08-13%20at%2017.26.42.png?alt=media)

{% hint style="info" %}
Note that country blocking is not immediate; it takes up to a minute for the block to take effect.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.aikido.dev/zen-firewall/zen-features/blocking-traffic-by-country-with-zen-firewall.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
