1. Resources
  2. Detection rules
  3. IAM Policy Created or Changed in OCI

IAM Policy Created or Changed in OCI detection rules

An attacker who can manage policies adds or rewrites a policy statement so that a group or dynamic group they control gains manage rights, up to every resource in the tenancy.

Platform
Oracle Cloud Infrastructure
Severity
High
Log source
Oracle Cloud Infrastructure Audit
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
Control of a principal that may manage policies in the tenancy or in a compartment, such as a member of Administrators or a delegated policy administrator.
Impact
The subject named in the new statement receives the granted rights, up to full control of the tenancy, and keeps them after the original foothold is removed.
Response
Restore the last approved statements of the policy or delete the policy if it is new, then contain the subject that gained the rights and the caller that made the change.
Mitigation
Give manage policies in the tenancy only to the Administrators group and, if needed, one named policy administration group, and keep policies in infrastructure as code.
Event types
com.oraclecloud.identityControlPlane.CreatePolicycom.oraclecloud.identityControlPlane.UpdatePolicycom.oraclecloud.identityControlPlane.DeletePolicy

How the attack works

In Oracle Cloud Infrastructure all authorization comes from policy statements of the form Allow <subject> to <verb> <resource-type> in <location>. Whoever may manage policies can create, update and delete them, and updating is as strong as creating because an update can overwrite every statement. A policy attached to the root compartment can grant rights in the whole tenancy, including manage all-resources in tenancy, which is what the built-in Tenant Admin Policy gives the Administrators group. The same right writes cross-tenancy Admit statements that let a group from another tenancy in, and deletes policies, including deny statements used as guardrails.

IAM records these operations in the Audit log with the event types com.oraclecloud.identityControlPlane.CreatePolicy, UpdatePolicy and DeletePolicy. data.resourceName is the policy name, data.compartmentName the compartment the policy is attached to and data.identity.principalName the caller. Oracle's reference event for policies carries no statement text, so the rule cannot tell a harmless edit from a tenancy-wide grant: read the policy after the alert.

Collection: Audit is always on, but a SIEM sees the events only when they are shipped. Oracle documents a service connector with source Logging (log group _Audit of the root compartment, subcompartments included) and target Streaming, which the SIEM reads. IAM resources are changed in the home region, so collect that region first. Records that leave OCI Logging name the event type type instead of eventType; the conversions below account for that.

What an attacker needs

  • Control of a principal that may manage policies in the tenancy or in a compartment: a member of Administrators, a group with manage all-resources, or a delegated policy administrator.
  • For a tenancy-wide grant, the right must cover the root compartment. A policy attached to a child compartment can only grant access inside that compartment.

Impact

The subject named in the new statement receives the granted rights as soon as the policy takes effect. With manage all-resources in tenancy that is full control of the tenancy for a group, a dynamic group of compute instances or a group in another tenancy, and it stays in place after the original foothold is removed.

Detection rules

OCI IAM Policy Created, Updated or Deleted

Detects CreatePolicy, UpdatePolicy and DeletePolicy operations of the OCI IAM control plane. The Audit event does not carry the policy statements: read the policy named in data.resourceName to see what was granted, and check data.compartmentName for changes in the root compartment.

LevelMediumStatusExperimentalLog sourceOracle Cloud Infrastructure Audit
title: OCI IAM Policy Created, Updated or Deleted
id: 9d0cc51e-b735-4d41-91a5-d6f8082b6f74
status: experimental
description: >-
  Detects CreatePolicy, UpdatePolicy and DeletePolicy operations of the OCI
  IAM control plane. The Audit event does not carry the policy statements:
  read the policy named in data.resourceName to see what was granted, and
  check data.compartmentName for changes in the root compartment.
references:
  - https://docs.oracle.com/en-us/iaas/Content/Events/Reference/eventsproducers.htm
  - https://docs.oracle.com/en-us/iaas/Content/Identity/policyreference/iampolicyreference.htm
  - https://attack.mitre.org/techniques/T1098/003/
author: Forestall
date: 2026-11-11
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098.003
logsource:
  product: oci
  service: audit
detection:
  selection:
    eventType:
      - com.oraclecloud.identityControlPlane.CreatePolicy
      - com.oraclecloud.identityControlPlane.UpdatePolicy
      - com.oraclecloud.identityControlPlane.DeletePolicy
  condition: selection
falsepositives:
  - Policy changes deployed by infrastructure-as-code pipelines or the identity team. Allow-list those callers by data.identity.principalName and alert on every other identity.
  - Service onboarding in the Console, which can create policies on the administrator's behalf.
level: medium

False positives

  • Policy changes deployed by infrastructure-as-code pipelines or the identity team. Allow-list those callers by data.identity.principalName and alert on every other identity.
  • Service onboarding in the Console, which can create policies on the administrator's behalf.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

Policy changed by a caller that then runs operations it has not run before

Detection hypothesisSequence of eventsNeeds a baseline

