More Info:
The IAM password policy should prevent password reuse. Allowing users to reuse previous passwords negates the security benefits of regular password rotation.Risk Level
MediumAddress
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)
- GDPR
- 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)
- NIST
- NIST CSF
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- PCI
- Reserve Bank of India (RBI) Cyber Security Framework
- 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 prevent password reuse in OCI IAM via the Console, you need to edit the tenancy’s password policy.Prerequisites:
- You must be in the tenancy’s home region.
- You must have permissions to manage IAM password policies (typically a tenancy administrator).
Step-by-step Remediation in OCI Console
-
Sign in to the OCI Console
Log in to the OCI Console as a user with admin privileges. -
Switch to the Home Region (if not already there)
- At the top of the Console, check the region selector.
- If you are not in the home region, switch to it (password policies are managed at the tenancy level, in the home region).
-
Go to Identity & Security → Domains (or Identity → Domains)
- In the left-hand navigation menu, open Identity & Security.
- Click Domains.
- Identify the Default domain (or the domain in which the users are managed).
-
Open the Domain Settings
- Click on the domain name (for example, Default).
- In the domain details page, locate and select Security or Password Policy (naming can vary slightly, look for “Password policy” or similar under Security settings).
-
Edit the Password Policy
- Click Edit (or Edit password policy).
- Look for the setting related to Password Reuse or Password History (e.g., “Number of previous passwords remembered”, “Disallow reuse of last N passwords”).
-
Configure Password Reuse Prevention
- Set the value for password history / previous passwords to a non-zero number (e.g., 5 or your organization’s required value).
- This means a user cannot reuse any of their previous N passwords.
-
Save the Policy
- Click Save changes or Update to apply the new password policy.
-
Verify the Change
- Re-open the Password policy screen to confirm the password reuse / history value is correctly set.
- Optionally, attempt a password change for a test user to confirm that reusing an old password is blocked.
Using CLI
Using CLI
In OCI, “prevent password reuse” is controlled by the password history settings in the tenancy’s IAM Authentication Policy. You remediate it by enabling password history and setting a non‑zero history count using the OCI CLI.Look for:This replaces only the fields you specify; unspecified fields keep their existing values (the CLI merges JSON).Edit Then:You should see:
1. Prerequisites
- OCI CLI installed and configured (
oci setup configalready done). - You know your tenancy OCID (this is the compartment OCID for the auth policy).
2. Check the current password policy
isPasswordHistoryEnabledpasswordHistoryCount
isPasswordHistoryEnabled is false or passwordHistoryCount is 0 or null, password reuse is effectively allowed.3. Update the policy to prevent password reuse
Decide how many previous passwords you want to remember (example: 5).If you prefer to be explicit, first dump the current policy, edit, then re‑apply:
password-policy.json:4. Verify the change
HistoryEnabled=trueHistoryCount= your chosen number (e.g.,5)
Using Python
Using Python
To prevent password reuse in OCI IAM and handle it via Python monitoring/remediation, you need to enforce the setting in the Identity Domain password policy using the OCI Python SDK.Below are the high‑level steps and then a sample Python script.
If you share your current SDK version (
1. Prerequisites
-
Install OCI Python SDK:
-
Configure OCI credentials (
~/.oci/config) with a profile that has permissions to manage Identity Domains (e.g.,Identity Domain Administrator): - Note the Identity Domain OCID where you want to enforce the policy.
2. Understand the setting
In Identity Domains, password policy is usually controlled by attributes like:isPreventedPasswordReuse(or similarly named flag for reuse prevention)- sometimes combined with a “history” count like
passwordReuseHistoryCount(if supported)
isPreventedPasswordReuse = True (and optionally a minimum history count).Names may differ slightly by SDK version; the pattern is the same: get the policy, set the reuse‑prevention field to true, update.3. Python remediation script (identity domain password policy)
This script:- Reads config
- Gets a password policy for a given Identity Domain
- Sets the “prevent password reuse” flag if not already enabled
4. How to integrate into “OCI IAM Monitoring using Python”
-
Monitoring step: periodically run a script that:
- Calls
get_password_policy - Checks
is_prevented_password_reuse - Logs/alerts if
False
- Calls
-
Auto‑remediation step: extend that script to:
- If
False, callupdate_password_policyas above to set it toTrue.
- If
- An OCI Functions function triggered by Events or a scheduled job
- An external cron job / CI pipeline running the Python script
If you share your current SDK version (
pip show oci) I can give the exact attribute names as they appear in that version.Using Terraform
Using Terraform

