More Info:
Monitor IamPolicyChange events. Unauthorized modifications to IAM policies can silently elevate privileges, allowing attackers to establish persistence or exfiltrate data.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 step‑by‑step instructions to configure a policy‑change alert in OCI using the Console, leveraging Events + Notifications (email/SNS), which is the standard way to get alerted on configuration changes like IAM policy updates.
If the console offers dropdowns instead of raw JSON:
Adjust depending on what the Events UI accepts.
This configuration ensures that any IAM policy creation, update, or deletion in OCI will trigger a notification, satisfying the requirement that “Monitoring should have policy change alarm configured,” using OCI’s native Events + Notifications via the Console.
1. Prerequisites
- You must have permissions to manage:
events-rulesin the target compartmentons-topicsandons-subscriptions(Notifications)
- Audit is on by default in OCI; no extra action needed for that.
2. Create a Notification Topic (for email/other alerts)
- In the OCI Console, open the Navigation menu.
- Go to Developer Services → Notifications (or Application Integration → Notifications, depending on UI version).
- Make sure you’re in the correct compartment.
- Click Create Topic.
- Name: e.g.
policy-change-alerts-topic - Description:
Alerts for IAM policy changes
- Name: e.g.
- Click Create.
Add an Email Subscription
- In the same topic page, click on the topic you just created.
- Under Subscriptions, click Create Subscription.
- Choose Protocol =
Email. - Enter the email address to receive the alerts.
- Click Create.
- Go to your email inbox and confirm the subscription via the confirmation link.
3. Create an Event Rule for Policy Changes
You’ll now create an Events rule that listens for IAM policy change events and forwards them to the Notifications topic.- In the OCI Console, open Navigation menu → Observability & Management → Events Service (or Events).
- Ensure you’re in the desired compartment.
- Click Create Rule.
- Name:
policy-change-events-rule - Description:
Trigger notifications when IAM policies are created, updated, or deleted. - Rule Status: Ensure it is Enabled.
- Condition (Rule Type): Select Event Type or Service Connector–style condition depending on the UI; you want an event pattern that matches IAM policy changes.
3.1. Define the Event Pattern for Policy Changes
Use the JSON editor (or the UI equivalent) to match IAM policy changes. Example event pattern:- Service Name:
Identity(or “Identity and Access Management” / “iam”) - Event Types: select the ones matching:
CreatePolicyUpdatePolicyDeletePolicy
3.2. Set the Action to Your Notification Topic
Still in the rule creation:- Under Actions, choose Notifications.
-
Select the Topic you created earlier:
policy-change-alerts-topic. - (Optional) Add multiple actions if you want messages to multiple topics or Functions.
- Click Create Rule.
4. (Optional) Test the Policy Change Alert
- In the OCI Console, go to Identity & Security → Policies.
- In a test compartment or tenancy (be careful in production), do one of:
- Create a temporary test policy.
- Edit (update) an existing test policy.
- Delete a test policy (if appropriate).
- Wait a few minutes.
- Check the email (or other channel) subscribed to the notification topic for an alert.
5. (Optional) Refine or Scope the Rule
To reduce noise, you can further refine the event pattern to specific compartments or policies by using conditions on attributes like:data.resourceNamedata.compartmentIddata.additionalDetails.compartmentName
This configuration ensures that any IAM policy creation, update, or deletion in OCI will trigger a notification, satisfying the requirement that “Monitoring should have policy change alarm configured,” using OCI’s native Events + Notifications via the Console.
Using CLI
Using CLI
Below is a CLI-based way to configure an OCI Monitoring alarm that fires on IAM policy changes (create/update/delete) using the Audit metrics.Assumptions:
Note the returned
Confirm the subscription from the email if required.
We’ll alarm when any policy is created/updated/deleted.Example query:You can also constrain by compartment if desired with
Key options:
Get details:
If you share your specific compartment layout (root vs subcompartments) I can refine the exact
- You already have
ociCLI configured. - You know your
COMPARTMENT_OCID(typically your root compartment for IAM policies). - You have permission to create Notifications resources and Alarms.
1. Create a Notifications Topic
"id" as TOPIC_OCID.2. (Optional) Add a Subscription to the Topic
Example: email subscription.3. Build the Alarm Query for Policy Changes
Audit metrics namespace isoci_audit.We’ll alarm when any policy is created/updated/deleted.Example query:
compartmentId.4. Create the Alarm via CLI
--metric-compartment-idis where the Audit metrics are emitted (often the same root compartment).--pending-duration= how long the condition must be true before firing.--resolution= evaluation interval.
5. Verify the Alarm
List alarms:If you share your specific compartment layout (root vs subcompartments) I can refine the exact
query and compartment filters.Using Python
Using Python
In OCI, “policy change alerts” are usually implemented with Events + Notifications, not with a classic Monitoring metric alarm, because IAM policy changes are emitted as events, not metrics. You can still treat this as “alerting/monitoring,” but you wire it through:
After running this:
Now, any Create/Update/Delete of an IAM Policy in that compartment will trigger:
If you don’t already have such a metric, you can rely solely on the Events rule (step 3) for policy-change alerting, which is the standard remediation.
- Events – detect IAM policy changes
- Notifications – send email/Slack/HTTPS, etc.
- (Optional) Monitoring Alarm – only if you have a custom metric for policy changes
1. Prerequisites
- Python 3 +
ociSDK installed: - A configured OCI CLI profile (e.g.
DEFAULT) at~/.oci/configwith:- tenancy OCID
- user OCID
- region
- API key
- The compartment OCID where you want to create the Events rule and topic.
2. Create a Notifications Topic + Subscription (email) via Python
- Confirm the subscription from the confirmation email.
3. Create an Events Rule for IAM Policy Changes via Python
OCI emits specific event types for IAM policy operations, e.g.:com.oraclecloud.identitycontrolplane.CreatePolicycom.oraclecloud.identitycontrolplane.UpdatePolicycom.oraclecloud.identitycontrolplane.DeletePolicy
- Events rule → Notifications topic → email to you.
4. (Optional) Create a Monitoring Alarm on a Custom “PolicyChange” Metric
If you already push a custom metric (e.g.policy_changes_count) to OCI Monitoring (via Logging or custom code), you can add a classic Monitoring alarm:Using Terraform
Using Terraform
query, namespace, or severity on an existing oci_monitoring_alarm updates the alarm in place and does not force replacement; terraform plan should show an in-place update (~ update in-place) to the existing alarm, or a + create for a new one if it does not yet exist.
