mysql审计插件
https://github.com/mcafee/mysql-audit/
一、安装
二、使用()
https://github.com/mcafee/mysql-audit/
一、安装
下载对应版本:https://bintray.com/mcafee/mysql-audit-plugin/release
解压后将so文件拷贝到plugins所在目录(show global variables like 'plugin_dir';)
两种方式:
1. 编辑my.cnf
[mysqld]中增加配置plugin-load=AUDIT=libaudit_plugin.so
2. 命令行
INSTALL PLUGIN AUDIT SONAME 'libaudit_plugin.so';
验证:
show plugins; 是否存在AUDIT 插件
注册失败异常:
1、my.cnf的[mysqld]关闭checksum
audit_validate_checksum=OFF
二、使用()
注册成功后默认不会生效,需要手动在[mysqld]配置参数。主要参数:
audit_json_file = 1
audit_json_log_file = */mysql-audit.json
audit_json_socket = 1
audit_json_socket_name = **
# 强制记录登录相关操作
audit_force_record_logins = 1
# 白名单:命令
audit_whitelist_cmds = select
# 白名单:用户
audit_whitelist_users = dhdba,dhods
# 指定需要记录的命令,逗号分隔
audit_record_cmds = insert,update,delete
# 指定需要记录的表, 逗号分隔.格式:db.table,支持模糊匹配, 例如 *.mytable or mydb.*
audit_record_objs = *.*
# 需要处理password的命令,逗号分隔, 防止密码被明文记录在日志里
audit_password_masking_cmds = CREATE_USER,GRANT,SET_OPTION,SLAVE_START,CREATE_SERVER,ALTER_SERVER,CHANGE_MASTER
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26250550/viewspace-1815630/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26250550/viewspace-1815630/