Triage and Remediation
How to Prevent
Using Console
Using Console
To prevent the misconfiguration of not having a complex password policy in AWS IAM using the AWS Management Console, follow these steps:
-
Navigate to IAM Dashboard:
- Sign in to the AWS Management Console.
- In the top navigation bar, click on “Services” and then select “IAM” under the “Security, Identity, & Compliance” section.
-
Access Account Settings:
- In the IAM dashboard, on the left-hand side, click on “Account settings.”
-
Set Password Policy:
- In the “Password policy” section, click on the “Set password policy” button.
- Configure the password policy settings to enforce complexity. Ensure you enable options such as:
- Require at least one uppercase letter.
- Require at least one lowercase letter.
- Require at least one number.
- Require at least one non-alphanumeric character (e.g., !, @, #, $).
-
Save Changes:
- After configuring the desired settings, click on the “Save changes” button to apply the new password policy.
Using CLI
Using CLI
To prevent the misconfiguration of not having a complex password policy in AWS IAM using the AWS CLI, you can follow these steps:
-
Set Minimum Password Length:
Ensure that the password policy enforces a minimum length for passwords. This helps in making passwords harder to guess.
-
Require at Least One Uppercase Letter:
Enforce the inclusion of at least one uppercase letter in the password to increase complexity.
-
Require at Least One Lowercase Letter:
Enforce the inclusion of at least one lowercase letter in the password to ensure a mix of character cases.
-
Require at Least One Number and One Special Character:
Ensure that the password includes at least one numeric digit and one special character to further enhance security.
Using Python
Using Python
To prevent the misconfiguration of not having a complex password policy in IAM using Python scripts, you can follow these steps for AWS, Azure, and GCP:
AWS (Boto3)
-
Install Boto3:
Ensure you have the Boto3 library installed. You can install it using pip if you haven’t already:
-
Create a Python Script to Set Password Policy:
Use the following script to set a complex password policy in AWS IAM:
Azure (Azure SDK for Python)
-
Install Azure Identity and Management Libraries:
Ensure you have the Azure libraries installed:
-
Create a Python Script to Set Password Policy:
Use the following script to set a complex password policy in Azure AD:
GCP (Google Cloud Client Library for Python)
-
Install Google Cloud IAM Library:
Ensure you have the Google Cloud IAM library installed:
-
Create a Python Script to Set Password Policy:
Use the following script to set a complex password policy in GCP IAM:
Summary
- AWS: Use Boto3 to set a complex password policy directly.
- Azure: Use Azure SDK for Python, but note that password policies are typically managed via Azure AD B2C or Conditional Access Policies.
- GCP: Use Google Cloud IAM library, but note that password policies are typically managed via G Suite Admin SDK.