A collection of AWS Security controls for Amazon RDS and Database Migration Service (DMS). Controls include IAM policies, CloudWatch events and alarms for monitoring as well as Config rules. Configuration templates are available in AWS CloudFormation, AWS CLI and Terraform

RDS
Aurora MySQL Cluster (w/ Secrets Manager)

Configuration template to launch an Aurora cluster with MySQL compatibility with one or more instances. The template also includes a new DB subnet group to specify the subnets for the cluster instances to be created as well as a new AWS Secrets Manager secret to store the password

CloudFormationTerraformAWS CLI
Aurora PostgreSQL Cluster (w/ Secrets Manager)

Configuration template to launch an Aurora cluster with PostgreSQL compatibility with one or more instances. The template also includes a new DB subnet group to specify the subnets for the cluster instances to be created as well as a new AWS Secrets Manager secret to store the password

CloudFormationTerraformAWS CLI
RDS MySQL Instance (w/ Secrets Manager)

Configuration template to launch an RDS instance running MySQL. The template also includes a new DB subnet group to specify the subnets for the cluster instances to be created as well as a new AWS Secrets Manager secret to store the password

CloudFormationTerraformAWS CLI
RDS PostgreSQL Instance (w/ Secrets Manager)

Configuration template to launch an RDS instance running PostgreSQL. The template also includes a new DB subnet group to specify the subnets for the cluster instances to be created as well as a new AWS Secrets Manager secret to store the password

CloudFormationTerraformAWS CLI
RDS MariaDB Instance (w/ Secrets Manager)

Configuration template to launch an RDS instance running MariaDB. The template also includes a new DB subnet group to specify the subnets for the cluster instances to be created as well as a new AWS Secrets Manager secret to store the password

CloudFormationTerraformAWS CLI
RDS MSSQL Instance (w/ Secrets Manager)

Configuration template to launch an RDS instance running Microsoft SQL Server Standard (Enterprise, Web and Express are also supported). The template also includes a new DB subnet group to specify the subnets for the cluster instances to be created as well as a new AWS Secrets Manager secret to store the password

CloudFormationTerraformAWS CLI
RDS DB Subnet Group

Create an RDS DB subnet group which is a collection of VPC subnets that are designated for database instances

CloudFormationTerraformAWS CLI
SQL Server DB Option Group Example

This template creates an option group that specifies the Microsoft SQL Server native backup and restore option for the SQL Server DB engine version 12.00. The option group has an option setting `IAM_ROLE_ARN` with a value of `arn:aws:iam::333333333333333:role/service-role/sqlserverrestore`.

CloudFormation
MySQL DB Option Group Example

This template creates an option group that specifies the `MEMCACHED` option for the MySQL DB engine version 8.0. The option group has a port number of 1234 and is associated with a VPC security group. The `MEMCACHED` option has two additional settings: `CHUNK_SIZE` with a value of 32 and `BINDING_PROTOCOL` with a value of `ascii`.

CloudFormation
Oracle DB Option Group Example

This template creates an option group with two option configurations (`OEM` and `APEX`). The option group is for the Oracle DB engine version 12.1. The `OEM` option has a port number of 5500 and is associated with the default DB security group. The `APEX` option does not have any additional properties.

CloudFormation
Secondary DB Cluster to Existing Global Cluster

This template creates a new Aurora DB cluster, attaches it to a global database cluster (ExistingGlobalClusterId) as a read-only secondary cluster, and adds a DB instance to the new DB cluster. It includes a parameter for the global cluster identifier. The resources created include the Aurora DB cluster and the DB instance.

CloudFormation
Global Database Cluster for Aurora PostgreSQL

This template creates a global database cluster with an Aurora PostgreSQL DB cluster and DB instance. The resources created include the global cluster, the Aurora PostgreSQL DB cluster, and the DB instance.

CloudFormation
Global Database cluster for Aurora MySQL

This template creates a global database cluster with an Aurora MySQL DB cluster and DB instance. The resources created include the global cluster, the Aurora MySQL DB cluster, and the DB instance.

CloudFormation
RDS DB Subnet Group

This template creates an RDS DB subnet group with two new subnets (in vpc-123456).

CloudFormation
RDS DB Security Group with Multiple VPC Security Groups

