Skip to main content

More Info:

Identity Provider (IdP) modifications must be strictly monitored. Attackers may attempt to add rogue identity providers to create backdoor access into the OCI tenancy.

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 this is done with Events + Notifications, not a metric alarm in Monitoring. Here’s how to set up an alert for Identity Provider (IdP) changes using the OCI Console:

1. Verify Audit Is Enabled (usually on by default)

  1. In the Console, open the navigation menu.
  2. Go to Governance & Administration → Audit.
  3. Select the tenancy (root compartment) and confirm that audit is enabled (it is enabled by default and cannot be disabled, just verify logs are present).

2. Create a Notifications Topic

  1. Go to Developer Services → Application Integration → Notifications.
  2. Click Topics → Create Topic.
  3. Enter a name (e.g., idp-change-alerts) and choose the compartment.
  4. Click Create.

Add a Subscription (email or other)

  1. Open the topic you just created.
  2. Click Create Subscription.
  3. Choose Protocol (e.g., Email).
  4. Enter your email address (or other endpoint).
  5. Click Create.
  6. Check your email and confirm the subscription.

3. Create an Event Rule for Identity Provider Changes

  1. Go to Observability & Management → Events Service.
  2. Click Rules → Create Rule.
Rule Details:
  • Name: IdP-Change-Events
  • Description: Alert when Identity Provider is created, updated, or deleted
  • Compartment: choose the root or relevant compartment (IAM events are tenancy-scoped; root is typical).
Condition / Event Pattern:Use a condition that matches Identity service actions on identity providers, e.g.:
  • Service: identity
  • Event Type / Action: include:
    • CreateIdentityProvider
    • UpdateIdentityProvider
    • DeleteIdentityProvider
In the console UI:
  1. Under Rule Conditions, choose Event Type (or Service and Event Type, depending on UI version).
  2. Select Service = identity.
  3. Add event types corresponding to IdP management operations (search for IdentityProvider and select create/update/delete variations).
If you see the JSON editor, you can use a pattern like:
(Exact event types may be listed in the dropdown; select them from there for accuracy.)

4. Attach the Notifications Action

Still in the Create Rule dialog:
  1. Under Actions, click Add Action.
  2. Action Type: Notifications.
  3. Topic: select the topic you created (idp-change-alerts).
  4. Click Create to save the rule.

5. (Optional) Test the Alert

  1. Make a non-production change to an Identity Provider (e.g., update description) or create a test IdP.
  2. Within a short time, you should receive an email notification (or chosen protocol) with the event details.

With this, any Identity Provider creation, update, or deletion will trigger the Events rule, send to Notifications, and deliver an alert—covering the “Identity Provider change alarm” requirement using OCI’s alerting/monitoring tooling.
Below are the minimal step‑by‑step OCI CLI instructions to set up an alarm (alert) for Identity Provider changes using Events + Notifications (this is how OCI surfaces these types of configuration-change alerts; Monitoring alarms are metric-based).You will:
  1. Create a Notifications topic
  2. Create a subscription (e.g., email)
  3. Add a policy so Events can publish to that topic
  4. Create an Events rule for Identity Provider changes pointing to that topic

0. Prerequisites

  • OCI CLI configured (oci setup config)
  • Tenancy OCID and compartment OCID ready
  • Appropriate IAM permissions to create topics, subscriptions, policies, and events rules
Use placeholders like:
  • <tenancy-ocid>
  • <compartment-ocid>
  • <region-identifier> (e.g., us-ashburn-1)
  • <email-address>
  • <topic-name>, <rule-name>

1. Create a Notifications topic

Capture the topic OCID from the output: ocid1.onstopic.oc1... (call it <topic-ocid>).

2. Create a subscription (email example)

Open the email you get and confirm the subscription.

3. Add IAM policy so Events can publish to the topic

Create a policy in the root compartment (tenancy level) or a compartment that matches where you created the topic.Example policy text (in root compartment):
Using CLI, first create a policy JSON file, e.g. policy.json:
Then create the policy:
(You can skip the JSON file and use --statements as shown.)

4. Define the Events rule condition for Identity Provider changes

Identity Provider events are in the Identity service. Typical event types:
  • com.oraclecloud.identitycontrolplane.createidentityprovider
  • com.oraclecloud.identitycontrolplane.updateidentityprovider
  • com.oraclecloud.identitycontrolplane.deleteidentityprovider
Create a JSON file idp-change-condition.json like:
Or, more general (any Identity Provider event):

5. Create the Events rule that targets the Notifications topic

This rule will fire whenever an Identity Provider is created, updated, or deleted in the specified compartment and send a message to your Notifications topic, which then sends email (or other protocol) alerts.

6. (Optional) Verify rule and test

  • List rules:
  • Trigger a test (e.g., update an Identity Provider description) and confirm an email is received.

If you specifically need this in a different region/compartment layout or want a different notification channel (Slack, PagerDuty, HTTPS, etc.), indicate which and I can adjust the exact CLI commands.
Below is a concise, end‑to‑end way to set up an OCI Monitoring alarm (via Python) that fires whenever an Identity Provider is created, updated, or deleted, using the Audit metrics.

1. Prerequisites

  1. You have:
    • oci Python SDK installed:
    • An OCI config file (~/.oci/config) with a profile that can:
      • Read/write Monitoring
      • Read Audit metrics
      • Manage Notifications topics and subscriptions (if you’re sending emails, etc.)
    • A Notification Topic OCID (or you can create one via SDK/Console).
  2. Note/collect:
    • compartment_id where you want the alarm.
    • notification_topic_id (OCID of the Notifications topic).

2. Metric & Query For Identity Provider Changes

Audit events are exposed as metrics in namespace oci_audit. We’ll create an alarm using Monitoring Query Language (MQL):
  • This means: in a 1‑minute window, if any of those events happen, trigger the alarm.

3. Python Code To Create The Alarm


4. Optional: Verify / Update The Alarm

List alarms in the compartment:
Update (e.g., enable/disable):

5. Test

  1. Perform a test Identity Provider operation (e.g., create a dummy IdP in the console).
  2. Wait for a minute or two.
  3. Confirm:
    • Alarm changes to “FIRING” in Monitoring → Alarms.
    • Notification is delivered via your configured topic (email, PagerDuty, etc.).
That’s all you need to remediate the “OCI Monitoring Should Have Identity Provider Change Alarm Configured” requirement using Python.
Substitute:
  • OCI_COMPARTMENT_OCID with the OCID of the compartment where you want the alarm resource.
  • AUDIT_COMPARTMENT_OCID with the compartment whose audit events should be monitored (often the root/tenancy OCID).
  • ONS_TOPIC_OCID with the OCID of your notification topic used for security alerts.
This change is in-place for an existing oci_monitoring_alarm (it updates the query and related settings but does not force replacement).After updating Terraform, terraform plan should show:
  • An update in-place on the existing oci_monitoring_alarm (or create if it did not exist) with the new namespace and query and any updated destinations/body.