Currently, we use Snoopy to monitor all commands issued by users on some externally accessible servers. We're in the process of updating everything to RHEL8 to ensure supportability and compliance, and discovered that my beloved Snoopy is no longer maintained. So it won't pass the compliance audit and needs to be replaced.
I looked into using auditd to do it, by enabling "pam_tty_audit.so" in system-auth and password-auth. This did the trick, but the output is, well let's just say it's less then desirable. Not to mention basically unreadable.
I tried setting-up /etc/profile to log by adding this...
function log2syslog
{
declare COMMAND
COMMAND=$(fc -ln -0)
logger -p local1.notice -t bash -i -- "${USER}:${COMMAND}"
}
trap log2syslog DEBUG
And adding this to /etc/rsyslog.conf
local1.* -/var/log/cmdline
It works GREAT! But the solution was declined because it can be overridden by users.
I even tried using rootsh as a shell for users and logging that. Logs well, but there's no time/date stamps on it. So not acceptable.
So back to the question at hand. I need a replacement for Snoopy, that logs EVERY command executed, in a readable format with time/stamps, that users cannot override.
Any thoughts?