This template creates an RDS DB security group with multiple VPC security groups. The DB instance is associated with the security group using the `DBSecurityGroups` property. The security group allows ingress from two EC2 security groups specified by their IDs and owner IDs.

CloudFormation
Custom DB Proxy Endpoint

This template creates a custom DB proxy endpoint. It creates an AWS::RDS::DBProxyEndpoint resource with the specified properties. The properties include the DBProxyEndpointName, DBProxyName, VpcSubnetIds, VpcSecurityGroupIds, and TargetRole.

CloudFormation
RDS DB Proxy and Target Group

This template creates a DB proxy and registers a DB instance. It creates an AWS::RDS::DBProxy resource with properties such as DebugLogging, DBProxyName, EngineFamily, IdleClientTimeout, RequireTLS, Auth, and VpcSubnetIds. It also creates an AWS::RDS::DBProxyTargetGroup resource with properties such as DBProxyName, DBInstanceIdentifiers, TargetGroupName, and ConnectionPoolConfigurationInfo. It includes an IAM role to allow the template to access the secret which stores the RDS database password

CloudFormation
RDS DB Parameter Group

This template creates a custom parameter group for an RDS database family. The parameter group is created for a MySQL DB instance and sets the `sql_mode`, `max_allowed_packet`, and `innodb_buffer_pool_size` parameters.

CloudFormation
Cross-Region Encrypted Read Replica

This template creates an encrypted read replica from a cross-region source DB instance (SourceDBInstanceIdentifier). The template also creates a KMS key for encryption.

CloudFormation
RDS Instance with IAM Role for Enhanced Monitoring

This template creates an Amazon RDS MySQL DB instance with Enhanced Monitoring enabled. The DB instance is created with the specified parameters such as DB instance ID, DB name, DB instance class, allocated storage, username, and password. The template also specifies the engine version and the IAM role for Enhanced Monitoring.

CloudFormation
RDS DB Cluster Parameter Group

This template creates a new Amazon RDS DB cluster parameter group. The parameter group is created for an Aurora MySQL DB cluster and sets the `time_zone` and `character_set_database` parameters.

CloudFormation
DB Instance with Secret and Custom KMS Key

This template creates an AWS CloudFormation stack with the AWS::RDS::DBInstance resource. The DB instance is created with the specified parameters such as master username, DB instance class, engine, allocated storage, auto minor version upgrade, and manage master user password. The template also creates a KMS key for encryption and sets the master user secret to use the KMS key.

CloudFormation
Aurora Serverless v1 DB Cluster (w/ Secrets Manager)

This template creates an Amazon Aurora Serverless v1 DB cluster. The template includes a Secrets Manager secret for generating and storing the database password. The DB cluster uses the specified engine version and has a serverless engine mode. The scaling configuration is set to automatically pause the cluster after a specified number of seconds of inactivity.

CloudFormation
Aurora Serverless v2 DB Cluster (w/ Secrets Manager)

This template creates an Amazon Aurora Serverless v2 DB cluster. The template includes a Secrets Manager secret for generating and storing the database password, as well as the minimum and maximum capacity for the cluster. The DB cluster uses the specified engine version and the db.serverless instance class.

CloudFormation
Aurora DB cluster (w/ Secrets Manager) with Log Exports

This template creates an Amazon Aurora PostgreSQL DB cluster that exports logs to Amazon CloudWatch Logs. The template includes a Secrets Manager secret for generating and storing a password for the database. It also creates a cluster parameter group and a parameter group for configuring the cluster and instances. The DB instances are publicly accessible and use the db.r5.large instance class.

CloudFormation
Aurora DB Cluster with Two DB Instances and Parameter Group

This template creates an Amazon Aurora DB cluster with two DB instances. The template uses AWS Secrets Manager for storing the password. It also creates a cluster parameter group and a parameter group for configuring the cluster and instances. The DB instances are publicly accessible and use the db.r3.xlarge instance class.

CloudFormation
DMS
AWS DMS Replication Task

This template creates an AWS DMS replication task with the specified properties. The replication task is used to migrate data from a source endpoint to a target endpoint. The template includes the source endpoint ARN, target endpoint ARN, replication instance ARN, migration type, and table mappings.

CloudFormation
DMS Replication Subnet Group

This template creates an AWS DMS replication subnet group. The subnet group must contain at least two subnets in two different Availability Zones in the same AWS Region.

