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
MediumAddress
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
- 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
Remediation
Using Console
Using Console
In OCI, “user change” alerts are best implemented with Events + Notifications, not a Monitoring metric alarm. From the console, do this:
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.”
1. Create a Notification Topic
- Sign in to the OCI Console.
- Open the navigation menu → Developer Services → Notifications.
- Click Topics → Create Topic.
- 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.
- Name: e.g.,
- Click Create.
Add Subscription(s)
- In the topic details page, click Create Subscription.
- Choose Protocol (e.g.,
Email). - Enter Endpoint (e.g., your SOC email address).
- Click Create.
- Go to your email and confirm the subscription (required for email).
2. Create an Event Rule for User Changes
- In the Console, open the navigation menu → Observability & Management → Events Service → Rules.
- Click Create Rule.
-
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.
- Rule Name: e.g.,
-
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.createusercom.oraclecloud.identitycontrolplane.updateusercom.oraclecloud.identitycontrolplane.deleteuser
- Add each relevant event type to the rule.
-
Under Actions, click + Add Action:
- Action Type: Notifications
- Topic: select the topic you created earlier (e.g.,
user-change-alerts-topic).
- Click Create Rule.
3. (Optional) Test the Alert
- Temporarily create a test user in Identity & Security → Domains / Users.
- 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.”
Using CLI
Using CLI
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:
You can refine with eventType filter if you need:
Adjust:This creates and enables the alarm.
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)
2. Create an alarm using OCI CLI
- Prepare a JSON file with alarm details, e.g.
user_change_alarm.json:
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.
- Run the CLI command:
3. Verify the alarm
- List alarms:
- Get details:
- Optionally, test by generating a user-change operation (e.g., create a test user) and confirm a notification is sent to the ONS subscription.
Using Python
Using Python
Below is a practical way to meet the “user change alert” requirement in OCI using Python:
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 However, because Events model names can differ slightly between SDK versions, it is usually easier and more robust to:Then in
If you want, I can provide a fully copy–paste–ready script for a specific SDK version (e.g.
- Use OCI Events to catch IAM user change events
- Route them to Notifications (ONS) for alerting (email / Slack / etc.)
1. Prerequisites
- Python 3.x
ociSDK installed:
-
A valid OCI config file (e.g.
~/.oci/config) with:- tenancy
- user
- fingerprint
- key_file
- region
-
OCID of the compartment where you want the Events rule and topic:
- Example:
ocid1.compartment.oc1..xxxxxx
- Example:
2. Decide what “User Change” means
For basic coverage, alert on these Identity events:com.oraclecloud.identitycontrolplane.createusercom.oraclecloud.identitycontrolplane.updateusercom.oraclecloud.identitycontrolplane.deleteuser- (Optionally)
com.oraclecloud.identitycontrolplane.changeuserstate
3. Python script: create Notification Topic + Subscription + Event Rule
This script will:- Create a Notifications topic (if not existing).
- Create an email subscription on that topic.
- Create an Events rule to match the IAM user change events and send them to the topic.
get_or_create_event_rule and its usage with:- Generate the rule via OCI Console with “User Change” events going to a topic.
- Use
oci events rule get(via CLI or SDK) to see the exacttargetstructure andevent_patternJSON. - Copy that JSON into your Python
CreateRuleDetailscall.
create_rule):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.Using Terraform
Using Terraform

