More Info:
Amazon RDS sends general, slow query, audit and error logs from your MySQL, Aurora and MariaDB databases to AWS CloudWatch Logs. Broadcasting these logs to CloudWatch allows you to maintain continuous visibility into database activity, query performance and errors within your RDS database instances.Risk Level
LowAddress
Operational Maturity, Reliability, SecurityCompliance Standards
- APRA CPS 234 (Australia)
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS Critical Security Controls v8
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- DPDPA
- Digital Operational Resilience Act (EU)
- Essential 8
- HITRUST CSF
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIS2 Directive
- NIST CSF
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- PCI
- Reserve Bank of India (RBI) Cyber Security Framework
- SOC2
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- Securities and Exchange Board of India (SEBI) - Cloud Security Adoption Framework
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
To remediate the misconfiguration of log exports not being enabled for an AWS RDS instance, you can follow these steps using the AWS Management Console:
- Login to AWS Console: Go to the AWS Management Console (https://aws.amazon.com/console/) and log in to your account.
- Navigate to RDS Service: Click on the “Services” dropdown menu at the top left corner of the console. Under the “Database” section, click on “RDS” to open the Amazon Relational Database Service dashboard.
- Select the RDS Instance: From the list of RDS instances, select the instance for which you want to enable log exports by clicking on its name.
- Enable Enhanced Monitoring: In the RDS instance dashboard, scroll down to the “Logs & events” section. Click on the “Modify” button.
- Enable Log Exports: In the “Modify DB instance” page, scroll down to the “Monitoring & logging” section. Check the box next to “Enhanced monitoring” to enable it.
- Configure Log Exports: Under the “Enhanced monitoring” section, you can configure the log types that you want to export. Select the log types (e.g., slow query logs, audit logs) that you want to export.
- Save Changes: Scroll down to the bottom of the page and click on the “Continue” button. Review the changes you have made, and click on the “Modify DB instance” button to save the changes.
- Verify Log Exports: Once the changes are saved, AWS will start exporting the selected logs from your RDS instance. You can verify the log exports by checking the log destination you have configured (e.g., CloudWatch Logs).
Using CLI
Using CLI
To remediate the misconfiguration of enabling log exports for AWS RDS using AWS CLI, follow these step-by-step instructions:
-
Enable Enhanced Logging: First, enable Enhanced Logging for your RDS instance. This will allow you to export the logs to CloudWatch Logs.
Replace
YOUR_DB_INSTANCE_IDENTIFIERwith the identifier of your RDS instance,YOUR_CLOUDWATCH_ROLE_ARNwith the ARN of the IAM role that has permission to write logs to CloudWatch Logs, andYOUR_INTERVALwith the interval at which logs should be sent to CloudWatch Logs. -
Configure Log Exports: Next, configure the log exports for your RDS instance. You can specify which logs you want to export (error, slow query, general logs, etc.).
Replace
YOUR_DB_INSTANCE_IDENTIFIERwith the identifier of your RDS instance. In theEnableLogTypesarray, specify the types of logs you want to export. -
Verify Configuration: You can verify that the log exports are enabled for your RDS instance by describing the instance.
This command will provide detailed information about your RDS instance, including the log export configuration.
Using Python
Using Python
To enable log exports for AWS RDS using Python, you can use the AWS SDK for Python (Boto3). Here are the step-by-step instructions to remediate this misconfiguration:
-
Install Boto3: If you haven’t already installed Boto3, you can install it using pip:
- Configure AWS Credentials: Make sure you have your AWS credentials configured either through environment variables, shared credentials file, or IAM role.
- Use the following Python script to enable log exports for AWS RDS:
-
Replace
'your_rds_instance_identifier'with the actual identifier of your RDS instance and update thelog_typeslist with the specific log types you want to export (e.g., error, general, slowquery). - Run the Python script to enable log exports for the specified RDS instance.
Using Terraform
Using Terraform
enabled_cloudwatch_logs_exports does not force replacement of the DB instance, but it does overwrite the existing log export set; verify that the listed log types are supported for your engine and that all currently enabled logs are included.To verify, terraform plan should show an in-place update on aws_db_instance.MYSQL_RDS_INSTANCE with enabled_cloudwatch_logs_exports changing from its current value to ["audit", "error", "general", "slowquery", ...] and (optionally) apply_immediately set as configured.
