请帮助我解决这个问题。我的问题是我需要收集他们从Linux服务器执行的管理命令的日志。例如:如果执行了sudo apt install命令,则应记录此操作,但如果只是执行apt install,则不记录。我使用了auditd实用程序和就绪规则:
## Root command executions
-a always,exit -F arch=b64 -F euid=0 -S execve -k rootcmd
-a always,exit -F arch=b32 -F euid=0 -S execve -k rootcmd
所有的规则都在这里(https://github.com/Neo23x0/auditd/blob/master/audit.rules),但有很多垃圾日志。我也尝试写过滤器,但由于某种原因,他们不工作或工作不正确。我需要输出格式:时间-命令-用户或类似的东西。可选与auditd,替代品是可能的。我测试了这个在ubuntu 20. 04。我将不胜感激,如果你告诉我!
1条答案
按热度按时间nx7onnlm1#
我使用python来减少auditd日志记录,但是我必须在2行中过滤数据。这个日志记录用于任何用户命令:
我使用以下审核规则:
现在您可以根据需要进行更改。