mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
MDEV-12182 Add Client TCP Port Number to MySQL Audit Plugin Logs
In environments with load balancers or proxies, the audit plugin logs only the IP address, making it difficult to differentiate individual client connections from the same IP. Add a new 'port' field to the appropriate event objects to capture the client's TCP port number. Populate the port field with thd->port in the appropriate functions. The audit plugin receives and logs this port field along with other connection information, enabling better identification of individual client connections. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
This commit is contained in:
committed by
Sergei Golubchik
parent
c1f2b5a141
commit
1aba30b8f9
@@ -718,6 +718,7 @@ struct mysql_event_general
|
||||
unsigned long long general_time;
|
||||
unsigned long long general_rows;
|
||||
unsigned long long query_id;
|
||||
unsigned int port;
|
||||
MYSQL_CONST_LEX_STRING database;
|
||||
};
|
||||
struct mysql_event_connection
|
||||
@@ -737,6 +738,7 @@ struct mysql_event_connection
|
||||
unsigned int host_length;
|
||||
const char *ip;
|
||||
unsigned int ip_length;
|
||||
unsigned int port;
|
||||
MYSQL_CONST_LEX_STRING database;
|
||||
const char *tls_version;
|
||||
unsigned int tls_version_length;
|
||||
@@ -752,6 +754,7 @@ struct mysql_event_table
|
||||
const char *proxy_user;
|
||||
const char *host;
|
||||
const char *ip;
|
||||
unsigned int port;
|
||||
MYSQL_CONST_LEX_STRING database;
|
||||
MYSQL_CONST_LEX_STRING table;
|
||||
MYSQL_CONST_LEX_STRING new_database;
|
||||
|
Reference in New Issue
Block a user