For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/cloudformation-aws-cognito-userpool-without-mfa.md.
A documentation index is available at /llms.txt.
Cognito User Pools must enable or allow multi-factor authentication (MFA) to protect user accounts from compromised credentials and reduce the risk of account takeover and unauthorized access. The MfaConfiguration property in AWS::Cognito::UserPool must be defined and set to ON (enforce MFA for all users) or OPTIONAL (allow users to enable MFA). Resources that omit MfaConfiguration or set it to OFF will be flagged. When enabling or allowing MFA, also configure an MFA provider such as SoftwareTokenMfaConfiguration or SmsConfiguration so MFA can operate correctly.
Secure configuration example (CloudFormation YAML):