Introduction
Best practices for securing an AWS environment have been well-documented and generally accepted, such as AWS’s guidance. However, organizations may still find it challenging on how to begin applying this guidance to their specific environments.
- Which controls should be applied out-of-the-box vs. customized?
- What pitfalls exist in implementing the various controls or checks?
- How do you prioritize remediation of the “sea of red” violations?
In this blog series, we’ll analyze anonymized data from Netskope customers that include security settings of 650,000 entities from 1,143 AWS accounts across several hundred organizations. We’ll look at the configuration from the perspective of the best practices, see what’s commonly occurring in the real world and:
- Discuss specific risk areas that should be prioritized
- Identify underlying root causes and potential pitfalls
- Focus on practical guidance for applying the Benchmark to your specific environment
This blog post focuses on IAM security controls related to account password policies. Based on the Netskope dataset analyzed, we will highlight two opportunities to improve security by making simple IAM changes:
- 73% of accounts have an account password policy with a password length less than 14, which is easier to brute-force and compromise. Half of these accounts are using the default AWS Password Policy.
- 80% of IAM User accounts have a password reuse/history setting that is less than 24, leading to password reuse and higher chances of compromise.
Password Policy: legacies and defaults
“Don’t live life by default.”
― Steven Redhead
These two technical best practices involve the IAM User Password Policy strength. In a high majority (70-80%) of the 1,143 accounts, the account Password Policy is weak:
# | Best Practice | # of Violations | % |
---|---|---|---|
1 | Ensure IAM password policy requires a minimum length of 14 or greater | 832 | 72.8% |
2 | Ensure IAM password policy prevents password reuse | 910 | 76.9% |
1. Password Length
Background: Minimum suggested password lengths should be at least 14 in order to prevent easy brute-force compromise of passwords.
Data: 832 (72.8%) of accounts have an account password policy with a password length less than 14.
Analysis: If we analyze the breakdown of the 832 accounts by the length in the password policy, we find:
Password Length | Violations | % (out of 1,143) |
---|---|---|
0 | 0% | |
6-7 | 54 | 4.7% |
8 | 539 | 47% |
9-13 | 239 | 21% |
In 2020, AWS changed the default Password Policy, increasing the minimum length from 6 to 8 characters. As we can see, 539 accounts (47%) have a password length of 8. Interestingly, more than 80% of the 539 accounts or 440 are set to 8 because they use the default password policy i.e. a custom password policy is not created.
Controls:
- Detection/Audit
- Auditing the password length in a custom account password policy can be done via CLI:
aws iam get-account-password-policy
- The AWS Config Rule: iam-password-policy will also detect password policies that are too weak.
- Auditing the password length in a custom account password policy can be done via CLI:
- Prevention/Mitigation
- Best practices call for modifying default settings to harden accounts. It is generally easier for users to increase password entropy by increasing length versus character variation.
- Create a custom password policy that has a password length of at least 14. Using a password manager with random, long passwords is the best way to achieve this.
2. Password Reuse
Background: A similar story is told with the password reuse (history) setting. Best practices recommend preventing password reuse with a large setting of 24.
Data: 910 (80%) of IAM User accounts have a password reuse/history setting that is less than 24.
Analysis: To provide more context, we breakdown the 910 accounts by their actual reuse setting:
Password Reuse | Violations | % (out of 1,143) |
---|---|---|
0 (default) | 440 | 38% |
1-4 | 92 | 8% |
5 | 135 | 12% |
6-11 | 136 | 12% |
12-23 | 27 | 2% |
In 440 accounts (38%), password reuse is set to 0, inherited from the default Password Policy. When customizing a policy, the Console will supply a suggested value of 5 for the reuse setting. For those that set a custom policy, about 12% choose 5. In summary, default values (0 or 5) have been used for password reuse in 50% of the accounts in this dataset which introduces more risk than recommended.
Controls:
- Detection/Audit
- Auditing the password reuse in a custom account password policy can be done via CLI:
aws iam get-account-password-policy
- The AWS Config Rule: iam-password-policy will also detect password policies that are too weak.
- Auditing the password reuse in a custom account password policy can be done via CLI:
- Prevention/Mitigation
- Setting password reuse is recommended to prevent and mitigate compromised credentials.
Additional Controls
- Enabling MFA for regular IAM users will also help mitigate compromised credentials.
- If you are using or can use cross-account access or federated/SSO authentication, it avoids the IAM User password policy issues since cross-account access will utilize temporary credentials. Authentication and password policies including length, reuse, and MFA can be handled centrally by the federated identity system instead of in each account.
Conclusion
Many best practices have been codified but many AWS environments lag behind in implementing these best practices. Remediating the issues is straightforward for many of the security settings, and there exists specific prescriptive guidance on auditing and remediating your configurations in these areas, which can result in a large reduction in risk.
Here are some basic measures that can be done to address some of the common risk areas due to IAM configuration in your AWS environment:
- Customize your AWS Password Policy, do not use the default.
- Increase the password length to at least 14, and set the password reuse to 24.