IAM Password Without Minimum Length

  • Query id: 1bc1c685-e593-450e-88fb-19db4c82aa1d
  • Query name: IAM Password Without Minimum Length
  • Platform: Terraform
  • Severity: Medium
  • Category: Best Practices
  • URL: Github

Description

IAM password should have the required minimum length
Documentation

Code samples

Code samples with security vulnerabilities

Positive test num. 1 - tf file
resource "aws_iam_account_password_policy" "positive1" {
  require_lowercase_characters   = true
  require_numbers                = true
  require_uppercase_characters   = true
  require_symbols                = true
  allow_users_to_change_password = true
}

resource "aws_iam_account_password_policy" "positive2" {
  minimum_password_length        = 3
  require_lowercase_characters   = true
  require_numbers                = true
  require_uppercase_characters   = true
  require_symbols                = true
  allow_users_to_change_password = true
}

Code samples without security vulnerabilities

Negative test num. 1 - tf file
resource "aws_iam_account_password_policy" "negative1" {
  minimum_password_length        = 14
  require_lowercase_characters   = true
  require_numbers                = true
  require_uppercase_characters   = true
  require_symbols                = true
  allow_users_to_change_password = true
}