More Info:
Only administrator groups should have manage all-resources privileges. Policies granting any-user the ability to manage all resources violate least-privilege and create uncontrolled access.Risk Level
MediumAddress
Compliance, SecurityCompliance Standards
- APRA CPS 234 (Australia)
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS Critical Security Controls v8
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- Cloudanix Best Practice
- DPDPA
- Digital Operational Resilience Act (EU)
- Essential 8
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIS2 Directive
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- 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 concise, console‑based steps to remediate the “OCI IAM Only Administrators Should Manage All Resources” problem and monitor it in OCI.
1. Identify Who Currently Has Broad (“Manage All-Resources”) Access
- Sign in to the OCI Console.
- Open the Navigation Menu → Identity & Security → Identity & Access Management (IAM) → Policies.
- For each compartment (especially root compartment):
- Select the compartment in the left filter.
- Review each policy for statements containing:
manage all-resources in tenancymanage all-resources in compartment <name>
- List all groups in those statements that have
manage all-resources(e.g.Group DevOps).
Administrators) to have this level.2. Define / Verify the Administrator Group
- In the Console, go to: Identity & Security → Identity & Access Management (IAM) → Groups.
- Ensure you have a single, clearly named group for full admins, e.g.
Administrators.- If not, click Create Group, name it
Administrators, and add a description such as “Full tenancy administrators”.
- If not, click Create Group, name it
3. Restrict “Manage All Resources” to Administrators Only
3.1. Update Existing Policies
For each policy that grantsmanage all-resources:- Open IAM → Policies.
- Click the policy name.
- Click Edit Policy Statements.
- Find statements like:
- Change them to something more restrictive, for example:
- For full admins only:
- For non-admins, grant least privilege, e.g. only required services:
- For full admins only:
- Save the updated policy.
3.2. Ensure Only Administrators Have Full-Tenancy Admin Rights
- Still under Policies, verify that:
- The only policy with
manage all-resources in tenancyreferences theAdministratorsgroup (or equivalent). - No other group is given
manage all-resources in tenancyor widemanage all-resources in root compartment.
- The only policy with
4. Clean Up User Membership
- Go to Identity & Security → IAM → Users.
- For each user:
- Open the user → Groups tab.
- Confirm only true admins are members of
Administrators. - Remove non‑admins from any group that has broad (
manage all-resources) privileges:- Click Remove next to the group membership.
5. Enable / Verify IAM Monitoring (Audit + Cloud Guard)
5.1. Ensure Audit is Enabled
Audit is on by default but verify:- Go to Identity & Security → Audit.
- Confirm you can see events for compartments (no extra steps usually needed).
5.2. Enable Cloud Guard (If Not Already)
- Go to Identity & Security → Cloud Guard.
- If not enabled:
- Click Enable Cloud Guard.
- Choose:
- Target: typically the tenancy for full coverage.
- Detector Recipe: use the Oracle-Managed default, then customize as needed.
- Save.
6. Configure Cloud Guard for “Only Admins Manage All Resources”
- In Cloud Guard, open:
- Detector Recipes → find your Configuration or Identity detector recipe.
- Click the recipe → View Details → Detector Rules.
- Look for a rule related to:
- “Overly permissive IAM policy”, “All-resources permissions”, or similar wording (names can vary by version/region).
- Ensure the rule is:
- Enabled.
- Severity set appropriately (High/Critical).
- Attach the recipe to your Cloud Guard Target (the tenancy or key compartments):
- Go to Targets.
- Click your target.
- Confirm your updated detector recipe is associated.
7. (Optional) Create Notifications for Violations
- Go to Developer Services → Notifications.
- Create a Topic (e.g.,
cloud-guard-alerts). - Subscribe your email or PagerDuty/Slack endpoint.
- Back in Cloud Guard:
- Go to Responder Recipes or Rules.
- Configure a responder that:
- Triggers on the IAM “overly permissive policy” problem.
- Sends notification to the topic you created.
8. Validate
- Try to add a test policy for a non‑admin group with:
- Confirm:
- Non‑admin users still can’t manage resources outside their scope.
- Cloud Guard shows a Problem for the over‑permissive IAM policy (if you enabled that rule).
Using CLI
Using CLI
Below is a minimal, CLI-focused way to remediate “Only Administrators Should Manage All Resources” in OCI IAM, assuming:
Replace Look for statements like:
Record the returned Repeat as needed for each admin.
If you prefer per-compartment instead of tenancy-wide, scope it accordingly:
This will produce something like:Repeat for each policy that grants broad rights to non-admin groups.
Verify that:
If you share an example of a current policy statement, I can give you the exact replacement statements and the precise
- You already know which group is your “Administrators” group (or you will create one).
- You want to ensure that only this group has
manage all-resourcesprivileges in the tenancy or compartments.
1. Identify Existing “Over-Privileged” Policies
You’re looking for any policy that grantsmanage all-resources (or similarly broad verbs like manage instance-family at the tenancy level) to non-admin groups.1.1 List all policies in the tenancy
<TENANCY_OCID> with your root tenancy OCID.1.2 Get details for a specific policy
For each suspicious policy, get full details:2. Ensure You Have a Designated Admin Group
2.1 Create an Administrators group (if not already present)
ocid if needed.2.2 Add admin users to the Administrators group
3. Create/Verify the Correct Admin Policy
You want a single clear policy that grants the admin group full rights.3.1 Create an admin policy (if missing)
4. Remove or Tighten Non-Admin “Manage All-Resources” Policies
For each policy that grantsmanage all-resources to a non-admin group:4.1 Download current policy for editing
4.2 Edit the JSON file locally
- Remove or narrow the
manage all-resourcesline. - Replace with least-privilege statements (for example):
4.3 Update the policy in OCI
5. (Optional) Disable or Delete Unused Broad Policies
If a policy is purely obsolete and only grants over-broad permissions:5.1 Delete the policy
6. Validate via CLI
6.1 List policies again and search for “manage all-resources”
- Only the Administrators group is granted
manage all-resources(tenancy or compartments as per your design). - Other groups have more granular permissions (e.g.,
use,inspect, or specific resource-familymanage).
If you share an example of a current policy statement, I can give you the exact replacement statements and the precise
oci iam policy update command.Using Python
Using Python
Below is a concrete way to monitor and remediate the issue “Only Administrators Should Manage All Resources” in OCI IAM using Python and the OCI Python SDK.
If you use dynamic groups or compartments instead, add rules accordingly.
3. Python Script: Monitor Policies for
This script:
You’d call
Goal
Identify IAM policies that grantmanage all-resources and ensure that:- Only approved admin groups/compartments have that level of access.
- Any non‑admin principal with
manage all-resourcesis flagged (and optionally auto‑remediated).
1. Prerequisites
- Install OCI SDK:
- Configure your OCI CLI profile (usually
~/.oci/config) with a user that has permission to:INSPECT/READ/MANAGEpolicies.- Optionally
UPDATEpolicies (for automated remediation).
2. Define Allowed Admin Principals
Decide which IAM groups are allowed to have full access, e.g.:3. Python Script: Monitor Policies for manage all-resources
This script:- Lists all compartments and all IAM policies.
- Parses each policy statement.
- Finds statements that grant
manage all-resources. - Flags if the principal is not in
ALLOWED_ADMIN_GROUPS.
4. Optional: Automated Remediation
Once you’ve identified violating policies, you have two main choices:-
Edit the policy statements to:
- Remove
manage all-resourcesfor non‑admin groups. - Replace with narrower verbs/resources (e.g.,
read,use, or specific services).
- Remove
- Delete the entire policy if it’s not needed.
remediate_policy for each specific violating statement after reviewing it.5. Operationalizing as Monitoring
- Run this Python script:
- As an OCI Function triggered by a scheduled job (via OCI DevOps or an external scheduler).
- Or as a CI job in your security pipeline.
- Export findings to:
- OCI Logging / Object Storage / SIEM.
- Email / Slack / ticketing system.
Using Terraform
Using Terraform
OCID_OF_TENANCY_OR_COMPARTMENTwith your tenancy or compartment OCID where the policy is defined.IAM_MONITORING_ADMIN_ONLY_POLICYwith your existing policy name if you are remediating an existing policy, not creating a new one.ADMIN_GROUP_NAMEwith the actual administrator group that should manage all resources (for example,Administrators).
manage all-resources from any-user.For verification, terraform plan should show the oci_identity_policy with its statements changing from a line granting manage all-resources to any-user (or another overly broad principal) to the restricted Allow group ADMIN_GROUP_NAME to manage all-resources in tenancy.
