MySQL Audit日誌審計

來源:互聯網
上載者:User

標籤:外部   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日誌審計

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.