Done
Details
Assignee
Oleksandr KachanOleksandr KachanReporter
Lalit ChoudharyLalit ChoudharyFix versions
Priority
Medium
Details
Details
Assignee
Oleksandr Kachan
Oleksandr KachanReporter
Lalit Choudhary
Lalit ChoudharyFix versions
Priority
Smart Checklist
Smart Checklist
Smart Checklist
Created September 6, 2019 at 1:32 PM
Updated March 6, 2024 at 11:51 AM
Resolved August 8, 2023 at 5:58 AM
When running multiple percona server instances on a single machine and writing audit_log to SYSLOG (audit_log_handler =SYSLOG) there is no way to identify/differentiate audit log entries for a particular instance.
Example:
Running 2 percona server instance on the machine with the percona audit log plugin and the following setting.
Instance1: 192.168.0.128:5721
[mysqld] audit_log_handler =SYSLOG
Instance2: 192.168.0.128:8015
[mysqld] audit_log_handler =SYSLOG
Connecting form remote host: 192.168.0.185
mysql -h 192.168.0.128 -u msandbox -p -P 5721 mysql> create database remote_host
mysql -h 192.168.0.128 -u msandbox -p -P 8017 mysql> create database remote_node
Percona server Host: 192.168.0.128
/var/log/syslog:
------ PS instance1 audit log entry in syslog--- Sep 6 18:15:32 lalit-ThinkPad-T480 percona-audit: <AUDIT_RECORD>#012 <NAME>Query</NAME>#012 <RECORD>13_1970-01-01T00:00:00</RECORD>#012 <TIMESTAMP>2019-09-06T12:45:32 UTC</TIMESTAMP>#012 <COMMAND_CLASS>create_db</COMMAND_CLASS>#012 <CONNECTION_ID>5</CONNECTION_ID>#012 <STATUS>0</STATUS>#012 <SQLTEXT>create database remote_host</SQLTEXT>#012 <USER>msandbox[msandbox] @ [192.168.0.185]</USER>#012 <HOST></HOST>#012 <OS_USER></OS_USER>#012 <IP>192.168.0.185</IP>#012 <DB></DB>#012</AUDIT_RECORD> ----PS instance2 audit log entry in syslog------ Sep 6 18:48:23 lalit-ThinkPad-T480 percona-audit: <AUDIT_RECORD>#012 <NAME>Query</NAME>#012 <RECORD>8_1970-01-01T00:00:00</RECORD>#012 <TIMESTAMP>2019-09-06T13:18:23Z</TIMESTAMP>#012 <COMMAND_CLASS>create_db</COMMAND_CLASS>#012 <CONNECTION_ID>9</CONNECTION_ID>#012 <STATUS>0</STATUS>#012 <SQLTEXT>create database remote_node</SQLTEXT>#012 <USER>msandbox[msandbox] @ [192.168.0.185]</USER>#012 <HOST></HOST>#012 <OS_USER></OS_USER>#012 <IP>192.168.0.185</IP>#012 <DB></DB>#012</AUDIT_RECORD>
looking at the audit_log entries in Syslog, we can't differentiate which audit log entry belongs to which percona server instance.
It would good to have percona server host information while writing audit log details in SYSLOG.
Similar settings/options are available in mariaDB audit plugin.
syslog_host
Host from which the syslog entry was received.
syslog_ident
For identifying a system log entry, including the MariaDB server.
syslog_info
For providing information for identifying a system log entry.
serverhost
The MariaDB server host name.
https://mariadb.com/kb/en/library/mariadb-audit-plugin-log-format/