Skip to main content

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

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

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).

1. Prepare a Notification Channel (Topic + Subscription)

  1. Sign in to the OCI Console.
  2. In the left hamburger menu, go to Developer Services → Notifications.
  3. Make sure you’re in the correct Compartment (top-left compartment selector).

1.1 Create a Topic

  1. Click Create Topic.
  2. Enter:
    • Name: e.g., iam-user-changes-topic
    • Description: e.g., Notifies on IAM user create/update/delete
  3. Click Create.

1.2 Create a Subscription (e.g., Email)

  1. On the topic detail page you just created, under Subscriptions, click Create Subscription.
  2. Choose Protocol (e.g., Email).
  3. Enter your Email address (or HTTPS/Slack/other endpoint if desired).
  4. Click Create.
  5. Confirm the email:
    • Check your inbox and click the confirmation link in the OCI notification email.
    • Status in OCI will change from Pending to Active once confirmed.

2. Create an Event Rule for IAM User Changes

  1. In the OCI Console, go to Observability & Management → Events Service.
  2. Ensure you are in the same Region and desired Compartment.
  3. Click Create Rule.

2.1 Basic Rule Settings

  1. Enter:
    • Name: e.g., iam-user-changes-rule
    • Description: Triggers when IAM users are created, updated, or deleted
    • State: ensure Enabled is selected.

2.2 Define the Event Pattern (Filter)

Under Rule Conditions (Event Pattern):
  1. For Service Name, select:
    Identity
  2. For Event Type, add event types related to user changes. Common ones:
    • com.oraclecloud.identitycontrolplane.createuser
    • com.oraclecloud.identitycontrolplane.updateuser
    • com.oraclecloud.identitycontrolplane.deleteuser
    Depending on your tenancy/version, you may see them grouped as:
    • Identity - CreateUser
    • Identity - UpdateUser
    • Identity - DeleteUser
    Select all that apply to user lifecycle changes in your environment.
  3. (Optional) Use Attributes / Advanced Filtering (JSON) to:
    • Limit to a specific compartment or tenancy,
    • Or filter by certain user names or tags, if needed.
For most cases, selecting the Identity service and the three event types (create, update, delete) is enough.

3. Attach the Notification Action

  1. Under Actions, select Notifications.
  2. For Topic, choose the topic you created earlier, e.g., iam-user-changes-topic.
  3. (Optional) You can add multiple actions if you want (e.g., Notifications + Function).
  4. Click Create Rule.

4. Validate the Configuration

  1. 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.
  2. 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 Active state.

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).
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):
  • You have oci CLI 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)

Ensure your CLI profile has the correct region or set:

2. Create a Notifications topic for IAM user change alerts

Capture the Topic OCID from the response:

3. Create a subscription (e.g., email)

Confirm the email and set the subscription to “CONFIRMED”.

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:
  1. Create the rule (disabled by default):
Note: If compartmentId filtering causes issues, remove the "data" block and just filter on eventType.
  1. 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.
If you need to trigger a Function instead (for custom logic):

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.).
If you share your tenancy/compartment layout or specific constraints (e.g., use Functions, Slack, PagerDuty), I can refine the exact CLI JSON filters and actions.
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

  1. Install / upgrade SDK:
  2. Have an OCI config file (usually ~/.oci/config) with a profile, e.g.:
  3. You need permissions in the target compartment to:
    • Manage/Use ons-topics and ons-subscriptions
    • Manage events-rules

2. Define What You’re Alerting On

For IAM user changes, typical OCI event types are:
  • com.oraclecloud.identitycontrolplane.createuser
  • com.oraclecloud.identitycontrolplane.updateuser
  • com.oraclecloud.identitycontrolplane.deleteuser
Event rule condition (over Identity service / all user changes):

3. Python Script: Create Topic, Subscription, and Event Rule

This script will:
  1. Create a Notifications topic.
  2. Create an email subscription on that topic.
  3. 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.
If you instead need alerts to appear in Monitoring specifically (as alarms on custom metrics), the pattern becomes:
  1. Events Rule → 2. OCI Function → 3. Function writes custom metric via Monitoring API → 4. Monitoring Alarm on that metric.
I can provide that extended flow with code if you want to push IAM changes into Monitoring custom metrics instead of (or in addition to) email notifications.
This change does not force replacement of other resources; Terraform will create or update this 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.