CloudFormation
DMS Replication Instance

This template creates an AWS DMS replication instance with the specified replication instance class.

CloudFormation
DMS Event Subscription

This template creates an event subscription for AWS Database Migration Service. It allows you to receive notifications for events related to the service through Amazon Simple Notification Service. The event subscription is associated with a specific replication instance and is configured to send notifications for specific event categories. The template also specifies the Amazon SNS topic ARN to which the notifications will be sent.

CloudFormation
DMS Endpoint

This template creates an AWS DMS endpoint with the specified properties. The endpoint is of type 'target' and uses the MySQL engine. It connects to the server 'server.db.amazon.com' on port 1234 with the provided username and password. The database name is 'my-db'. It also includes a tag with key 'type' and value 'new'.

CloudFormation
DMS Certificate

This template creates an SSL certificate for encrypting connections between AWS DMS endpoints and the replication instance.

CloudFormation
RDS Event Subscription
Custom RDS Event Subscription

Custom RDS Event Subscription template to allow users to configure notifications for RDS Events (provided through an SNS topic)

CloudFormationTerraformAWS CLI
RDS Cluster Event Subscription for Failure Events

RDS Event Subscriptions allow users to configure notifications for RDS Events (provided through an SNS topic). This template configures an event subscription for failure events for RDS Instances.

CloudFormationTerraformAWS CLI
RDS Instance Event Subscription for Failure, Low Storage and Availability Events

RDS Event Subscriptions allow users to configure notifications for RDS Events (provided through an SNS topic). This template configures an event subscription for failure, low storage, and availability event categories for RDS Instances.

CloudFormationTerraformAWS CLI
RDS Instance Event Subscription for Backup Events

RDS Event Subscriptions allow users to configure notifications for RDS Events (provided through an SNS topic). This template configures an event subscription for backup events for RDS Instances.

CloudFormationTerraformAWS CLI
RDS Instance Snapshot All Events Subscription

RDS Event Subscriptions allow users to configure notifications for RDS Events (provided through an SNS topic). This template configures an event subscription for RDS Snapshot events

CloudFormationTerraformAWS CLI
RDS Cluster Snapshot All Events Subscription

RDS Event Subscriptions allow users to configure notifications for RDS Events (provided through an SNS topic). This template configures an event subscription for RDS Cluster Snapshot events

CloudFormationTerraformAWS CLI
RDS DB Parameter Group Events Subscription for Configuration Change Events

RDS Event Subscriptions allow users to configure notifications for RDS Events (provided through an SNS topic). This template configures an event subscription for RDS Parameter Group configuration changes events

CloudFormationTerraformAWS CLI
RDS DB Security Group Event Subscription for Configuration Change Events

RDS Event Subscriptions allow users to configure notifications for RDS Events (provided through an SNS topic). This template configures an event subscription for RDS Security Group configuration changes events

CloudFormationTerraformAWS CLI
Config Rule
RDS Storage Encrypted Check

Checks whether storage encryption is enabled for your RDS DB instances.

CloudFormationTerraformAWS CLI
RDS Multi-AZ HA Enabled Check

Checks whether high availability is enabled for your RDS DB instances. (Note: This rule does not evaluate Amazon Aurora databases.)

CloudFormationTerraformAWS CLI
No RDS Instances in Public Subnets Check

Check that no RDS Instances are in Public Subnet.

CloudFormationTerraformAWS CLI
RDS Enhanced Monitoring Enabled

A config rule that checks whether enhanced monitoring is enabled for Amazon Relational Database Service (Amazon RDS) instances

CloudFormationTerraformAWS CLI
RDS Public Snapshots Prohibited Check

A Config rule that checks if Amazon Relational Database Service (Amazon RDS) snapshots are public. The rule is non-compliant if any existing and new Amazon RDS snapshots are public.

CloudFormationTerraformAWS CLI
RDS Backup Enabled Check

A config rule that checks whether RDS DB instances have backups enabled. Optionally, the rule checks the backup retention period and the backup window.

CloudFormationTerraformAWS CLI
RDS Instances Public Access Prohibited Check

A config rule that checks whether the Amazon Relational Database Service instances are not publicaly accessible. The rule is NON_COMPLIANT if the publiclyAccessible field is true in the instance configuration item.

CloudFormationTerraformAWS CLI
RDS Snapshot Encrypted Check

