首先,安装aide
yum install aide
然后编辑aide配置文件
vim /etc/aide.conf
在其中追加一行,具体语法参见里边的rules
/etc/testaide.txt PERMS
注意,aide默认书写了多个系统文件,我们测试过程中把剩下的全部注释掉,否则初始化过程要跑很久
初始化数据:
aide –init (就是记录一下初始状态,否则怎么知道变还是没变)
然后
设置我们将来要要用来对比的数据库
mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz
好了,现在我们对我们的文件进行修改下权限
chmod 777 /etc/testaide.txt
然后我们这个时候再运行
aide -C
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
AIDE 0.15.1 found differences between database and filesystem!! Start timestamp: 2016-01-08 10:25:38 Summary: Total number of files: 3 Added files: 0 Removed files: 0 Changed files: 1 --------------------------------------------------- Changed files: --------------------------------------------------- changed: /etc/testaide.txt --------------------------------------------------- Detailed information about changes: --------------------------------------------------- File: /etc/testaide.txt Perm : -rw-r--r-- , -rwxrwxrwx ACL : old = A: ---- user::rw- group::r-- other::r-- ---- D: <NONE> new = A: ---- user::rwx group::rwx other::rwx ---- D: <NONE> |
这个时候如果我们再修改下内容,echo 111 > /etc/testaide.txt,发现内容并没有变化,这是因为我们没有监控除权限外的其它
如果向监控内容等变化
/etc/testaide.txt NORMAL
Latest posts by Zhiming Zhang (see all)
- aws eks node 自动化扩展工具 Karpenter - 8月 10, 2022
- ReplicationController and ReplicaSet in Kubernetes - 12月 20, 2021
- public key fingerprint - 5月 27, 2021