Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
informatique:linux:auditctl [2015/04/14 08:30] benoit créée |
informatique:linux:auditctl [2018/09/06 19:10] (Version actuelle) |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
====== auditd ===== | ====== auditd ===== | ||
- | Permet de logger tous les processys lancé sous Linux. | + | Permet de logger tous les processus lancé sous Linux. |
+ | ==== Installation ==== | ||
Pour installer : | Pour installer : | ||
apt-get install auditd | apt-get install auditd | ||
+ | |||
+ | ==== Lancement en live ==== | ||
Pour lancer un audit : | Pour lancer un audit : | ||
auditctl -a task,always | auditctl -a task,always | ||
- | Pour consulter : | + | Pour tracer ce que fait le user www-data (uid 33) : |
- | ausearch -i -sc execve | + | auditctl -a exit,always -S all -F uid=33 |
+ | |||
+ | Pour tracer tous les fichiers ouverts par apache (www-data uid 33) : | ||
+ | auditctl -a always,exit -F arch=b64 -S open -S openat -F uid=33 | ||
+ | auditctl -a always,exit -F arch=b32 -S open -S openat -F uid=33 | ||
+ | |||
+ | ==== Configuration au lancement du système ==== | ||
+ | |||
+ | Il est possible d'indiquer les paramètres dans le fichier ''/etc/audit/audit.rules'', Exemple : | ||
+ | |||
+ | # This file contains the auditctl rules that are loaded | ||
+ | # whenever the audit daemon is started via the initscripts. | ||
+ | # The rules are simply the parameters that would be passed | ||
+ | # to auditctl. | ||
+ | |||
+ | # First rule - delete all | ||
+ | -D | ||
+ | |||
+ | # Increase the buffers to survive stress events. | ||
+ | # Make this bigger for busy systems | ||
+ | -b 1024 | ||
+ | |||
+ | # Feel free to add below this line. See auditctl man page | ||
+ | |||
+ | #-a exit,always -S all -F uid=33 | ||
+ | -a always,exit -F arch=b64 -S open -S openat -F uid=33 | ||
+ | -a always,exit -F arch=b32 -S open -S openat -F uid=33 | ||
+ | |||
+ | relancer le service : | ||
+ | /etc/init.d/auditd restart | ||
+ | |||
+ | ==== Rapport et logs ==== | ||
+ | Les logs générés se trouvent dans : ''/var/log/audit'' |