Logging shell history on Solaris.
Feb. 9th, 2006 05:56 pmThe audit department wants us to log all shell commands entered by root. So I need to log root's shell history on Solaris 8, in all of ksh, csh and bash.
Has anyone actually done this? Is there a built-in mechanism I've overlooked? Any speculation on how it might be done if you haven't done it? I can't seem to get a named pipe to work.
(no subject)
Date: 2006-02-09 06:09 pm (UTC)(no subject)
Date: 2006-02-09 06:26 pm (UTC)(no subject)
Date: 2006-02-09 06:44 pm (UTC)Surely what an auditing department needs is more detail, much more detail, in fact so much detail that they haven't a hope in hell of sorting the wood from the trees.
Once it's established that auditing never highlights problems that were clearly in the log files they'll be declared ineffective and abolished.
(no subject)
Date: 2006-02-09 06:52 pm (UTC)(no subject)
Date: 2006-02-09 07:00 pm (UTC)Although I was being silly about the auditing dept. being abolished, it's more likely to be quadrupled. Still, one can but hope.
(no subject)
Date: 2006-02-09 06:45 pm (UTC)(no subject)
Date: 2006-02-09 07:03 pm (UTC)(no subject)
Date: 2006-02-09 07:04 pm (UTC)(no subject)
Date: 2006-02-10 09:24 am (UTC)sudoscript?
Date: 2006-02-09 07:11 pm (UTC)It appears to be the one I saw written up in a Usenix journal a few years back, which basically ran sudo to get root (or whatever) and logged all the shell commands before executing it.
For auditing purposes you'd need to defeat the ability to direcly become root as well. (Including presumably single user mode -- but typically anyone that can reach single user mode can, eg, boot off other media too.)
Ewen
(no subject)
Date: 2006-02-09 07:26 pm (UTC)If you have all your console serial lines on a console server, you can get the console server to log all serial output to a log server, so you would see all single-user/fsck/reboot stuff that was performed on the console.
(no subject)
Date: 2006-02-09 08:16 pm (UTC)(no subject)
Date: 2006-02-10 12:14 am (UTC)The Plod like printed things.
(no subject)
Date: 2006-02-09 10:57 pm (UTC)I take it they've had it explained to them that once someone has root all bets are off? Of course they have and, being auditors, they chose to proceed with wasting everyone's time anyway.
I think the sudo+logging suggestion is the most elegant but it will require a bit of retraining for the sysadmins.
Upgrade everything to Solaris 10 and use RBAC instead - Sun marketing tells me it will abolish child poverty too ;)
(no subject)
Date: 2006-02-10 04:46 pm (UTC)(no subject)
Date: 2006-02-09 11:45 pm (UTC)Yeah baby, take it deep.
Suffer bitch.
ajohnymous, CISA, CIA
P.S. I also need that log sent real-time to a remote logserver over which no one with root access to the logged box also has root access -- since it doesn't make much sense to log root commands ON a box over which one has root access. After all, it can't be too hard to do something like:
stop logger
vi log (delete, delete, delete)
start logger
Oh yeah, and just in case someone with root access -- who could be inclined to stopping, editing, and restarting the log on the local machine -- might also try to avoid making tracks on the remote logging server by disrupting connectivity to it (say by disrupting a cable, or injecting a misdirecting route or ARP entry somewhere along the network path) , I also need to you set up some sort of perpetual connectivity detection system between the logged box and the logging server. If connectivity is lost between the two for, say five seconds or more, we're going to need some sort of alert to go off down in the audit department -- a flashing light and a noticeable, yet not too annoying tone would do well.
(no subject)
Date: 2006-02-10 12:00 am (UTC)(no subject)
Date: 2006-02-10 12:15 am (UTC)I shouted at them.
They gave us a good write-up.
So the moral of the story is - show up the auditors to be sloppy and then you don't need to do anything for them ever again.