Skip to main content

More Info:

Alerts must be configured for IamUserChange events. Creating unexpected users or modifying user capabilities is a common tactic for establishing persistence in a compromised environment.

Risk Level

Medium

Address

Compliance, Security

Compliance 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
  • HITRUST CSF
  • 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
  • PCI
  • SOC2
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Using Console

In OCI, “user change” alerts are best implemented with Events + Notifications, not a Monitoring metric alarm. From the console, do this:

1. Create a Notification Topic

  1. Sign in to the OCI Console.
  2. Open the navigation menu → Developer ServicesNotifications.
  3. Click TopicsCreate Topic.
  4. Enter:
    • Name: e.g., user-change-alerts-topic
    • Description: e.g., Alerts for IAM user create/update/delete
    • Compartment: choose the compartment where you manage security ops.
  5. Click Create.

Add Subscription(s)

  1. In the topic details page, click Create Subscription.
  2. Choose Protocol (e.g., Email).
  3. Enter Endpoint (e.g., your SOC email address).
  4. Click Create.
  5. Go to your email and confirm the subscription (required for email).

2. Create an Event Rule for User Changes

  1. In the Console, open the navigation menu → Observability & ManagementEvents ServiceRules.
  2. Click Create Rule.
  3. Fill in:
    • Rule Name: e.g., user-change-events-rule
    • Description: Trigger notification when IAM users are created, updated, or deleted
    • Compartment: usually the root / tenancy-level compartment for IAM events.
    • State: Enabled.
  4. Under Rule Conditions, select:
    • Condition type: Event Type
    • Event Type: filter by Identity events related to users, for example (names may vary slightly by region/console version; pick all that match IAM user lifecycle):
      • com.oraclecloud.identitycontrolplane.createuser
      • com.oraclecloud.identitycontrolplane.updateuser
      • com.oraclecloud.identitycontrolplane.deleteuser
    • Add each relevant event type to the rule.
  5. Under Actions, click + Add Action:
    • Action Type: Notifications
    • Topic: select the topic you created earlier (e.g., user-change-alerts-topic).
  6. Click Create Rule.

3. (Optional) Test the Alert

  1. Temporarily create a test user in Identity & Security → Domains / Users.
  2. Confirm that:
    • The event rule is triggered.
    • A message is sent to your notification topic.
    • Your email (or other endpoint) receives the alert.

This configuration gives you real-time alerts for IAM user changes using OCI’s native alerting stack (Events + Notifications), which is what most security/compliance tools refer to when they say “OCI Monitoring/Alerting for user changes.”
Below is a practical pattern you can adapt to create an OCI Monitoring alarm (via OCI CLI) that triggers when an IAM user is changed (created/updated/deleted), assuming you already have a metric exposed for user-change events (e.g., via Audit → Service Connector → Custom Metrics, or a vendor tool that emits such metrics).If you do not yet have a metric for user-change events, set that up first (Audit → Service Connector → Monitoring / custom metrics). Then:

1. Decide your metric & query

Assume:
  • Compartment OCID where the metric exists: ocid1.compartment.oc1..aaaa...
  • Monitoring compartment OCID (often the same): ocid1.compartment.oc1..aaaa...
  • Metric namespace: custom_audit
  • Metric name: user_change_events
  • Dimensions:
    • eventType (e.g., CreateUser, UpdateUser, DeleteUser)
    • identityType (e.g., user)
Example query: trigger if any user-change event occurs:
You can refine with eventType filter if you need:

2. Create an alarm using OCI CLI

  1. Prepare a JSON file with alarm details, e.g. user_change_alarm.json:
Adjust:
  • compartmentId – where the alarm resource will reside.
  • metricCompartmentId – where your metric actually lives.
  • namespace, query – match your custom metric.
  • destinations – ONS topic OCID you want to notify.
  1. Run the CLI command:
This creates and enables the alarm.

3. Verify the alarm

  1. List alarms:
  1. Get details:
  1. Optionally, test by generating a user-change operation (e.g., create a test user) and confirm a notification is sent to the ONS subscription.
Below is a practical way to meet the “user change alert” requirement in OCI using Python:
  • Use OCI Events to catch IAM user change events
  • Route them to Notifications (ONS) for alerting (email / Slack / etc.)
Most security/compliance tools call this “Monitoring alarm”, but on OCI the correct primitives for IAM changes are Events + Notifications (there is no native IAM metric in Monitoring).

1. Prerequisites

  1. Python 3.x
  2. oci SDK installed:
  1. A valid OCI config file (e.g. ~/.oci/config) with:
    • tenancy
    • user
    • fingerprint
    • key_file
    • region
  2. OCID of the compartment where you want the Events rule and topic:
    • Example: ocid1.compartment.oc1..xxxxxx

2. Decide what “User Change” means

For basic coverage, alert on these Identity events:
  • com.oraclecloud.identitycontrolplane.createuser
  • com.oraclecloud.identitycontrolplane.updateuser
  • com.oraclecloud.identitycontrolplane.deleteuser
  • (Optionally) com.oraclecloud.identitycontrolplane.changeuserstate
Event type pattern (you can add/remove types as needed):

3. Python script: create Notification Topic + Subscription + Event Rule

This script will:
  1. Create a Notifications topic (if not existing).
  2. Create an email subscription on that topic.
  3. Create an Events rule to match the IAM user change events and send them to the topic.
The above shows structure and approach, but Events target models are a bit verbose, so here is the full, working implementation of the rule creation using the current OCI SDK structure.Replace the get_or_create_event_rule and its usage with:
However, because Events model names can differ slightly between SDK versions, it is usually easier and more robust to:
  1. Generate the rule via OCI Console with “User Change” events going to a topic.
  2. Use oci events rule get (via CLI or SDK) to see the exact target structure and event_pattern JSON.
  3. Copy that JSON into your Python CreateRuleDetails call.
Example “minimal” JSON for the rule using raw dicts (works with create_rule):
Then in main():

4. What this gives you

  • Any IAM user create/update/delete/change-state in your tenancy or chosen compartment will trigger an Event.
  • The Event Rule matches those events and sends them to the Notifications topic.
  • The Subscription (email, Slack, etc.) receives an alert.

If you want, I can provide a fully copy–paste–ready script for a specific SDK version (e.g. oci==2.125.0) with exact class names for the Events target.