id: iam-password-policy
info:
  name: IAM Password Policy Not Configured
  author: princechaddha
  severity: medium
  description: |
    Verifies that Amazon IAM users adhere to a strong password policy, including requirements for minimum length, expiration, and pattern
  reference:
    - https://docs.aws.amazon.com/cli/latest/reference/iam/get-account-password-policy.html
  tags: cloud,devops,aws,amazon,iam,aws-cloud-config

self-contained: true
code:
  - engine:
      - sh
      - bash
    source: |
      aws iam get-account-password-policy

    matchers:
      - type: word
        words:
          - "NoSuchEntity"

    extractors:
      - type: dsl
        dsl:
          - '"AWS cloud account is not configured with a custom IAM password policy"'
# digest: 490a00463044022055c5e7c44c862bac281cda22b1f74de43c5c590680abbfdef4c7814f844af67702205eb87929fe29247fa90db958e8c56b23e62472b680ae98f265da4a2e57d53f95:922c64590222798bb761d5b6d8e72950