More Info:
Active IAM users should be members of at least one group. Users without group membership cannot receive group-based permissions, suggesting orphaned or misconfigured accounts.Risk Level
MediumAddress
Compliance, SecurityCompliance Standards
- APRA CPS 234 (Australia)
- AWS Startup Security Baseline
- 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 console-based steps to (a) identify active IAM users not in any group, and (b) remediate them so every active user is in at least one group (or is disabled if not needed).
Summary remediation actions in Console:
1. Identify active users without any groups
OCI Console does not have a single built‑in filter for “users with no groups,” so you have to inspect users and their group memberships:-
Sign in to OCI Console
- Use an account with IAM admin permissions (e.g.,
Administrator).
- Use an account with IAM admin permissions (e.g.,
-
Go to IAM Users
- Open the hamburger menu (☰) → Identity & Security → Identity → Users (or Domains → your domain → Users, if you use IAM Domains).
- Ensure you are looking at the correct Identity Domain if domains are enabled.
-
Filter active users
- In the Users list, use the Status filter:
- Set Status = Active.
- This shows all active IAM users.
- In the Users list, use the Status filter:
-
Check group membership per user
- Click a user name to open the User Details page.
- In the user details, go to the Groups tab/section.
- If no groups are listed, this user is active but not in any group.
- Make a list of such users (e.g., export to CSV if available in your tenancy, or track manually).
2. Decide remediation per user
For each active user with no groups, decide:- Should this user remain active and have access?
- If yes: assign at least one appropriate group.
- If no (unused / test / ex-employee): disable the account.
3. Add user to an appropriate group (preferred remediation)
You should generally have predefined groups mapped to policies (e.g.,Administrators, Developers, ReadOnly, etc.).-
Identify the right group
- Go to Identity & Security → Identity → Groups.
- Review group purpose and policies to choose the one that matches the user’s job role.
-
Add the user to the group
- Still in Groups, click the target group.
- Go to the Members tab.
- Click Add User to Group.
- Search for the user by name.
- Select the user and click Add.
-
Verify
- Go back to Identity & Security → Identity → Users.
- Click the user → Groups tab and confirm the group is now listed.
4. Disable users that should not have access
For active users who should no longer have access:- Go to Identity & Security → Identity → Users.
- Click the user name.
- On the User Details page, click More Actions (or the equivalent control) → Disable.
- Confirm the action.
- Status should change to Inactive.
5. Ongoing monitoring using OCI IAM / Security services
To monitor this continuously via OCI:-
Cloud Guard (if available in your tenancy)
- Go to Security → Cloud Guard.
- Ensure it is Enabled in the relevant compartments/tenancy.
- In Detector Recipes, look for IAM-related detectors (e.g., “IAM user has no group membership” or similar; naming can change).
- Enable / configure detector rules that flag users without group membership.
- Optionally, create a Responder Rule to:
- Notify (e.g., via Notifications / Email), or
- Auto-remediate (e.g., disable user or add to a default group, depending on your policy).
-
Notifications
- Use Notifications (Events + Notifications Service) to send alerts to email/Slack when such findings occur.
Summary remediation actions in Console:
- For each active user with no groups:
- Either: Add to at least one appropriate group (User → Groups → Add to Group or Group → Members → Add User).
- Or: Disable the user if not required.
Using CLI
Using CLI
Below are concise, step‑by‑step OCI CLI instructions to find active IAM users that are not in any group and add them to at least one group.Assumptions:
If you don’t know it:
Optionally store them:
Simpler version for each user individually:Now
Note the group OCID you want to use, or create one.If using an existing group, just set:
It should now show at least one group ID (the group you added them to).
- You have OCI CLI installed and configured (
oci setup configdone). - You know (or can create) the target group(s) to which users should belong.
- You have permissions to manage IAM users and groups.
1. Get your tenancy OCID
2. List all active IAM users
3. Find users that are NOT members of any group
Run this one‑liner (requiresjq and xargs):users_without_groups.txt contains all active users with no group memberships.4. Choose or create the remediation group
4.1. List existing groups
4.2. Create a new group (optional)
5. Add each user without a group to the target group
6. Verify remediation
Re‑run the membership check for a sample user:Automating for Monitoring
To keep the control enforced continuously:- Wrap steps 2–5 in a shell script (
remediate_iam_groups.sh). - Run it periodically using:
- OCI Logging + Functions + Events, or
- A cron job on a bastion host (if allowed).
Using Python
Using Python
Below is a step‑by‑step approach and a Python example using the OCI Python SDK to:
- Find IAM users that are active and not in any group
- Optionally add them to a default group (or just report them)
1. Prerequisites
- Install OCI SDK:
- Have a valid OCI config file (e.g.
~/.oci/config) with:
- The user/instance using this config must have policies that allow:
read userson IAMread groupsandread user-group-membershipsmanage usersormanage user-group-memberships(if you want to modify)
2. High-Level Logic
- Load OCI config and create an
IdentityClient. - List all IAM users in the tenancy.
- For each user:
- Skip
INACTIVEusers. - Get their group memberships.
- If no group memberships exist, mark as non-compliant.
- Skip
- For non-compliant users, either:
- Just log/print them, or
- Add them to a chosen default group (e.g.
ocid1.group.oc1..xxxx).
3. Python Script Example
4. How to Use for Monitoring
- Run this script periodically via:
- OCI Functions + Events / Scheduled invocation, or
- A cron job on a bastion/automation server.
- Instead of adding to a group automatically, you can:
- Send the
non_compliant_userslist to:- Email (SMTP),
- Slack/Webhook,
- OCI Monitoring (custom metrics) or Logging.
- Send the
DEFAULT_GROUP_OCID = None and integrate the printed list into your monitoring/alerting workflow.Using Terraform
Using Terraform
terraform plan should show creation of one oci_identity_user_group_membership resource with the specified user_id and group_id, and no destructive changes to the user.
