All checks
Medium Cognito · regional

Cognito user pools should have deletion protection enabled

Checks that a Cognito user pool has deletion protection active. Without it, a single DeleteUserPool call removes the pool and every user account in it. Pools created in the console have it active by default; pools created with the API, the CLI or an SDK do not.

service
Cognito
severity
Medium
scope
evaluated in every region

How to fix it

In the console

Amazon Cognito → User pools → the pool → Settings → User pool security

Deletion protection
Activate

With the AWS CLI

  • Overwrites existing settings: update-user-pool resets every setting it is not given to its default, so read the pool with describe-user-pool and resupply its configuration in the same call.
aws cognito-idp update-user-pool --user-pool-id <user-pool-id> --deletion-protection ACTIVE --region <region>

With Terraform

resource "aws_cognito_user_pool" "this" {
  name                = var.user_pool_name
  deletion_protection = "ACTIVE"
}

See which of your accounts this check is failing on.

Book a live scan