AIDE 系统入侵检测
Advanced Intrusion Detection Environment
是系统自带的一个入侵检测工具,主要目的是检查文件的一致性,包括文件是否被更改,文件属性是否发生变化,
文件被修改的时间等。一旦出现AIDE监控的文件被篡改的情况,就会发出警告,通知系统管理员。
6.1 配置AIDE
6.1.1安装包:]# yum -y install aide
6.1.2 查看配置文件/etc/aide.conf 里的默认规则
]# cat /etc/aide.conf | grep -A20 ‘These’
##These are the default rules.
6.1.3 aide常用的命令
aide : -i, --init 初始化数据库
-C , – check 检查数据库
-u , --update 更新数据库
6.1.4 配置监控规则
例如,监控/etc/shadow 文件为例
——先修改配置文件/etc/aide.conf 将88行之后的内容全部注释掉#,
然后再结尾添加:/etc/shadow NORMAL
6.1.5 测试
]# aide --init 初始化数据库
]# useradd testuser 创建一个测试用户
]# aide --check 检查数据库
Couldn’t open file /var/lib/aide/aide.db.gz for reading 报错:
因为没有aide.db.gz文件,此时还不能对文件进行监控
]# cd /var/lib/aide/
aide]# mv aide.db.new.gz aide.db.gz
aide]# ll
aide]# aide -