AWS Password Policy Password Reuse


Description

This policy validates that the account password policy prevents users from re-using previous passwords, and prevents password reuse for 24 or more prior passwords.

Query · python

def policy(resource):
    if resource["PasswordReusePrevention"] is None:
        return False
    return resource["PasswordReusePrevention"] >= 24

Analyst notes

https://docs.runpanther.io/alert-runbooks/built-in-policies/aws-account-password-policy-prevents-password-reuse

Raw source AWS Password Policy Password Reuse · Panther Python
Esc
Published by panther-labs/panther-analysis ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
AnalysisType: policy
Filename: aws_password_policy_password_reuse.py
PolicyID: "AWS.PasswordPolicy.PasswordReuse"
DisplayName: "AWS Password Policy Password Reuse"
Enabled: true
ResourceTypes:
  - AWS.PasswordPolicy
Tags:
  - AWS
  - Identity & Access Management
  - Credential Access:Brute Force
Reports:
  CIS:
    - 1.10
  PCI:
    - 8.2.5
  MITRE ATT&CK:
    - TA0006:T1110
Severity: Medium
Description: >
  This policy validates that the account password policy prevents users from re-using previous
  passwords, and prevents password reuse for 24 or more prior passwords.
Runbook: >
  https://docs.runpanther.io/alert-runbooks/built-in-policies/aws-account-password-policy-prevents-password-reuse
Reference: >
  https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html
Tests:
  - Name: Insufficient Password Reuse Prevention Enabled
    ExpectedResult: false
    Resource:
      {
        "AllowUsersToChangePassword": false,
        "AnyExist": true,
        "ExpirePasswords": true,
        "HardExpiry": false,
        "MaxPasswordAge": 90,
        "MinimumPasswordLength": 14,
        "PasswordReusePrevention": 3,
        "RequireLowercaseCharacters": true,
        "RequireNumbers": true,
        "RequireSymbols": true,
        "RequireUppercaseCharacters": true,
      }
  - Name: No Password Reuse Prevention Enabled
    ExpectedResult: false
    Resource:
      {
        "AllowUsersToChangePassword": false,
        "AnyExist": true,
        "ExpirePasswords": true,
        "HardExpiry": false,
        "MaxPasswordAge": 90,
        "MinimumPasswordLength": 14,
        "PasswordReusePrevention": null,
        "RequireLowercaseCharacters": true,
        "RequireNumbers": true,
        "RequireSymbols": true,
        "RequireUppercaseCharacters": true,
      }
  - Name: Sufficient Password Reuse Prevention Enabled
    ExpectedResult: true
    Resource:
      {
        "AllowUsersToChangePassword": false,
        "AnyExist": true,
        "ExpirePasswords": true,
        "HardExpiry": false,
        "MaxPasswordAge": 90,
        "MinimumPasswordLength": 14,
        "PasswordReusePrevention": 24,
        "RequireLowercaseCharacters": true,
        "RequireNumbers": true,
        "RequireSymbols": true,
        "RequireUppercaseCharacters": true,
      }


# ------ paired body: aws_password_policy_password_reuse.py ------

def policy(resource):
    if resource["PasswordReusePrevention"] is None:
        return False
    return resource["PasswordReusePrevention"] >= 24

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.