A config rule that checks whether Amazon Relational Database Service (Amazon RDS) DB snapshots are encrypted. The rule is NON_COMPLIANT, if Amazon RDS DB snapshots are not encrypted.

CloudFormationTerraformAWS CLI
RDS Cluster Deletion Protection Enabled

A config rule that checks if an Amazon Relational Database Service (Amazon RDS) cluster has deletion protection enabled. This rule is NON_COMPLIANT if an RDS cluster does not have deletion protection enabled.

CloudFormationTerraformAWS CLI
RDS Instance Deletion Protection Enabled

A config rule that checks if an Amazon Relational Database Service (Amazon RDS) instance has deletion protection enabled. This rule is NON_COMPLIANT if an Amazon RDS instance does not have deletion protection enabled i.e deletionProtection is set to false.

CloudFormationTerraformAWS CLI
RDS Instance IAM Authentication Enabled Check

A config rule that checks if an Amazon Relational Database Service (Amazon RDS) instance has AWS Identity and Access Management (IAM) authentication enabled. This rule is NON_COMPLIANT if an Amazon RDS instance does not have AWS IAM authentication enabled i.e configuration.iAMDatabaseAuthenticationEnabled is set to false.

CloudFormationTerraformAWS CLI
RDS Instance Logging Enabled Check

A config rule that respective logs of Amazon Relational Database Service (Amazon RDS) are enabled. The rule is NON_COMPLIANT if any log types are not enabled.

CloudFormationTerraformAWS CLI
RDS Database in AWS Backup Plan Check

A Config rule that checks whether Amazon RDS database is present in back plans of AWS Backup. The rule is NON_COMPLIANT if Amazon RDS databases are not included in any AWS Backup plan.

CloudFormationTerraformAWS CLI
RDS DB Security Group Not Allowed

A Config rule that checks if there are any Amazon Relational Database Service (RDS) DB security groups that are not the default DB security group. The rule is NON_COMPLIANT is there are any DB security groups that are not the default DB security group.

CloudFormationTerraformAWS CLI
RDS Instance Default Admin Check

A Config rule that checks if an Amazon Relational Database Service (Amazon RDS) database has changed the admin username from its default value. This rule will only run on RDS database instances. The rule is NON_COMPLIANT if the admin username is set to the default value.

CloudFormationTerraformAWS CLI
RDS Instance Default Admin Check

A Config rule that checks if an Amazon Relational Database Service (Amazon RDS) database has changed the admin username from its default value. This rule will only run on RDS database instances. The rule is NON_COMPLIANT if the admin username is set to the default value.

CloudFormationTerraformAWS CLI
Aurora MySQL Backtracking Enabled

A Config rule that checks if an Amazon Aurora MySQL cluster has backtracking enabled. This rule is NON_COMPLIANT if the Aurora cluster uses MySQL and it does not have backtracking enabled.

CloudFormationTerraformAWS CLI
RDS Automatic Minor Version Upgrade Enabled

A Config rule that checks if Amazon Relational Database Service (RDS) database instances are configured for automatic minor version upgrades. The rule is NON_COMPLIANT if the value of autoMinorVersionUpgrade is false.

CloudFormationTerraformAWS CLI
RDS Cluster IAM Authentication is Enabled

A Config rule that checks if an Amazon RDS Cluster has AWS Identity and Access Management (IAM) authentication enabled. The rule is NON_COMPLIANT if an RDS Cluster does not have IAM authentication enabled.

CloudFormationTerraformAWS CLI
Check if RDS cluster has default admin username

Checks if an Amazon Relational Database Service (Amazon RDS) database cluster has changed the admin username from its default value. The rule is NON_COMPLIANT if the admin username is set to the default value.

CloudFormation
RDS Cluster Encrypted at Rest

Checks if an Amazon Relational Database Service (Amazon RDS) cluster is encrypted at rest. The rule is NON_COMPLIANT if an Amazon RDS cluster is not encrypted at rest.

CloudFormation
Check if Multi-AZ replication is enabled on Amazon RDS clusters

Checks if Multi-Availability Zone (Multi-AZ) replication is enabled on Amazon Aurora and Hermes clusters managed by Amazon Relational Database Service (Amazon RDS). The rule is NON_COMPLIANT if an Amazon RDS instance is not configured with Multi-AZ.

CloudFormation