AWS Security Hub · RDS
RDS.9: RDS engine logs are not shipped to CloudWatch
Written and reviewed by Emnode · Last reviewed
What does AWS Security Hub RDS.9 check?
RDS.9 checks whether an RDS DB instance publishes its engine logs to CloudWatch Logs. It reports FAILED when EnabledCloudwatchLogsExports is empty — nothing is being shipped off the instance for that engine.
Why does RDS.9 matter?
By default RDS engine logs (PostgreSQL's postgresql.log, MySQL's error and slow logs, Oracle's alert log, SQL Server's error log) live only on the instance's local disk and rotate away on a size or time schedule. They vanish silently before most incidents, and they die entirely when the instance is replaced by a failover, scale-up, or blue/green cutover. Without central export you cannot retain, query, or alert on them — and most frameworks (SOC 2, HIPAA, PCI DSS) require centralised database log retention.
How do I fix RDS.9?
- Pick the log types worth exporting per engine — error and slowquery for MySQL, the postgresql stream for PostgreSQL; avoid the high-volume general log in production.
- Run modify-db-instance --cloudwatch-logs-exports-configuration to enable them, tuning verbosity in the parameter group in the same change.
- Immediately call put-retention-policy on each new log group — the default is Never Expire, which compounds the bill forever.
- Add the AWS Config rule rds-logging-enabled so new instances are caught automatically.
Remediation script · bash
# Enable CloudWatch log export on a flagged RDS instance, then cap retention.
aws rds modify-db-instance \
--db-instance-identifier prod-orders-pg \
--cloudwatch-logs-exports-configuration 'EnableLogTypes=["postgresql","upgrade"]' \
--apply-immediately
aws logs put-retention-policy \
--log-group-name /aws/rds/instance/prod-orders-pg/postgresql \
--retention-in-days 90
# Enable audit logging on a Redshift cluster to a policy-attached S3 bucket.
aws redshift enable-logging \
--cluster-identifier analytics-prod \
--bucket-name redshift-audit-logs-acct123 \
--s3-key-prefix analytics-prod/ Full walkthrough (console steps, edge cases and verification) in the lesson Enable database audit and log exports.
Is RDS.9 a false positive?
Enabling an export but skipping put-retention-policy clears the finding while leaving a Never Expire log group — technically passing RDS.9 but not satisfying the retention intent auditors actually care about.
More RDS controls
- RDS.1 An RDS snapshot is shared publicly
- RDS.2 An RDS instance is publicly accessible from the internet
- RDS.3 RDS DB instances should be encrypted at rest
- RDS.4 RDS snapshots should be encrypted at rest
- RDS.5 RDS DB instances should use multiple AZs
- RDS.6 RDS lacks enhanced monitoring
- RDS.7 RDS clusters should have deletion protection
- RDS.8 RDS DB instances should have deletion protection
- RDS.10 RDS relies on long-lived database passwords
- RDS.11 RDS instances should have automatic backups
- RDS.12 IAM auth should be configured for RDS clusters
- RDS.13 RDS is not receiving automatic minor security patches