我想监视对 Linux 服务器中的文件所做的所有修改
在一些研究中,我发现我使用以下命令安装和配置了审计工具
yum install audit # installation
/etc/init.d/auditd start # started service
auditctl -w /root/file-name -p war -k password-file # configured rule to audit file
ausearch -f /root/file-name # Command to search modifications
Run Code Online (Sandbox Code Playgroud)
它记录了对特定文件所做的所有修改
一切都很好,直到我遇到以下
案例 1:我使用以下命令从服务器中删除了我正在使用审计监控的文件
rm -rf /root/file-name
Run Code Online (Sandbox Code Playgroud)
记录如下
type=SYSCALL msg=audit(1540222267.321:1057): arch=c000003e syscall=2 success=yes exit=3 a0=7ffe22abf91a a1=941 a2=1b6 a3=7ffe22abed70 items=2 ppid=21053 pid=42458 auid=14628 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=5 comm="touch" exe="/bin/rm" key="password-file"
案例 2:我使用以下命令从远程服务器删除了文件
ssh cl14470 "echo 'rm -rf /root/chaithu'|sudo …
Run Code Online (Sandbox Code Playgroud)