Код: Выделить всё
root@localhost:~# ls -l
total 4
-rw-------. 1 root root 791 Jun 20 23:36 anaconda-ks.cfg
drwxr-xr-x. 2 root root 6 Jun 21 22:59 testing
root@localhost:~# ls -l testing
total 0
root@localhost:~#
Код: Выделить всё
root@localhost:~# cat /etc/audit/audit.rules
## This file is automatically generated from /etc/audit/rules.d
-D
-a task,never
-w /root/testing/ -p rwxa -k testing
Код: Выделить всё
root@localhost:~# service auditd status
Redirecting to /bin/systemctl status auditd.service
● auditd.service - Security Audit Logging Service
Loaded: loaded (/usr/lib/systemd/system/auditd.service; enabled; preset: enabled)
Drop-In: /usr/lib/systemd/system/service.d
└─10-timeout-abort.conf
Active: active (running) since Fri 2024-06-21 23:02:04 CST; 36s ago
Docs: man:auditd(8)
https://github.com/linux-audit/audit-documentation
Process: 792 ExecStart=/usr/sbin/auditd (code=exited, status=0/SUCCESS)
Main PID: 796 (auditd)
Tasks: 4 (limit: 2257)
Memory: 2.8M (peak: 3.4M)
CPU: 23ms
CGroup: /system.slice/auditd.service
├─796 /usr/sbin/auditd
└─798 /usr/sbin/sedispatch
Jun 21 23:02:04 localhost systemd[1]: Starting auditd.service - Security Audit Logging Service...
Jun 21 23:02:04 localhost auditd[796]: audit dispatcher initialized with q_depth=2000 and 1 active plugins
Jun 21 23:02:04 localhost auditd[796]: Init complete, auditd 4.0.1 listening for events (startup state enable)
Jun 21 23:02:04 localhost systemd[1]: Started auditd.service - Security Audit Logging Service.
root@localhost:~#
root@localhost:~# auditctl -l
-a never,task
-w /tmp/testing -p rwxa -k testing
Код: Выделить всё
root@localhost:~/testing# ls /root/testing
bar.txt foo.txt
root@localhost:~/testing# cat bar.txt
bar.txt
root@localhost:~/testing# cat foo.txt
foo.txt
Код: Выделить всё
root@localhost:~/testing# rm -f bar.txt
root@localhost:~/testing# ls /root/testing
foo.txt
Код: Выделить всё
root@localhost:~/testing# grep "testing" /var/log/audit/audit.log
type=CONFIG_CHANGE msg=audit(1718981523.208:192): auid=4294967295 ses=4294967295 subj=system_u:system_r:unconfined_service_t:s0 op=add_rule key="testing" list=4 res=1AUID="unset"
Подробнее здесь: https://stackoverflow.com/questions/786 ... s-expected
Мобильная версия