tech:notes_auditd
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| tech:notes_auditd [2026/11/05 11:10] – Jean-Baptiste | tech:notes_auditd [2026/11/05 16:26] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 29: | Ligne 29: | ||
| ### Afficher / Ajouter / Supprimer des règles | ### Afficher / Ajouter / Supprimer des règles | ||
| + | |||
| + | |||
| + | `-F key=foo` est identique à `-k foo` | ||
| Lister les règles | Lister les règles | ||
| Ligne 38: | Ligne 41: | ||
| Ajouter des règles | Ajouter des règles | ||
| ~~~bash | ~~~bash | ||
| + | # Tracer les connexions IPv4 et IPv6 (appel système connect) | ||
| auditctl -a always,exit -F arch=b64 -S connect -k net_connect -F exe=/ | auditctl -a always,exit -F arch=b64 -S connect -k net_connect -F exe=/ | ||
| auditctl -a always,exit -F arch=b32 -S connect -k net_connect -F exe=/ | auditctl -a always,exit -F arch=b32 -S connect -k net_connect -F exe=/ | ||
| Ligne 64: | Ligne 68: | ||
| auditctl -R connect.rules | auditctl -R connect.rules | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | #### Autres | ||
| + | |||
| + | ~~~ | ||
| + | auditctl -a never,exit -S all -F path=/ | ||
| ~~~ | ~~~ | ||
| Ligne 82: | Ligne 93: | ||
| ~~~bash | ~~~bash | ||
| auditctl -W / | auditctl -W / | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Exemple de règles | ||
| + | |||
| + | ~~~bash | ||
| + | auditctl -a always,exit -S all -F exe=/ | ||
| ~~~ | ~~~ | ||
| Ligne 129: | Ligne 147: | ||
| ausearch -p $PID -i | ausearch -p $PID -i | ||
| ausearch -p $PID -i --success no | ausearch -p $PID -i --success no | ||
| + | |||
| + | # Network | ||
| + | auditctl -a always,exit -F arch=b64 -S socket, | ||
| + | auditctl -a always,exit -F arch=b32 -S socket, | ||
| # Networks syscalls 32bits app | # Networks syscalls 32bits app | ||
| - | auditctl -a always,exit -F arch=b32 -S socket, | + | auditctl -a always,exit -F arch=b32 -S socket, |
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ## augenrules | ||
| + | |||
| + | **Brouillon** | ||
| + | |||
| + | ~~~bash | ||
| + | augenrules --load | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Logs auditd | ||
| + | |||
| + | ~~~bash | ||
| + | > / | ||
| + | service auditd rotate | ||
| + | systemctl kill -s USR1 auditd | ||
| ~~~ | ~~~ | ||
| Ligne 147: | Ligne 189: | ||
| # auditctl -l | # auditctl -l | ||
| -a always,exit -F arch=b32 -S connect -F auid< | -a always,exit -F arch=b32 -S connect -F auid< | ||
| + | |||
| # auditctl -d always,exit -F arch=b32 -S connect -F ' | # auditctl -d always,exit -F arch=b32 -S connect -F ' | ||
| Error sending delete rule data request (No such file or directory) | Error sending delete rule data request (No such file or directory) | ||
tech/notes_auditd.1793873443.txt.gz · Dernière modification : de Jean-Baptiste
