Quote:
Originally Posted by jcookeman
There is a way to tune it for root only. So, I will check this further and may even extend the source to only cover calls from OpenSSH.
|
As a dirty hack, you could have snoopy.c check for the existence of "SSH_CLIENT" or such, but someone could unset this environment variable and fork a sub-shell.
For /proc filesystems, I extended the code to see if the process is the ancestor of a certain named process. However, it is not fool-proof. For instance, its possible to run a process in the background, detached from any ancestor, and thus it would evade any such detection.
On the other hand, it might be possible to extend this code further to exclude processes that are children of, say, cron. But I would prefer to simply log the process with its associated caller. So, for instance, if the current process doesn't have a controlling terminal, find the oldest non-init ancestor process and log that information. This way things like logwatch can better decide how to deal with such info.
Check on the sourceforge bulletin boards for the patch I posted there.