LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-11-2010, 01:49 PM   #1
me_spearhead
Member
 
Registered: Feb 2007
Distribution: SUSE Linux, & Redhat Variants
Posts: 59

Rep: Reputation: 15
how to log all the commands executed by root


Hi

I want to get a of log all the commands executed by the root user with the following details :

incoming ip
username (thru which su was executed)
time and date
all the commands executed as mentioned above.

Also if user has managed to login as root, he should not be able to disable / delete the above info. Can this info be collected at some other physical server ?
 
Old 08-11-2010, 02:24 PM   #2
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
You're looking for something like SELinux (Security Enhanced Linux) developed by the NSA. It's where people can change their user ID (such as su into root) but still remain identified as the same user through their security ID. or something like that.

I don't have much experience with SELinux but I know it can do what you want if you choose to learn more.

http://www.nsa.gov/research/selinux/

A lot of distros provide binary packages for SEL so check your local distro repositories.
 
Old 08-11-2010, 04:19 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by me_spearhead View Post
I want to get a of log all the commands executed by the root user
Why and what have you tried wrt log correlation already?


Quote:
Originally Posted by me_spearhead View Post
incoming ip
'last'?


Quote:
Originally Posted by me_spearhead View Post
username (thru which su was executed)
PAM -> syslog?


Quote:
Originally Posted by me_spearhead View Post
time and date
Syslog default timestamp?


Quote:
Originally Posted by me_spearhead View Post
all the commands executed as mentioned above.
Psacct (commands only, no details), shell history (weak "evidence") Rootsh (timstamp, commands, output), Auditd (detailed: see the se.* reporting tools) or FUSE LoggedFS (detailed as well, see this for an example).


Quote:
Originally Posted by me_spearhead View Post
Also if user has managed to login as root, he should not be able to disable / delete the above info. Can this info be collected at some other physical server ?
Unless you run a SELinux "true" MLS policy or other DAC prevention root can modify everything so while you can still use remote syslog, with root being omnipotent the question becomes "will the logs actually arrive there, how do I notice and how do I respond if they don't?".
 
Old 08-12-2010, 03:34 AM   #4
rgdacosta
Member
 
Registered: Jun 2007
Location: South Africa
Distribution: Linux Mint,Fedora, openSUSE, RHEL, SLES, Scientific Linux
Posts: 71

Rep: Reputation: 25
If you're really serious about tracking who has done what across many *nix boxes I'd suggest you have a look at a product called Privileged User Manager (PUM) from Novell.

http://www.novell.com/products/privilegedusermanager/

You can download it from download.novell.com
 
Old 08-12-2010, 03:21 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by rgdacosta View Post
If you're really serious about tracking who has done what across many *nix boxes
What's the measure? How "serious" does one need to be?


Quote:
Originally Posted by rgdacosta View Post
I'd suggest you have a look
Because you're familiar with the product, right? I mean you've deployed the manager and agents, designed rules and so on?
BTW, is it better than any other Privileged Account/Identity/User Management suites?


Quote:
Originally Posted by rgdacosta View Post
You can download it from download.novell.com
Can you? I though you could only D/L the evaluation but have to buy the product.
 
Old 08-13-2010, 04:19 AM   #6
rgdacosta
Member
 
Registered: Jun 2007
Location: South Africa
Distribution: Linux Mint,Fedora, openSUSE, RHEL, SLES, Scientific Linux
Posts: 71

Rep: Reputation: 25
Quote:
Originally Posted by unSpawn View Post
What's the measure? How "serious" does one need to be?
Good corporate governance and your needs to be compliant with regulations such as Sarbanes/Oxley and Basel II, HSPD-12 (government), FFIEC banking), HIPAA (healthcare), FERPA (education).

I'm not going to implement a solution like PUM to track who is doing what on a handful of boxes. For an enterprise solution whereby many boxes need to be audited it is an effective solution to your auditing needs.

Quote:
Originally Posted by unSpawn View Post
Because you're familiar with the product, right? I mean you've deployed the manager and agents, designed rules and so on?
BTW, is it better than any other Privileged Account/Identity/User Management suites?
That can be quantified based on compliance and ease of use.

Quote:
Originally Posted by unSpawn View Post
Can you? I though you could only D/L the evaluation but have to buy the product.
Yeah it is an evaluation download which is valid for 60 days.

Last edited by rgdacosta; 08-13-2010 at 04:20 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a script that will log into root and enter password and then run commands. tananthulus Linux - Newbie 8 11-02-2009 05:37 PM
Log all commands executed by any user? Possible helptonewbie Linux - Security 25 09-01-2009 08:34 AM
How to Display Commands to be Executed with At lrt Linux - Software 1 04-11-2008 11:26 AM
View commands being executed in Xwindows DMeerholz Linux - Software 1 06-20-2007 07:40 AM
Commands executed at boot time Johnburrell Linux From Scratch 3 09-18-2005 01:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration