Control: 42 RDS for MariaDB DB instances should publish logs to CloudWatch Logs
Description
This control checks whether an Amazon RDS for MariaDB DB instance is configured to publish certain types of logs to Amazon CloudWatch Logs. The control fails if the MariaDB DB instance isn't configured to publish the logs to CloudWatch Logs. You can optionally specify which types of logs a MariaDB DB instance should be configured to publish.
Database logging provides detailed records of requests made to an Amazon RDS for MariaDB DB instance. Publishing logs to Amazon CloudWatch Logs centralizes log management and helps you perform real-time analysis of the log data. In addition, CloudWatch Logs retains the logs in durable storage, which can support security, access, and availability reviews and audits. With CloudWatch Logs, you can also create alarms and review metrics.
Remediation
For information about configuring an Amazon RDS for MariaDB DB instance to publish logs to Amazon CloudWatch Logs, see Publishing MariaDB logs to Amazon CloudWatch Logs in the Amazon Relational Database Service User Guide.
Usage
Run the control in your terminal:
powerpipe control run aws_compliance.control.foundational_security_rds_42
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_compliance.control.foundational_security_rds_42 --share
SQL
This control uses a named query:
select arn as resource, case when engine <> 'mariadb' then 'skip' when enabled_cloudwatch_logs_exports ?& array ['audit','error','general','slowquery'] then 'ok' else 'alarm' end as status, case when engine <> 'mariadb' then title || ' is of ' || engine || ' type.' when enabled_cloudwatch_logs_exports ?& array ['audit','error','general','slowquery'] then title || ' logging enabled.' else title || ' logging disabled.' end as reason , region, account_idfrom aws_rds_db_instance;