On Monday, October 4, 2021, RDS (Amazon Relational Database Service) allows clients to scale and manage relational databases in the cloud. Amazon RDS API calls made by or on behalf of an AWS account are logged by AWS CloudWatch. After that, the data is saved in an Amazon S3 bucket.
Monitoring is a crucial component of keeping Amazon RDS and your AWS solutions reliable, available, and efficient. If a multi-point failure occurs, you should collect monitoring data from all aspects of your AWS solution so that you can more effectively debug it.
The activity of Amazon RDS DB instances can be monitored by Wazuh using the custom rules and decoders. Wazuh will collect the RDS Logs from the Amazon CloudWatch Logs as configured above.
AWS RDS Configuration
The logs for the RDS should be exported via the following options so that it can be pushed in the Amazon CloudWatch Logs.
Wazuh configuration for AWS RDS
Login to your Invinsense Portal and open Wazuh
Logs from AWS CloudWatch can be accessed by configuring CloudWatch to store them in a bucket or by using the CloudWatch Logs Agent. Wazuh can retrieve those logs, analyse them, and raise alerts if necessary, via the AWS API.
The CloudWatch service needs to be configured for wazuh to monitor the logs from it, add the following configuration block in /var/ossec/etc/ossec.conf file or configure it via the WUI.
To get the logs from RDS for the User-actions and Errors, we’ll use the below decoders and rules and will place it in local_decoder.xml and local_rules.xml files.
Add the following decoders in the /var/ossec/etc/decoders/local_decoders.xml file or use the WUI
After the changes done in the configuration, the wazuh-manager’s service needs to be restarted.
For Systemd:
systemctlrestartwazuh-manager
For SysV Init:
servicewazuh-managerrestart
You can test the RAW logs to confirm if the decoders and rules are properly working or not.
Once the configuration is done the logs will be collected by Wazuh and the alerts will be shown.
You can create custom Dashboards according to your needs.
Conclusion
Using Wazuh and CloudWatch, we can analyze AWS RDS events of high relevance to keep track of everything that happens in your Amazon Relational Database Service. You can do this for Audit logs, General logs and Slow Query logs as well.
We use cookies to provide you with the best possible experience. They also allow us to analyze user behavior in order to constantly improve the website for you.