Last active
August 19, 2017 10:53
-
-
Save progress44/0e1e7add0ba3062ebf0c2972a275d421 to your computer and use it in GitHub Desktop.
Audit ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# install | |
apt-get install auditd audispd-plugins | |
# show active rules | |
auditctl -l | |
# setting a watch on the file /etc/passwd | |
# listens for permissions change | |
# [r]ead, [w]rite, [a]ttribute change, e[x]ecute | |
auditctl -a exit,always -F path=/etc/passwd -F perm=wa | |
# get results from audit | |
ausearch -f /etc/passwd | |
# get system architecture | |
ARCH=`uname -m` | |
# getting the actual action | |
# from the ausearch we note the `syscall` value | |
# now translate that number to the action | |
ausyscall $ARCH SYS_CALL_INT | |
# refresh rules | |
auditctl -R /etc/audit/audit.rules | |
# delete all rules | |
auditctl -D | |
# use lynis for automated auditing | |
git clone [email protected]:CISOfy/lynis.git . | |
./lynis audit system |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment