[MDEV-19458] server_audit plugin should log when the server starts up and when the server shuts down Created: 2019-05-13  Updated: 2022-11-07

Status: Open
Project: MariaDB Server
Component/s: Plugin - Audit
Fix Version/s: None

Type: Task Priority: Major
Reporter: Geoff Montee (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-5313 Improving audit api Stalled
relates to MDEV-5983 Auditing plugin v2.0 Closed
relates to MDEV-8491 On shutdown, report the user and the ... Closed

 Description   

The server_audit plugin does not currently log any audit events when the server starts up or shuts down.

It does not look like the audit plugin API has any hooks for start up or shut down events either.

Should we log startup events in mysql_audit_initialize() and shutdown events in mysql_audit_finalize(), so that the API can stay the same?



 Comments   
Comment by Alexey Botchkov [ 2019-05-16 ]

> Should we log startup events in mysql_audit_initialize() and shutdown events in mysql_audit_finalize(), so that the API can
> stay the same?

It makes sence to me.

Comment by Ralf Gebhardt [ 2019-05-28 ]

Hi holyfoot, GeoffMontee. Audits are typically about user activities on database objects and on accessing the server as such. A server startup or shutdown is more about monitoring a server instance. I would not mix these use cases. Also, are mysql_audit_initialize() and mysql_audit_finalize() really only called on Server startup and shutdown?

Comment by Geoff Montee (Inactive) [ 2019-05-28 ]

Hi ralf.gebhardt@mariadb.com,

Audits are typically about user activities on database objects and on accessing the server as such. A server startup or shutdown is more about monitoring a server instance. I would not mix these use cases.

I would personally consider issuing a shutdown/startup request to be a form of "accessing the server" as well as performing an activity that can potentially affect all "database objects".

Shutdowns and startups could definitely be relevant in an audit. Especially if the auditors suspect a rogue DBA of adding options to my.cnf or other configuration files as a way to bypass security mechanisms.

Also, are mysql_audit_initialize() and mysql_audit_finalize() really only called on Server startup and shutdown?

Yeah, it does appear so.

https://github.com/MariaDB/server/blob/mariadb-10.4.5/sql/mysqld.cc#L5630

https://github.com/MariaDB/server/blob/mariadb-10.4.5/sql/mysqld.cc#L1932

Comment by Alexey Botchkov [ 2019-05-31 ]

Hi, GeoffMontee, ralf.gebhardt@mariadb.com!
To me logging the server shutdowns/startups seems like a different level. User with such capabilities can do a lot more than just modify the .my.cnf file. Server can be started without the plugins for instance.
So it's difficult to rely on what's in the audit plugin log in this case.

Generated at Thu Feb 08 08:51:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.