[SOLVED] how to log all the commands executed by root
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 ?
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.
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
incoming ip
'last'?
Quote:
Originally Posted by me_spearhead
username (thru which su was executed)
PAM -> syslog?
Quote:
Originally Posted by me_spearhead
time and date
Syslog default timestamp?
Quote:
Originally Posted by me_spearhead
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
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?".
Distribution: Linux Mint,Fedora, openSUSE, RHEL, SLES, Scientific Linux
Posts: 71
Rep:
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.
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
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
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.
Distribution: Linux Mint,Fedora, openSUSE, RHEL, SLES, Scientific Linux
Posts: 71
Rep:
Quote:
Originally Posted by unSpawn
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
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.