More Info:
Alerts should fire on IamGroupChange. Monitoring group modifications helps prevent privilege escalation via unauthorized additions of users to highly privileged admin groups.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 console instructions to configure an alarm/alert for IAM Group changes in OCI. The correct way in OCI is to use Events + Notifications (this is what most benchmarks refer to when they say “group change alarm”).
If you specifically need a Monitoring → Alarms object (for a policy requirement), you’d typically:
1. Create a Notifications Topic
- In the OCI Console, open the Navigation menu.
- Go to Developer Services → Application Integration → Notifications.
- Make sure you are in the correct compartment.
- Click Create Topic.
- Give it a name like
iam-group-change-alerts, add description if needed. - Click Create.
Add a Subscription (e.g., Email / Slack / PagerDuty)
- Open the topic you just created.
- Under Subscriptions, click Create Subscription.
- Choose Protocol (e.g.,
Email). - Enter the endpoint (e.g., your email address).
- Click Create.
- Confirm the subscription (for email, click the link in the confirmation mail).
2. Create an Event Rule for IAM Group Changes
- In the OCI Console, open the Navigation menu.
- Go to Observability & Management → Events Service → Rules.
- Ensure you’re in the right compartment.
- Click Create Rule.
Basic details
- Name: e.g.,
iam-group-change-rule. - Description: “Alert on create/update/delete group and user-group membership changes”.
- Rule Status: Enabled.
Condition: Match IAM Group Change Events
Under Rule Conditions, select:-
Event Type:
- Click Event Type, then select:
com.oraclecloud.identitycontrolplane.creategroupcom.oraclecloud.identitycontrolplane.updategroupcom.oraclecloud.identitycontrolplane.deletegroupcom.oraclecloud.identitycontrolplane.addusertogroupcom.oraclecloud.identitycontrolplane.removeuserfromgroup
- Click Event Type, then select:
3. Set the Rule Target to Notifications (Alerting)
- In the Actions / Rule Target section:
- Choose Notifications as the target type.
- Select the topic you created earlier, e.g.,
iam-group-change-alerts.
- Click Create Rule.
If you specifically need a Monitoring → Alarms object (for a policy requirement), you’d typically:
- Export IAM group‑change events to a custom metric (via Service Connector from Audit to Monitoring), then
- Create a Monitoring Alarm on that custom metric.
Using CLI
Using CLI
Below is a practical way to satisfy “Monitoring should have group change alarm configured” using the OCI Monitoring service and OCI CLI. It creates an alarm on Audit metrics detecting IAM group changes and notifies via Notifications.Assumptions:
Note the
Check your email and confirm the subscription.
We will alarm when the count > 0 in a short interval.
Key points:
Show details:Then perform a test IAM group change (e.g., create/delete a group or add/remove user) and confirm you receive the notification.
- You have OCI CLI installed and configured.
- You know your:
--compartment-idfor IAM and Monitoring--tenancy-idif needed- An email (or other endpoint) to notify.
1. Create a Notifications Topic
id from the output (this is the topic OCID): ocid1.onstopic...2. Create a Subscription (e.g., Email)
3. Craft the Alarm Metric Query
We will use theoci_audit metrics to detect IAM group changes (create/update/delete, add/remove user). Example metric query:4. Create the Alarm via OCI CLI
--metric-compartment-idis typically the root (tenancy) or IAM compartment where Audit metrics are collected (often your root compartment).--pending-duration "0m"sends immediately when a group change occurs.- Adjust
resolutionand event list as needed.
5. Verify the Alarm
List alarms:Using Python
Using Python
Below is one way to remediate this using OCI Monitoring + Python:Goal
Have an alarm that fires whenever an IAM Group is created/updated/deleted (i.e., “group change”) using OCI Monitoring.
You can add dimensions if you wish, e.g.:
If you share your existing metric namespace/name (if you already have a Service Connector or custom metric), I can adjust the exact Python query and alarm parameters to match your environment.
Have an alarm that fires whenever an IAM Group is created/updated/deleted (i.e., “group change”) using OCI Monitoring.
1. Overall Architecture
- Audit logs already record IAM group changes.
- Logging collects Audit logs into a log group.
- Service Connector turns matching Audit log events (group changes) into a custom metric.
- Monitoring Alarm (created via Python) watches that metric and alerts when it’s > 0.
2. Prerequisites
- Python 3 and
ociSDK installed:
- Valid OCI config at
~/.oci/configwith a profile (e.g.,DEFAULT), including:- tenancy, user, fingerprint, key_file, region
- OCIDs:
- compartment OCID where you want the alarm
- notification topic OCID (from OCI Notifications) for alarm actions
3. One‑time Setup (Console / API)
3.1 Ensure Audit Logs → Logging
- Go to Audit in OCI console (it’s enabled by default).
- Go to Logging → Log Groups, create a log group in a security/ops compartment.
- Inside that log group, Enable an Audit log (or confirm one exists).
3.2 Service Connector: Audit → Custom Metric
The idea: filter Audit logs for IAM group changes, transform them into a metric such as:- Namespace:
security_iam - Metric Name:
group_change_count - Dimensions: e.g.
eventName,compartmentId
- Go to Service Connector Hub → Create service connector.
- Source: Logging (select your Audit log).
- Condition / Filter (examples, varies by region/console version):
- Filter on
data.eventTypeIN:com.oraclecloud.identitycontrolplane.creategroupcom.oraclecloud.identitycontrolplane.updategroupcom.oraclecloud.identitycontrolplane.deletegroup
- Filter on
- Target: Monitoring.
- In the metric mapping, specify:
- Namespace:
security_iam - Metric:
group_change_count - Value:
1 - Dimensions: e.g.
{"eventName": data.eventType}
- Namespace:
- Save/enable service connector.
security_iam.group_change_count in Monitoring → Metrics.4. Create the Group Change Alarm with Python
This script creates an alarm that fires when any group change metric datapoint is > 0 in the last 5 minutes.4.1 Metric Query Example
Alarm query syntax (Monitoring “MQL” style):4.2 Python Code
5. Validate
- Make a test group change (create or delete a group).
- Wait a few minutes:
- Check Monitoring → Metrics, select:
- Namespace:
security_iam - Metric:
group_change_count
- Namespace:
- Confirm datapoints appear.
- Check Monitoring → Metrics, select:
- Check Monitoring → Alarms:
- The alarm should move to FIRING for that interval.
- Confirm Notifications (email, Slack, etc.) are received from the topic.
If you share your existing metric namespace/name (if you already have a Service Connector or custom metric), I can adjust the exact Python query and alarm parameters to match your environment.
Using Terraform
Using Terraform
oci_monitoring_alarm in Terraform because Monitoring only supports metric-based alarms; IAM group changes are event-based. Use an OCI Events rule (Terraform oci_events_rule) targeting your notification channel, or configure it directly in the Console. Running terraform plan against oci_monitoring_alarm will not show any valid arguments related to IamGroupChange.
