More Info:
All IAM users should have valid email addresses configured. Valid emails ensure password reset notifications, security alerts, and audit communications reach the correct person.Risk Level
MediumAddress
Compliance, SecurityCompliance Standards
- APRA CPS 234 (Australia)
- 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
- Reserve Bank of India (RBI) Master Direction – Information Technology Framework
- 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
To remediate “OCI IAM Users Should Have Valid Email Addresses” using the OCI Console, you need to edit each affected user and add a valid email address.Below are the steps for both models of IAM in OCI (classic tenancy-local users and IAM Identity Domains). Use the path that matches what you see in your console.
1. If you are using IAM Identity Domains (most newer tenancies)
- Sign in to the OCI Console.
- In the left hamburger menu, go to
Identity & Security → Identity Domains. - Click the Identity Domain where your users are (often named like
Default). - In the left menu of the domain, click Users.
- Search for the user that was flagged as non-compliant.
- Click the user’s name to open their details.
- Go to the Contact Information or Profile section (naming can vary slightly by UI version).
- Find the Email field and enter a valid email address (e.g.,
user@example.com).- Make sure it’s:
- In a valid email format.
- An address the user actually controls (for notifications, password resets, etc.).
- Make sure it’s:
- Click Save or Update.
- Repeat steps 5–9 for all users flagged by your OCI IAM Monitoring / Cloud Guard finding.
2. If you are using Classic IAM (Tenancy-local users)
- Sign in to the OCI Console.
- Open the left hamburger menu and go to
Identity & Security → Identity → Users. - Locate the users reported in the misconfiguration (you can:
- Filter or search by name, or
- Use the report from Cloud Guard / IAM Monitoring to know which usernames are affected).
- Click the user’s name to open the user details.
- Click Edit.
- In the Email field, enter a valid email address.
- Click Save Changes.
- Repeat steps 3–7 for all non-compliant users.
3. Verify remediation in your monitoring
- After editing users, wait for the next OCI IAM Monitoring / Cloud Guard evaluation cycle (or manually re-run the detector if your tooling allows).
- Confirm that the finding “OCI IAM Users Should Have Valid Email Addresses” is now:
- Marked as Resolved, or
- No longer appears for the remediated users.
Using CLI
Using CLI
Below are the key steps and example OCI CLI commands to remediate “OCI IAM Users Should Have Valid Email Addresses” by identifying users without valid emails and updating them.Assumptions:
To isolate users missing an email (email is null or empty):This shows only users that need remediation.
Optionally mark it as verified (if you have already verified it out-of-band):
If no rows are returned, all users now have email addresses.
These steps allow you to remediate the “valid email” requirement for OCI IAM users using only the OCI CLI.
- You have OCI CLI installed and configured.
- You know your tenancy OCID.
- You (or an admin) know what each user’s correct email should be.
1. List All IAM Users and Find Those Without Email
2. Update a Single User’s Email
Once you know the correct email for a given user (by OCID):3. Bulk Update from a CSV/JSON (Optional Automation)
- Export users without email to JSON:
-
Edit
users_missing_email.json(or create a CSV mapping) to add the correct email for each user. -
Use a shell loop to update (example with a simple CSV:
user_email_map.csvcontaininguser_ocid,email):
4. Verify Remediation
Re-list users and confirm emails are set:These steps allow you to remediate the “valid email” requirement for OCI IAM users using only the OCI CLI.
Using Python
Using Python
Below is a practical way to enforce “OCI IAM users should have valid email addresses” using Python and OCI’s APIs.Note the:
How to use for monitoring:
You would call this inside your loop once you decide the proper new email, for example:Usually, you should:
If you tell me how you want to run this (OCI Function, cron, etc.), I can adapt the script to that environment and add the exact deployment steps.
1. Prerequisites
- Install OCI Python SDK:
- Configure OCI CLI-style config (for the SDK):
tenancyuserfingerprintkey_fileregion
inspect users in tenancymanage users(if you want to auto-remediate)use metrics in tenancy(if you want to push Monitoring metrics)
2. Decide Your Model
You can:-
Detect-only:
- Script lists all IAM users.
- Flags those with missing/invalid email.
- Pushes a custom metric / writes to log or report.
-
Detect + auto-remediate:
- Same as above, but calls
UpdateUserto fix the email (e.g., from an external source or pattern). - Usually safer to only detect and let an admin fix the email.
- Same as above, but calls
3. Python: Detect invalid IAM user emails
Logic:- List all users in the tenancy.
- Validate
emailfield:- Non-empty
- Basic regex pattern for email
- Print invalid users.
- (Optional) Publish a count to OCI Monitoring as a custom metric.
- Run this script periodically via:
- OCI Functions + OCI Events Scheduler
- A cron job on a bastion/automation host
- In OCI Monitoring, create an alarm on the custom metric:
- Query example:
- Action: send notification to Email/Slack via OCI Notifications.
- Query example:
4. Optional: Auto-remediate by updating user email
If you already know the “correct” email (e.g., via mapping), you can callUpdateUser.Example snippet to update one user:- Start with detect-only.
- Review invalid users.
- Then either fix them manually in Console or implement a controlled auto-fix with clear mappings.
If you tell me how you want to run this (OCI Function, cron, etc.), I can adapt the script to that environment and add the exact deployment steps.
Using Terraform
Using Terraform
email field and does not force resource replacement.After applying the fix, terraform plan should show an update to oci_identity_user.OCI_IAM_MONITORING_USER with email changing from its previous value (or null) to VALID_MONITORING_USER_EMAIL@example.com.
