標籤:外部 shared details 安裝 cafe linu soft 攻擊 mysq
一、簡介
Database Audit能夠即時記錄網路上的資料庫活動,對資料庫操作進行細粒度審計的合規性管理,對資料庫受到的風險行為進行警示,對攻擊行為進行阻斷,它通過對使用者訪問資料庫行為的記錄、分析和彙報,用來協助使用者事後產生合規報告、事故追根溯源,同時加強內外部資料庫網路行為記錄,提高資料資產安全。
MySQL企業版有此功能,屬於收費組件,此測試社會版使用第三方開源外掛程式。
二、
https://bintray.com/mcafee/mysql-audit-plugin/release/1.1.4-725#files
[[email protected] soft]# unzip audit-plugin-mysql-5.7-1.1.4-725-linux-x86_64.zip
cp libaudit_plugin.so /usr/local/mysql/lib/plugin/
chown -R mysql.mysql libaudit_plugin.so
chmod -R 755 libaudit_plugin.so
三、命令列安裝操作及報錯解決
mysql> INSTALL PLUGIN AUDIT SONAME ‘libaudit_plugin.so‘;
ERROR 29 (HY000): File ‘mysqld‘ not found (Errcode: 2 - No such file or directory)
mysql> INSTALL PLUGIN AUDIT SONAME ‘/opt/mysql/mysql-5.7.22-linux-glibc2.12-x86_64/lib/plugin/libaudit_plugin.so‘;
ERROR 1124 (HY000): No paths allowed for shared library
解決方案:
參考78827375
查看外掛程式功能是否開啟
#show variables like ""%audit%;
開啟外掛程式功能:
set global audit_json_file=1;
在MySQL資料目錄下,會多出一個mysql-audit.json審計日誌。
查看mysql-audit.json檔案,可以找到操作SQL語句的使用者名稱和IP地址,起到了對操作資料庫很好的監控效果。
MySQL Audit日誌審計