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-dms-endpoint-password-exposed.md.
A documentation index is available at /llms.txt.
Storing AWS DMS endpoint passwords as plaintext in a template or embedding them as a parameter Default exposes credentials in source control, CloudFormation templates, and stack metadata. This increases the risk of unauthorized access to database resources.
For AWS::DMS::Endpoint resources, Properties.Password must not be a plain string literal or a Ref to a Parameters.<Name> that defines a Default value. Instead, Password should reference an AWS Secrets Manager secret or be supplied via a CloudFormation parameter without a Default (use NoEcho set to true to avoid echoing).
Resources that contain plaintext passwords or parameter references with defaults will be flagged as insecure. Acceptable secure patterns include dynamic Secrets Manager references or parameters provided at deployment time.
Resources:DMSEndpoint3:Type:AWS::DMS::EndpointProperties:CertificateArn:StringDatabaseName:StringEndpointIdentifier:StringEndpointType:StringEngineName:StringExtraConnectionAttributes:StringKafkaSettings:KafkaSettingsKinesisSettings:KinesisSettingsKmsKeyId:StringMongoDbSettings:MongoDbSettingsNeptuneSettings:NeptuneSettingsPassword:!Sub '{{resolve:secretsmanager:${MyAmpAppSecretManagerRotater}::password}}'Port:80S3Settings:S3SettingsServerName:StringSslMode:StringTags:- TagUsername:StringMyAmpAppSecretManagerRotater:Type:AWS::SecretsManager::SecretProperties:Description:'This is my amp app instance secret'GenerateSecretString:SecretStringTemplate:'{"username": "admin"}'GenerateStringKey:'password'PasswordLength:16ExcludeCharacters:'"@/\'