当前位置:网站首页>一文掌握mysql数据库审计特点、实现方案及审计插件部署教程
一文掌握mysql数据库审计特点、实现方案及审计插件部署教程
2022-07-26 07:35:00 【繁花即一梦】
概述
数据库审计(简称DBAudit)能够实时记录网络上的数据库活动,对数据库操作进行细粒度审计的合规性管理,对数据库遭受到的风险行为进行告警,对攻击行为进行阻断。它通过对用户访问数据库行为的记录、分析和汇报,用来帮助用户事后生成合规报告、事故追根溯源,同时加强内外部数据库网络行为记录,提高数据资产安全。
数据库审计是数据库安全技术之一,数据库安全技术主要包括:数据库漏扫、数据库加密、数据库防火墙、数据脱敏、数据库安全审计系统。
一、审计系统特点
完整性:独一无二的多层业务关联审计,可针对WEB层、应用中间层、数据层各层次进行关联审计
细粒度:细粒度的审计规则、精准化的行为检索及回溯、全方位的风险控制。
有效性:独有专利技术实现对数据库安全的各类攻击风险和管理风险的有效控制;灵活的、可自定义的审计规则满足了各类内控和外审的需求(有效控制误操作、越权操作、恶意操作等违规行为)
公正性:基于独立审计的工作模式,实现了数据库管理与审计的分离,保证了审计结果的真实性、完整性、公正性
零风险:无需对现有数据库进行任何更改或增加配置,即可实现零风险部署
高可靠:提供多层次的物理保护、掉电保护、自我监测及冗余部署,提升设备整体可靠性
易操作:充分考虑国内用户的使用和维护习惯,提供Web-based全中文操作界面及在线操作提示
二、实现mysql审计方案
mysql服务器自身没有提供审计功能,但是如果想实现MySQL数据库审计,一般有以下几种方法:
1)使用init-connect + binlog的方法进行mysql的操作审计
2)MySQL audit—SQL审计插件or第三方开源审计插件:libaudit_plugin.so 来完成MySQL的审计工作
3)基于360开源数据库流量审计MySQL Sniffer
4)使用ELK处理MySQL数据库审计日志(ELK日志分析功能是很强大的)
5)Mysql bin-log日志进行实时存储和行为分析 当触发设定的规则就实现记录和告警
6)开启mysql监控,实施监控日志和用户命令的操作 ,这类往往是一个平台或者软件开发结果集
三、sql审计插件
server_audit是一款内嵌在mariadb的审计插件,在mysql中同样适用,主要用于记录用户操作。
1、下载插件
到网站(https://bintray.com/version/files/mcafee/mysql-audit-plugin/release/1.1.7-805)下载插件audit-plugin-mysql-5.7-1.1.7-80

2、上传到服务器并解压缩
unzip audit-plugin-mysql-5.7-1.1.7-805-linux-x86_64.zip

3、查看mysql的插件目录:
show global variables like 'plugin_dir';

4、拷贝libaudit_plugin.so到mysql插件目录:
cp /opt/audit-plugin-mysql-5.7-1.1.7-805/lib/libaudit_plugin.so /usr/lib64/mysql/plugin/chmod 755 /usr/lib64/mysql/plugin/libaudit_plugin.so

5、安装libaudit_plugin.so插件
install plugin audit soname 'libaudit_plugin.so';--插件安装成功后有这些全局变量show variables like '%audit%';

6、开启审计功能
set global audit_json_file=1;--查看加载的插件select * from INFORMATION_SCHEMA.PLUGINS where PLUGIN_NAME like '%AUDIT%';

7、修改配置文件
在my.cnf增加如下内容,并重启数据库
#audit审计参数plugin-load=AUDIT=libaudit_plugin.soaudit_json_file=on #开启日志插件audit_json_log_file=/data/log/mysql-audit.json #记录文件的路径和名称信息audit_record_cmds='insert,delete,update,create,drop,alter,grant,truncate' #audit记录的命令
8、查看审计日志
tail -f /data/log/mysql-audit.json

觉得有用的朋友多帮忙转发哦!后面会分享更多devops和DBA方面的内容,感兴趣的朋友可以关注下~

边栏推荐
- 2022.7.22DAY612
- This section is for Supplement 2
- ARIMA model for time series analysis and prediction
- Singles cup web WP
- 动态性能视图概述
- 博途PLC一阶滞后系统传递函数阶跃响应输出仿真(SCL)
- C # use log4net to record logs (basic chapter)
- Keras learning part: obtaining the output results of neural network middle layer
- PostgreSQL UUID fuzzy search UUID string type conversion SQL error [42883] explicit type casts
- Network Trimming: A Data-Driven Neuron Pruning Approach towards Efficient Deep Architectures论文翻译/笔记
猜你喜欢

在线问题反馈模块实战(十四):实现在线答疑功能

JMeter性能测试之使用CSV文件参数化

依赖和关联的对比和区别

JWT快速入门

Examples of financial tasks: real-time and offline approval of three scenarios and five optimizations of Apache dolphin scheduler in Xinwang bank

JWT quick start

WCF 部署在IIS上

System architecture & microservices

Apache dolphin scheduler 2.x nanny level source code analysis, China Mobile engineers uncover the whole process of service scheduling and start

NFT digital collection system development: activating digital cultural heritage
随机推荐
力扣(LeetCode)206. 反转链表(2022.07.25)
KDD2022 | 揭秘快手短视频推荐Re-ranking之谜,相关推荐新SOTA
NFT digital collection system development: digital collections give new vitality to brands
DevExpress.XtraEditors.DataNavigator用法
Common templates for web development
pycharm常用快捷键
Wrong Addition
Come across the sea to see you
Taishan office lecture: word error about inconsistent values of page margins
ShardingSphere数据分片
2019 ZTE touyue · model compression scheme
Examples of financial tasks: real-time and offline approval of three scenarios and five optimizations of Apache dolphin scheduler in Xinwang bank
微服务feign调用时候,token丢失问题解决方案
OVSDB
Apache dolphin scheduler 2.x nanny level source code analysis, China Mobile engineers uncover the whole process of service scheduling and start
1.MySQL架构篇【mysql高级】
Wrong Addition
Command line execution and test report generation of JMeter performance test
Idea shortcut key
NFT digital collection development: Six differences between digital collections and NFT