How to Configure RDS MySQL Audit Log
You turn on the rds mysql audit log by adding the MariaDB audit plugin to an option group. Then you link that option group to your database instance and send the logs to CloudWatch. Most teams set this up to meet security rules and track database changes. Still, teams often share database accounts across many engineers and apps. When everyone uses the same login, the log cannot show which person ran a query. How the native rds mysql audit log works Amazon RDS for MySQL does not turn on query
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You turn on the rds mysql audit log by adding the MariaDB audit plugin to an option group. Then you link that option group to your database instance and send the logs to CloudWatch. Most teams set this up to meet security rules and track database changes. Still, teams often share database accounts across many engineers and apps. When everyone uses the same login, the log cannot show which person ran a query.
How the native rds mysql audit log works
Amazon RDS for MySQL does not turn on query logging by default. Instead, it uses an option group feature to load the MariaDB audit plugin. You first create a custom option group that matches your database engine version. Next, you add the audit plugin option to that group and set your logging rules. You can choose to log sign-in events, failed logins, or every query that runs.
After you save the option group, you attach it to your database instance. The database then writes audit events to files stored on the host disk. To keep those files safe, you set up the instance to publish logs to CloudWatch. From CloudWatch, your security team can search events, set alerts, or move files to long-term storage. You can also filter the plugin settings to watch specific database users and skip noisy app traffic.
What native logging solves and where it falls short
Native audit logging gives you a record of activity inside the database engine. It captures the timestamp, the client IP address, the database account name, and the SQL text. This record helps teams pass audits and investigate incidents after a bad change happens. It also shows when someone tries to log in with a bad password.
Even with logging turned on, big gaps remain in day-to-day operations. First, the database only knows the local MySQL account name, not the real person behind a shared role. If five engineers share one admin login, the log blames all five for a dropped table. Second, native logs only record what happened after the query finishes running. They do not block a dangerous command or require a peer to approve a write query in flight.
Third, logging every query can expose private user data inside the log files themselves. When an engineer queries a customer table, sensitive values can show up in plain text or in query results. Masking tools that rewrite matched fields in results, like emails, phone numbers, card numbers, and national IDs, are missing here. Finally, turning on full query logging adds disk load and can slow down busy database instances.
Audit Log Integrity + MySQL Access Governance: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Choosing which events to record in production
Logging every single read and write query creates huge log files very fast. High-traffic apps run thousands of queries each second, which drives up storage costs. Because of this, many teams only log login events and table structure changes from app accounts. They save full query logging for human admin accounts that log in to fix issues.
To make this split work, you must stop humans from using app accounts. Every person and service needs a separate path and clear rules for database work. You also need a way to review risky queries before they change production data. Combining native engine logs with stronger controls over live sessions gives you both safety and clear records.
Inspect every MySQL query and response in flight
Static grants and network rules block bad logins. They cannot pause a risky query for review or mask emails in a result set. By design, hoop.dev sits inline in the MySQL protocol as a sidecar for your MySQL. For every plain query, prepared statement, or cursor an agent or human runs in production, hoop.dev decides to pass, mask, block, or hold it for review.
First, hoop.dev guardrails block banned actions before MySQL runs them, and an AI Analyzer you configure can score intent or escalate for approval. Next, hoop.dev data masking rewrites sensitive string columns in results in memory, and every verdict goes to the audit trail. Find the open-source binary on GitHub.
Frequently asked questions
Does turning on the RDS MySQL audit plugin require a database reboot?
Attaching a new option group with the audit plugin takes effect based on your maintenance settings. Always test option group changes on a staging instance first to check whether your engine version restarts connections.
Where can I view the audit log files after I turn them on?
You can view and download the log files directly from the RDS console. You can also turn on log exports so the database sends audit events straight to CloudWatch Logs.
Why do my audit logs show the same username for different engineers?
MySQL only logs the database account used to open the session. If your team shares one admin password, the native log cannot tell which person ran each command.
Related guides
In this post