More Info:
Ensure Event Rules capture IAM User modifications. Tracking user lifecycle events ensures rogue accounts created by threat actors are instantly flagged and disabled.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
Below are the exact steps in the OCI Console to set up alerting for IAM user changes using Events + Notifications (which is what OCI “monitoring” for these changes relies on).
This completes remediation: OCI Events now detects IAM user changes and uses Notifications to alert you (which is the standard “Monitoring/Alerting” pattern for IAM changes in OCI).
1. Prepare a Notification Channel (Topic + Subscription)
- Sign in to the OCI Console.
- In the left hamburger menu, go to Developer Services → Notifications.
- Make sure you’re in the correct Compartment (top-left compartment selector).
1.1 Create a Topic
- Click Create Topic.
- Enter:
- Name: e.g.,
iam-user-changes-topic - Description: e.g.,
Notifies on IAM user create/update/delete
- Name: e.g.,
- Click Create.
1.2 Create a Subscription (e.g., Email)
- On the topic detail page you just created, under Subscriptions, click Create Subscription.
- Choose Protocol (e.g.,
Email). - Enter your Email address (or HTTPS/Slack/other endpoint if desired).
- Click Create.
- Confirm the email:
- Check your inbox and click the confirmation link in the OCI notification email.
- Status in OCI will change from
PendingtoActiveonce confirmed.
2. Create an Event Rule for IAM User Changes
- In the OCI Console, go to Observability & Management → Events Service.
- Ensure you are in the same Region and desired Compartment.
- Click Create Rule.
2.1 Basic Rule Settings
- Enter:
- Name: e.g.,
iam-user-changes-rule - Description:
Triggers when IAM users are created, updated, or deleted - State: ensure Enabled is selected.
- Name: e.g.,
2.2 Define the Event Pattern (Filter)
Under Rule Conditions (Event Pattern):-
For Service Name, select:
Identity -
For Event Type, add event types related to user changes. Common ones:
com.oraclecloud.identitycontrolplane.createusercom.oraclecloud.identitycontrolplane.updateusercom.oraclecloud.identitycontrolplane.deleteuser
Identity - CreateUserIdentity - UpdateUserIdentity - DeleteUser
-
(Optional) Use Attributes / Advanced Filtering (JSON) to:
- Limit to a specific compartment or tenancy,
- Or filter by certain user names or tags, if needed.
3. Attach the Notification Action
- Under Actions, select Notifications.
-
For Topic, choose the topic you created earlier, e.g.,
iam-user-changes-topic. - (Optional) You can add multiple actions if you want (e.g., Notifications + Function).
- Click Create Rule.
4. Validate the Configuration
- Perform a test IAM user change, e.g.:
- Create a test user, or
- Update an existing user (e.g., change description), or
- Delete a test user.
- Wait a few minutes and verify:
- The email (or other subscription) receives a notification.
- If not, confirm:
- The rule is Enabled.
- The correct event types are selected.
- Your subscription is in
Activestate.
This completes remediation: OCI Events now detects IAM user changes and uses Notifications to alert you (which is the standard “Monitoring/Alerting” pattern for IAM changes in OCI).
Using CLI
Using CLI
Below are concise, CLI‑focused steps to ensure OCI Monitoring/Alerting is configured via an Event Rule that triggers on IAM User changes.Assumptions (adjust as needed):
Ensure your CLI profile has the correct region or set:
Capture the Topic OCID from the response:
Confirm the email and set the subscription to “CONFIRMED”.
You can filter by these event types. Example rule:Note: If
- You have
ociCLI configured. - You know your Tenancy OCID, Compartment OCID, and Region.
- You want alerts via OCI Notifications (email) and/or to trigger other actions.
1. Set environment variables (for convenience)
2. Create a Notifications topic for IAM user change alerts
3. Create a subscription (e.g., email)
4. Add IAM policy so Events can publish to Notifications
In the root compartment (tenancy level), create a policy (if not already present):5. Create an Events rule for IAM user changes
Identity events for users typically include:com.oraclecloud.identitycontrolplane.createuser, updateuser, deleteuser, etc.You can filter by these event types. Example rule:
- Create the rule (disabled by default):
compartmentId filtering causes issues, remove the "data" block and just filter on eventType.- Enable the rule:
6. (Optional) Integrate with Monitoring alarms
If you prefer to route to Monitoring via Notifications/alarm actions:- Use Monitoring alarms for metrics.
- For IAM user changes (an event, not a metric), the canonical pattern is: Events → Notifications → email/Function/etc.
7. Validate
- Make a test IAM user change (create/update/delete) via Console/CLI.
- Confirm:
- An Event is generated (Console → Observability & Management → Events).
- Notification is received (email, etc.).
Using Python
Using Python
Below is a minimal, step‑by‑step way to create an OCI Event Rule for IAM user changes and wire it to alerting via Notifications, implemented using Python + OCI SDK.
1. Prerequisites
-
Install / upgrade SDK:
-
Have an OCI config file (usually
~/.oci/config) with a profile, e.g.: -
You need permissions in the target compartment to:
- Manage/Use
ons-topicsandons-subscriptions - Manage
events-rules
- Manage/Use
2. Define What You’re Alerting On
For IAM user changes, typical OCI event types are:com.oraclecloud.identitycontrolplane.createusercom.oraclecloud.identitycontrolplane.updateusercom.oraclecloud.identitycontrolplane.deleteuser
3. Python Script: Create Topic, Subscription, and Event Rule
This script will:- Create a Notifications topic.
- Create an email subscription on that topic.
- Create an Event Rule that matches IAM user change events and sends them to the topic.
4. What This Gives You
- When any IAM user is created, updated, or deleted, OCI Events will:
- Match the rule condition.
- Send an event to the Notifications topic.
- Notifications will immediately send an email alert to
ALERT_EMAIL.
- Events Rule → 2. OCI Function → 3. Function writes custom metric via Monitoring API → 4. Monitoring Alarm on that metric.
Using Terraform
Using Terraform
oci_events_rule in place.Verification: terraform plan should show one oci_events_rule.iam_user_changes to be created (or updated) with is_enabled = true, the condition JSON including the three createuser/updateuser/deleteuser event types, and an ONS action pointing at your Notifications topic.
