IAM password below the minimum length

Use sufficiently long, unique IAM console passwords.

Description

LoginProfile.Password sets one IAM user’s console password. Set the minimum length for all IAM users in the account password policy.

Potential impact

A published or reused password can give someone access to the user’s permissions regardless of its length.

Remediation

If your organization requires 14 characters, enforce at least 14 in the account policy. Supply each user’s unique password through a secure input or secret manager and use MFA.

Examples

The excerpts compare 10- and 16-character passwords. Generate a unique password for the actual IAM user and keep the published examples out of production. The referenced myqueue and mytopic resources are omitted.

Before

yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: Password length comparison
Resources:
  myuser:
    Type: AWS::IAM::User
    Properties:
      Path: "/"
      LoginProfile:
        Password: myP@ssW0rd
      Policies:
      - PolicyName: giveaccesstoqueueonly
        PolicyDocument:
          Version: '2012-10-17'
          Statement:
          - Effect: Allow
            Action:
            - sqs:*
            Resource:
            - !GetAtt myqueue.Arn
          - Effect: Deny
            Action:
            - sqs:*
            NotResource:
            - !GetAtt myqueue.Arn
      - PolicyName: giveaccesstotopiconly
        PolicyDocument:
          Version: '2012-10-17'
          Statement:
          - Effect: Allow
            Action:
            - sns:*
            Resource:
            - !Ref mytopic
          - Effect: Deny
            Action:
            - sns:*
            NotResource:
            - !Ref mytopic

After

yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: Password length comparison
Resources:
  myuser:
    Type: AWS::IAM::User
    Properties:
      Path: "/"
      LoginProfile:
        Password: myP@ssW0rd123asw
      Policies:
      - PolicyName: giveaccesstoqueueonly
        PolicyDocument:
          Version: '2012-10-17'
          Statement:
          - Effect: Allow
            Action:
            - sqs:*
            Resource:
            - !GetAtt myqueue.Arn
          - Effect: Deny
            Action:
            - sqs:*
            NotResource:
            - !GetAtt myqueue.Arn
      - PolicyName: giveaccesstotopiconly
        PolicyDocument:
          Version: '2012-10-17'
          Statement:
          - Effect: Allow
            Action:
            - sns:*
            Resource:
            - !Ref mytopic
          - Effect: Deny
            Action:
            - sns:*
            NotResource:
            - !Ref mytopic

References