# Source: https://docs.datadoghq.com/security/default_rules/def-000-h71.md

---
title: User activity detected from outside authorized countries
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > OOTB Rules > User activity detected from outside
  authorized countries
---

# User activity detected from outside authorized countries
 
### Goal{% #goal %}

Detect user activity from a country that isn't part of an allowlist.

This may be caused by a malicious actor using a compromised account, or a user violating policy.

### Strategy{% #strategy %}

Review IPs from traces [tagged with a user](https://docs.datadoghq.com/security/application_security/threats/add-user-info/?tab=set_user#adding-authenticated-user-information-to-traces-and-enabling-user-blocking-capability). If the country linked to this IP isn't part of the allowlist, trigger the signal.

To update the allowlist with your authorized countries, clone and update the rule. This rule shouldn't be enabled at the same time as the denylist variant.

Require the trace to be flagged, either by [a user event](https://docs.datadoghq.com/security/application_security/threats/add-user-info/?tab=set_user#adding-user-events-login-success-login-failure-any-business-logic-to-traces) or by an In-App WAF attack.

A `Medium` signal is generated if any trace is found.

### Triage and response{% #triage-and-response %}

1. Investigate the IP activity and validate that it is legitimate.
1. If the account was compromised, reset the password and log out the attacker.
1. Consider blocking the account until situation is remediated/user is back in an authorized country.