More Info:
MFA should be enforced for every user with console login capability. Console access without MFA is vulnerable to phishing and credential-stuffing attacks.Risk Level
HighAddress
Compliance, SecurityCompliance Standards
- APRA CPS 234 (Australia)
- AWS Startup Security Baseline
- 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
- GDPR
- HIPAA
- 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
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- PCI
- Reserve Bank of India (RBI) Master Direction – Information Technology Framework
- SOC2
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- Securities and Exchange Board of India (SEBI) - Cloud Security Adoption Framework
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
Below are step‑by‑step instructions to remediate “OCI IAM Console Users Should Have MFA Enforced” using the OCI Console, so that it is actually enforced (not just optional) and visible to IAM monitoring/Cloud Guard.
Summary of Remediation via Console:
1. Identify the Identity Domain Used for Console Logins
- Sign in to the OCI Console as a tenancy admin.
- Open the navigation menu → Identity & Security → Identity Domains.
- Locate the identity domain(s) where your console users exist (often named Default, or similar).
- Click the target identity domain name to manage its settings.
2. Configure MFA Factors in the Identity Domain
- Inside the identity domain, go to Security → Multi-Factor Authentication (or Security → Factors, depending on version).
- Under Available Factors, ensure at least one of these is Enabled:
- Time-based One-Time Password (TOTP) (e.g., Google Authenticator, Microsoft Authenticator)
- Email OTP or SMS OTP (if allowed by your policy)
- Save any changes.
3. Enforce MFA via Sign-On Policy
You now make MFA mandatory for interactive console access.- In the same identity domain, go to Security → Sign-on Policies.
- Either edit the existing default sign-on policy or create a new policy:
- Click Create Sign-on Policy (if creating new).
- Name it (e.g.,
Require-MFA-For-Console).
- Add a Rule (or edit an existing rule) that matches all interactive console users, for example:
- Conditions:
- Client Type: Browser (or All if you want broad coverage).
- IP Range / Network Perimeter: as required (or leave broad for all).
- User Group: choose groups that represent console users (e.g.,
Administrators,OCI-Console-Users) or All users if every human user must have MFA.
- Actions / Access:
- Set Require multi-factor authentication = Yes (or choose the specific factor set if prompted).
- Conditions:
- Ensure rule order is correct:
- Rules are evaluated top-down. Place the MFA-required rule above any rules that might allow access without MFA.
- Save the sign-on policy and make sure it is Active.
4. Require Existing Users to Register MFA
Enforcement will prompt users, but you can also verify/assist:- In the identity domain, go to Users.
- Pick a user → check Security / Multifactor Authentication or Factors tab:
- Confirm if they already have an enrolled factor (e.g., TOTP).
- If not enrolled:
- Tell users to sign in to the OCI Console.
- On next sign-in, due to the new sign-on policy, they’ll be guided to register MFA (e.g., scan QR code with an authenticator app).
- For critical/admin users, you can test:
- Log in as that user (or with a test user in same groups) to verify you’re forced to set up MFA and use it.
5. Confirm with OCI IAM Monitoring / Cloud Guard
If the finding came from Cloud Guard or Security Advisor, verify remediation:- Go to Identity & Security → Cloud Guard.
- Under Detected Problems (or Targets → Problems):
- Filter by resource type IAM, or by the specific problem name (e.g., OCI IAM Console Users Should Have MFA Enforced).
- After the new sign-on policy has been active and users start registering MFA, let Cloud Guard re-evaluate (or manually Recalculate / Re-evaluate if available).
- Confirm the problem status moves to Resolved or No problems for IAM console MFA.
6. Optional: Tighten for Admin / Privileged Groups
If you want extra assurance:- Create a separate sign-on policy specifically targeting:
- Admin groups:
Administrators,SecurityAdmins,NetworkAdmins, etc.
- Admin groups:
- For these rules:
- Always require MFA (no exceptions by IP or network).
- Place these rules at the top in the sign-on policy order.
Summary of Remediation via Console:
- Enable at least one MFA factor in the identity domain.
- Create or edit a Sign-On Policy to require MFA for console access for all (or all human) IAM users.
- Ensure rule ordering enforces MFA, and confirm via user login test.
- Verify in Cloud Guard / IAM Monitoring that the “MFA enforced” check is now passing.
Using CLI
Using CLI
In OCI you can monitor MFA status with the CLI, but you cannot actually “turn on” or enroll MFA for a user via CLI – users must self-enroll, and enforcement is done via Identity Domain / sign‑on policies.Below are the practical steps:
To see only users without MFA:If you are using Identity Domains, use the identity‑domains service:(Then filter the returned JSON on the MFA factor attributes, which differ by domain config.)
Summary:
1. Prerequisites
- OCI CLI installed and configured with a tenancy‑admin or security‑admin–level profile:
- Know your:
- Tenancy OCID:
ocid1.tenancy.oc1.... - Home region (for IAM operations): e.g.
us-phoenix-1
- Tenancy OCID:
2. List all IAM users and check MFA status
The user object includes a flag for MFA activation (in classic IAM tenants it’sis_mfa_activated or similar; in identity domains it’s exposed through identity‑domains APIs).2.1 Get all users (classic IAM)
3. Create a monitoring script
You can schedule a simple script (OCI DevOps, Functions, or external CI) to fail compliance if any user lacks MFA.Example (bash, classic IAM):4. Enforce MFA (remediation)
This part cannot be done directly via OCI CLI at per‑user level. You remediate by:-
Enforcing MFA via Identity Domain sign‑on policies (Console):
- Go to: Identity & Security → Domains → select your domain.
- Security → Sign-on policies.
- Edit or create a policy that requires MFA for:
- “OCI Console access” (or equivalent app),
- All users or targeted groups.
- Set conditions (e.g., all networks) and require at least one MFA factor.
-
Communicating to users:
- Notify the non‑MFA users identified by the script to log in and complete MFA enrollment.
- Optionally, set a deadline and then:
-
Disable users who haven’t enrolled MFA:
(Use carefully; you’re disabling the account.)
-
Disable users who haven’t enrolled MFA:
5. Optional: Wire into OCI Cloud Guard / Security Zones
- Enable Cloud Guard with a detector recipe that includes the “MFA not enabled for IAM users” rule (if present for your tenancy).
- You can then use responder recipes, or a Function triggered by events, to:
- Run the CLI monitoring script,
- Create incidents or send notifications for non‑MFA users.
Summary:
- Use OCI CLI to monitor MFA status and detect non‑compliant console users.
- Use Identity Domain sign‑on policies (via Console or IAM APIs if/when available) to enforce MFA globally.
- Users must self‑register MFA; you can optionally disable non-compliant accounts via CLI as a hard remediation step.
Using Python
Using Python
Below is a practical way to monitor and flag OCI IAM console users who do not have MFA configured, using Python and the OCI SDK.
Call
Call
Note: MFA is enforced via IAM security policies / identity domain authentication policies, not user-by-user. What you can do with Python is:
- Detect users without MFA
- Push that info into logs/metrics, send notifications, or use it as an input for governance.
1. Prerequisites
- Install OCI Python SDK:
- Configure your OCI credentials (one of):
~/.oci/config(viaoci setup config), or- Instance principal / resource principal if running on OCI compute / functions.
2. Python Script: List Users Without MFA
This example:- Lists all users in your tenancy
- For each user, checks if any TOTP MFA devices exist
- Prints and optionally sends them to Monitoring or Notifications
3. (Optional) Push a Custom Metric to OCI Monitoring
This lets you create an alarm such as “if number of non-MFA users > 0, send alert”.send_metric_to_monitoring(len(users_without_mfa)) from main() after you compute the list.Then in the OCI Console:- Go to Monitoring → Metrics.
- Select namespace
security_custom. - Create an alarm on
non_mfa_users_count > 0for some periods. - Attach an Alarm Destination (Notifications topic → email/Slack/etc.).
4. (Optional) Send a Notification with List of Non-MFA Users
send_list_to_notifications(users_without_mfa, "<topic_ocid>").5. Automate the Monitoring
- Run this script on:
- A VM with
cron - OCI DevOps build job
- As an OCI Function with a cron Events rule (converted to Functions runtime)
- A VM with
6. Enforcing MFA (Separate from Monitoring)
To actually enforce MFA (beyond monitoring):-
Classic IAM:
- Configure MFA in your Identity Provider / Console sign-on policy (if using identity domains, use Authentication Policies and Rules).
- Make MFA mandatory for interactive login to the Console.
-
Identity Domains (recommended):
- Create an Authentication Policy that requires MFA for console access (or all access).
- Optionally enforce MFA enrollment at first login.
Using Terraform
Using Terraform