The Audit event of a policy change carries no statement text, so the event alone cannot show a self-grant. What the caller does next can. A principal that changes a policy and then, within a short time, starts write operations it has not performed in the previous month has most likely given itself, or a group it belongs to, the right to perform them.

  1. The Audit log records com.oraclecloud.identityControlPlane.CreatePolicy or UpdatePolicy. Keep the caller in data.identity.principalId and data.identity.principalName, and the compartment of the policy in data.compartmentName.
  2. Within 60 minutes, collect the events whose data.identity.principalId is that caller and whose data.request.action (the HTTP method) is not GET, the operations that change something.
  3. Keep the data.eventName values (the API operation) that the same principal did not produce in the 30 days before the policy change. These are the operations the new statements may have opened.
  4. Read the changed policy and check whether its statements name a group or dynamic group the caller belongs to, and whether the new operations fall under them.

EventsCreatePolicyUpdatePolicy

LimitsAn administrator who writes a policy for a new project and then builds that project produces the same pattern, and so does a pipeline that deploys policies and resources together. A grant to a group the caller does not use, or to a group in another tenancy, is not seen. The 60 minutes and 30 days are starting points.

Policy created and deleted, or updated twice, by the same caller within a few hours

Detection hypothesisSequence of eventsCompares with an earlier value

A temporary grant leaves the policy as it was. An attacker who adds a statement, uses it and then deletes the policy or restores the old text with a second update hides the change from a review of the current policies. Two changes to the same policy by the same caller within a few hours, with a creation followed by a deletion as the clearest form, are that pattern.

  1. The Audit log records com.oraclecloud.identityControlPlane.CreatePolicy or UpdatePolicy. Keep the policy name in data.resourceName, its OCID in data.resourceId, the compartment in data.compartmentName and the caller in data.identity.principalName.
  2. Within 4 hours the same caller deletes the same policy (DeletePolicy with the same data.resourceId) or updates it again (UpdatePolicy).
  3. List what the caller, and the groups the policy names, did between the two events, and compare the policy text before the first change with the text after the second in your policy history or repository.

EventsCreatePolicyUpdatePolicyDeletePolicy

LimitsCorrecting a mistake right after a change, and pipelines that delete and recreate policies on every run, produce the same pairs, so exclude the deployment identities. The events carry no statement text, so whether the second change restored the first text has to come from your own copy of the policies. The 4 hours are a starting point.

Triage

  • Read the policy named in data.resourceName (for example with oci iam policy get) and compare its statements with the last approved version. Look for manage all-resources, manage policies, manage users, manage groups, any-user, any-group, dynamic groups and Admit statements.
  • Check data.compartmentName. A change in the root compartment (it carries the tenancy name) can affect every compartment.
  • Identify the caller in data.identity.principalName and data.identity.ipAddress, and confirm a change record with that person or pipeline.
  • For a deletion, check whether the policy held deny statements or the access of a security tool.
  • If not approved, restore the previous statements and review what the granted subject did since the event time.

Response

Once the attack is confirmed:

  1. Restore the last approved statements of the policy, or delete the policy if it is new, and remove any Admit statement that lets a group from another tenancy in.
  2. Create deleted policies again, starting with deny statements and with the policies that give security tools their access.
  3. Contain the subject that gained the rights. Remove unexpected members from the group, restore the matching rule of the dynamic group, and reset the credentials of the accounts involved.
  4. Contain the caller, and check whether the same identity changed other policies, groups or dynamic groups.
  5. Review what the subject did between the change and the restore, and undo it, with priority on new users, credentials, policies and resources.
  6. Compare the policies of the root compartment with your repository and confirm that nothing else differs.

Mitigation

  • Give manage policies in the tenancy only to the Administrators group and, if needed, one named policy administration group. Limit delegated groups with a condition such as request.permission='POLICY_CREATE' so they cannot update or delete existing policies.
  • Attach policies to the compartment they govern, so that compartment administrators cannot touch tenancy-level statements.
  • Keep policies in infrastructure as code and compare the deployed statements with the repository on a schedule.
  • Enable the Cloud Guard rules "Security policy modified", "Policy gives too many privileges" and "Tenancy admin privilege granted to group", and the notification that the CIS OCI Foundations Benchmark asks for on IAM policy changes.

Frequently asked questions

Does the Audit event show which statement was added or removed?

No. Oracle's reference event for policies carries no statement text. The event gives the policy name in `data.resourceName`, the compartment in `data.compartmentName` and the caller in `data.identity.principalName`. The rule therefore cannot tell a harmless edit from a tenancy-wide grant, and the policy has to be read after every alert.

Why is a deleted policy treated as a possible attack?

Policies do not only grant access. Whoever may manage policies can also delete them, including deny statements used as guardrails and the policy that gives a security tool its access. A deletion can therefore widen what others may do or blind a control, which is why the rule includes `DeletePolicy`.

Why does my SIEM show the event type in a field named type?

Records that leave OCI Logging name the event type `type` instead of `eventType`. The conversions on this page account for that. If you write your own query against events collected through a service connector, search the field your pipeline delivers.

Is a policy change in a child compartment as serious as one in the root compartment?

Its reach is smaller. A policy attached to a child compartment can only grant access inside that compartment, while a policy attached to the root compartment can grant rights in the whole tenancy. Check `data.compartmentName`, where the root compartment carries the tenancy name.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.