More Info:
Detect impossible travel logons. Logins originating from two geographically distant IP addresses within an impossibly short timeframe are a near-certain indicator of compromised credentials.Risk Level
CriticalAddress
Compliance, SecurityCompliance Standards
- APRA CPS 234 (Australia)
- AWS Well Architected Framework
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS AWS
- CIS Critical Security Controls v8
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- Cloudanix Best Practice
- DPDPA
- Digital Operational Resilience Act (EU)
- Essential 8
- HIPAA
- ISO 27001
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIS2 Directive
- NIST CSF
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
Below are step‑by‑step console instructions to implement “impossible travel” alerting in OCI. The most robust/native way is by using Cloud Guard (which then uses Notifications for alerting). OCI Monitoring Alarms are metric‑based, so “impossible travel” (a log pattern) is normally implemented via Cloud Guard rather than a direct Monitoring metric.
Summary for most environments:
Use Cloud Guard → Activity detector recipe → “Impossible travel activity”, attach it to a target, and configure Responder rules + Notifications. That gives you a reliable “Impossible Travel Detection Alarm” using only the OCI Console.
Option 1 – Using Cloud Guard (recommended, native “impossible travel” detector)
1. Enable Cloud Guard (if not already)
- Sign in to the OCI Console.
- From the left hamburger menu, go to Security & Identity → Cloud Guard.
- If Cloud Guard is not enabled:
- Click Enable Cloud Guard.
- Choose your home region, target compartments (start with root if you need org‑wide), and configuration.
- Click Enable.
2. Ensure Audit logging is active
Cloud Guard’s “Impossible Travel” detector uses Audit logs.- Go to Identity & Security → Audit.
- Confirm Audit is enabled for the tenancy (it usually is by default).
- Ensure the compartments where identities are used are covered (root compartment covers all).
3. Configure the “Impossible Travel” detector
- Go to Security & Identity → Cloud Guard → Detector Recipes.
- Under Oracle‑Managed Detector Recipes, find something like:
- Activity Detector Recipe (or “OCI Activity Detector Recipe” – name varies slightly by region/version).
- Click the recipe name to open it.
- In the list of detectors, locate:
- Impossible travel activity (or similar; e.g., “ACTIVITY_IMPOSSIBLE_TRAVEL”).
- Click the … (Actions) next to it and choose View details to confirm behavior.
- To customize:
- Click Create Target‑Specific Recipe or Clone (depending on your UI).
- Name it (e.g.,
Custom-Activity-Detector-Recipe). - Ensure the Impossible travel activity detector is Enabled.
- Set the Risk level (e.g., High) according to your policy.
- Save the custom recipe.
4. Attach the detector recipe to your Cloud Guard target
- Go to Cloud Guard → Targets.
- If you don’t have a target yet, click Create target:
- Target type: Compartment (often root compartment).
- Attach your Custom Activity Detector Recipe.
- If you already have a target:
- Click the target.
- Under Detector Recipes, click Attach recipe (or Edit).
- Attach your custom detector recipe with Impossible travel activity enabled.
- Save the target configuration.
5. Configure alerting via Notifications
Cloud Guard findings can generate alerts through Notifications.- Go to Cloud Guard → Responder Recipes (or use the default, cloned if necessary).
-
In your chosen Responder Recipe, ensure there is a responder rule like:
- Send Notification / Notify on detector finding (name may vary).
-
If needed, create or edit a responder rule:
- Condition: match detector type or category:
- Filter by detector: Impossible travel activity or
- Filter by Risk Level (e.g., High/Critical) for all detectors, including impossible travel.
- Action: Send Notification.
- Choose or create an OCI Notifications topic.
- Condition: match detector type or category:
-
Configure the Notifications topic:
- Go to Developer Services → Notifications → Topics.
- Open the topic you selected.
- Under Subscriptions, click Create subscription.
- Choose protocol: Email, HTTPS, PagerDuty, etc.
- Enter the endpoint (e.g., security team email).
- Confirm the subscription via the email/endpoint’s confirmation mechanism.
Option 2 – Using Monitoring + Logs (only if you must use the Monitoring “Alarms” service)
This is less common, but if your policy explicitly requires an OCI Monitoring Alarm, you can:- Send Audit logs into Logging (usually automatic in new tenancies).
- Use Service Connector Hub to:
- Source: Logging (Audit log group).
- Task: Streaming or Functions that detect “impossible travel” and emit a custom metric (e.g., namespace
security_custom, metricimpossible_travel_count).
- In Monitoring → Alarms → Create alarm:
- Metric namespace: your custom namespace (e.g.,
security_custom). - Metric name:
impossible_travel_count. - Define a query: for example, trigger when
impossible_travel_count > 0in a 5–15 minute window. - Set Notification to an OCI Notifications topic and configure email/subscribers.
- Metric namespace: your custom namespace (e.g.,
- Correlate logins by user and IP,
- Geolocate IPs,
- Calculate whether sequential logins are physically impossible between timestamps, and then push a metric. In OCI this is typically done via Functions, Streaming, or Logging Analytics, so it’s more complex than using Cloud Guard’s built‑in detector.
Summary for most environments:
Use Cloud Guard → Activity detector recipe → “Impossible travel activity”, attach it to a target, and configure Responder rules + Notifications. That gives you a reliable “Impossible Travel Detection Alarm” using only the OCI Console.
Using CLI
Using CLI
Below are concise, CLI‑focused steps to get “impossible travel” detection enabled and alerting in OCI. This uses Cloud Guard (where the “IAM – Impossible Travel Activity Detected” rule lives) plus Notifications for alerts.
If not
If above returns nothing, also check:Look for a recipe with a display name similar to:
Copy the new recipe OCID as
Copy the target OCID as
Copy topic Open the confirmation email and confirm the subscription.
When an “IAM – Impossible Travel Activity Detected” problem is raised, it will match the Events rule and trigger Notifications to your configured email.
This configuration gives you impossible travel detection (Cloud Guard) and alerting (Events + Notifications), all managed via OCI CLI.
Replace all placeholder values in<>(e.g.<compartment-ocid>) with your own.
1. Prerequisites
- Install/configure OCI CLI:
- Ensure you’re using a profile with tenancy-level permissions:
MANAGE cloud-guard-familyon tenancyMANAGE ons-familyfor Notifications
2. Enable Cloud Guard at Tenancy Level
Check status:ENABLED, enable:3. Find the Oracle-Managed Detector Recipe
List Oracle-managed activity detector recipes:OCI Activity Detector Recipe- or
Oracle Managed Activity Detector Recipe
id as <managed-detector-recipe-ocid>.4. Create a Custom Detector Recipe From the Managed One
<custom-detector-recipe-ocid>.5. Enable the “IAM – Impossible Travel Activity Detected” Rule
-
List detector rules in the custom recipe:
-
Find the rule with
displayNamelike:IAM - Impossible Travel Activity Detected
id as <impossible-travel-rule-id>.-
Enable it and (optionally) set risk/threat level:
6. Create a Cloud Guard Target (Tenancy or Compartment)
Most commonly you target the entire tenancy:<cloud-guard-target-ocid>.7. Configure Notifications for Cloud Guard Problems (Alerts)
7.1 Create an OCI Notifications Topic
topic-id as <notifications-topic-ocid>.7.2 Add a Subscription (e.g., Email)
8. Route Cloud Guard Problems to Notifications (Events Rule)
Cloud Guard raises “problems” that are emitted via Events. Create an Events rule that sends all Cloud Guard problems (or only IAM ones) to the Notifications topic.-
Create an Events rule:
Notes:
- If matching on
detectorRuleNamefails (schema differences), you can initially make the rule more general and later narrow it:
- If matching on
9. (Optional) Verify via CLI
List active Cloud Guard problems:This configuration gives you impossible travel detection (Cloud Guard) and alerting (Events + Notifications), all managed via OCI CLI.
Using Python
Using Python
Below is a practical way to implement “impossible travel” detection alerting in OCI using Monitoring + Python:High-level approach:
Adjust names to what you actually see in Metrics Explorer.
If you share the exact metric namespace/metric name/dimensions you see in Metrics Explorer, I can refine the query string precisely for your tenancy.
- Use Cloud Guard to detect impossible travel as a security problem.
- Use OCI Monitoring to create an alarm on Cloud Guard problem metrics.
- Use Python (OCI SDK) to create the alarm programmatically.
1. Prerequisites
-
Cloud Guard enabled for the tenancy:
- In Console: Security → Cloud Guard → Enable (if not already).
- Set Target = Tenancy (or desired compartments).
-
Cloud Guard detector recipe for “Impossible Travel” is enabled:
- Cloud Guard → Detector Recipes.
- Look for an identity/ IAM / activity detector containing “Impossible Travel” (name can vary slightly by region/tenancy).
- Ensure it is enabled in the recipe that’s attached to your target.
-
Notifications topic (for alert delivery):
- Console → Application Integration → Notifications → Create Topic (e.g.,
cloudguard-impossible-travel-topic). - Add Email / PagerDuty / HTTPS subscription as needed.
- Get the Topic OCID.
- Console → Application Integration → Notifications → Create Topic (e.g.,
-
IAM policy for the principal running the script (user / group / dynamic group):
Adjust the subject (group name) and scope (compartment / tenancy) as needed.
-
Python OCI SDK installed and configured:
And
~/.oci/configset up with a profile (e.g.,DEFAULT).
2. Metric & Alarm Design
Cloud Guard exposes problem metrics under a security-related namespace (varies; commonlyoci_cloud_guard or similar). A common pattern:- Namespace:
oci_cloud_guard - Metric Name:
ProblemsCount(example – adjust to what exists in your tenancy) - Dimensions:
ProblemType– includes something likeIAM.ImpossibleTravelActivityorImpossibleTravel.Severity– e.g.,CRITICAL,HIGH.
- Console → Observability & Management → Metrics Explorer
- Namespace: try
oci_cloud_guard - Look for a metric like
ProblemsCount - Inspect the dimension values to find the exact
ProblemTypestring for impossible travel.
- Namespace: try
3. Python Script to Create the Alarm
Replace placeholders with your actual values.4. Validate
- In Console → Observability & Management → Alarms:
- Verify the alarm exists, is
ENABLED, and query matches your intent.
- Verify the alarm exists, is
- In Metrics Explorer:
- Run the same query to ensure metrics are present and the query is valid.
- Test:
- Temporarily lower the threshold (e.g.,
>= 0) or simulate a problem (if possible). - Confirm a notification is sent to your topic subscriber.
- Temporarily lower the threshold (e.g.,
5. Optional: Update Existing Alarm via Python
If you need to modify an existing alarm instead of creating a new one:If you share the exact metric namespace/metric name/dimensions you see in Metrics Explorer, I can refine the query string precisely for your tenancy.
Using Terraform
Using Terraform
oci_monitoring_alarm is an in‑place update and does not force replacement of other resources; applies are safe aside from normal alarm behavior (new alerts will start firing under the defined condition).For verification, terraform plan should show either:+ oci_monitoring_alarm.impossible_travel_loginsbeing created with thenamespace,metric_compartment_id, andqueryas above, or- an in‑place
~ update in-placeon an existingoci_monitoring_alarmresource where only the alarm query / namespace / destinations / text fields change to match this configuration.

