Description
Applications can sign in to supported RDS or Aurora clusters with IAM tokens. Multifactor authentication and database audit logging have separate settings.
Potential impact
A leaked shared database password grants access to whatever that database user can read or change.
Remediation
Check the engine and version, then set EnableIAMDatabaseAuthentication: true on the cluster. Configure the database user for IAM authentication, grant the application rds-db:connect for that user and limit its database privileges. Test a token-based TLS connection before retiring replaced passwords.
Examples
The Aurora PostgreSQL example needs a supported DBEngineVersion and a matching DBClusterParameterGroupName. Supply the username, password and networking, and create a writer DB instance before connecting to the new cluster.
Before
AWSTemplateFormatVersion: "2010-09-09"
Resources:
sample:
Type: "AWS::RDS::DBCluster"
Properties:
MasterUsername: !Ref DBUsername
MasterUserPassword: !Ref DBPassword
StorageEncrypted: true
DBClusterIdentifier: aurora-postgresql-cluster
Engine: aurora-postgresql
EngineVersion: !Ref DBEngineVersion
DBClusterParameterGroupName: !Ref DBClusterParameterGroupName
EnableCloudwatchLogsExports:
- postgresql
EnableIAMDatabaseAuthentication: false
After
AWSTemplateFormatVersion: "2010-09-09"
Resources:
sample:
Type: "AWS::RDS::DBCluster"
Properties:
MasterUsername: !Ref DBUsername
MasterUserPassword: !Ref DBPassword
StorageEncrypted: true
DBClusterIdentifier: aurora-postgresql-cluster
Engine: aurora-postgresql
EngineVersion: !Ref DBEngineVersion
DBClusterParameterGroupName: !Ref DBClusterParameterGroupName
EnableCloudwatchLogsExports:
- postgresql
EnableIAMDatabaseAuthentication: true