Audit useradd/userdel - Solaris 11


 
Thread Tools Search this Thread
Operating Systems Solaris Audit useradd/userdel - Solaris 11
# 1  
Old 06-01-2018
Audit useradd/userdel - Solaris 11

Linux audits in syslog, any time a user is deleted or added. However, I'm running a Solaris11 VM, and find no such entries. How can I enable auditing for useradd and userdel? Oracle's documentation on managing the auditing service, has been of no assistance. Thanks.


Customizing What Is Audited -
Managing Auditing in Oracle(R) Solaris 11.3


CentOS, provides with nice and neat results:
Code:
# grep useradd /var/log/*
grep: /var/log/anaconda: Is a directory
grep: /var/log/audit: Is a directory
grep: /var/log/chrony: Is a directory
grep: /var/log/httpd: Is a directory
grep: /var/log/mariadb: Is a directory
grep: /var/log/qemu-ga: Is a directory
grep: /var/log/rhsm: Is a directory
grep: /var/log/sa: Is a directory
/var/log/secure-20180522:May 15 17:33:41 centos7host useradd[1054]: new user: name=apache, UID=48, GID=48, home=/usr/share/httpd, shell=/sbin/nologin
/var/log/secure-20180522:May 15 17:50:10 centos7host useradd[1387]: new user: name=mysql, UID=27, GID=27, home=/var/lib/mysql, shell=/sbin/nologin
/var/log/secure-20180522:May 15 18:16:19 centos7host useradd[5588]: new group: name=nagios, GID=1002
/var/log/secure-20180522:May 15 18:16:19 centos7host useradd[5588]: new user: name=nagios, UID=1001, GID=1002, home=/home/nagios, shell=/bin/bash


Last edited by Nvizn; 06-01-2018 at 12:14 PM..
# 2  
Old 06-01-2018
You could intercept the command and insert your own script perhaps. If you have a new directory called /usr/sbin/secure and move the real executables in there, your script to replace them could be something like:-
Code:
#!/bin/ksh

# Record the activity
logger "$(who am i) running $0 $@"
echo   "$(who am i) running $0 $@" >> /var/log/myauditlog

# Call the real command
/usr/bin/secure/${0##*/} $@

It's a bit quick and dirty, and of course could be bypassed, but does that help get you something? I haven't got a Solaris box at present and I recall having to fiddle around with this to get it to work, so this is not a fully tested and working solution but it might get you started on the way.



Kind regards,
Robin
These 2 Users Gave Thanks to rbatte1 For This Post:
# 3  
Old 06-01-2018
Thanks for the quick reply here, Robin.

The catch to this scenario is, it needs to be a command that may be utilized on any system running vanilla Solaris 11 (include the BSM audit system). The command will be used to assess other systems which are not within my control, so, adding or creating a script on my box, wouldn't be executable on a system that I do not manage or have access to. The systems are being assessed by a third party, and they need to be able to view the results of users being added and deleted from the systems.
# 4  
Old 06-01-2018
Can you elaborate on why you are trying to audit useradd/userdel.

You are needing to audit superuser activity? Only superuser privileges can add an account and if you can't trust the superusers then you're in serious trouble.
# 5  
Old 06-01-2018
Also, see this:

audit useradd, userdel on solaris 10

Somebody couldn't get it to work on Solaris 10.
This User Gave Thanks to hicksd8 For This Post:
# 6  
Old 06-01-2018
Quote:
Originally Posted by hicksd8
Can you elaborate on why you are trying to audit useradd/userdel.

You are needing to audit superuser activity? Only superuser privileges can add an account and if you can't trust the superusers then you're in serious trouble.
We have outside organizations auditing system execution. I do not manage this system, however, the application that lives on it we are responsible. The systems are managed by another group, and we are responsible for providing the commands to execute, to permit the assessors to physically see these details on the system. Hence, why the results have to be part of the vanilla Solaris 11 load, and not a custom script.

---------- Post updated at 01:15 PM ---------- Previous update was at 01:10 PM ----------

Quote:
Originally Posted by hicksd8
Also, see this:

audit useradd, userdel on solaris 10

Somebody couldn't get it to work on Solaris 10.
I did locate this thread, however, Solaris 11 doesn't use audit_control.
# 7  
Old 06-06-2018
Do you use sudo? configure it so you can use sudoreplay. You get to replay any users session then.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Audit not working on Solaris 10

hi, I enabled bsm modules (/etc/security/bsmconv) and rebooted Solaris 10. But service is going into maintenance state. I rebooted server and I see one error saying "sys/c2audit:audit_kssl() not defined properly". I am not sure, what it is indicating and how it should be fixed. Please suggest, how... (5 Replies)
Discussion started by: solaris_1977
5 Replies

2. Solaris

Enabling Solaris Audit log: Solaris 9

Dear All, I have one of my Servers, running Solaris 9. I wanna enable the Audit log enabling, the way I did in Solaris 10 Servers. After running, the bsmconv script, giving the reboots, modifying all the audit files in /etc/security, the audit is enabled, but the audit file which shall be... (3 Replies)
Discussion started by: sumeet1806
3 Replies

3. UNIX for Advanced & Expert Users

Solaris 10 useradd confusion[solved]

I installed Solaris 10 (8/11) and added an account for myself. It lives in /export/home/{name} but /etc/passwd shows it is /home/{name} where it seems to be mounted like a filesystem. I tried to create another account from the command line but it doesn't work the same way. I can't find... (7 Replies)
Discussion started by: dokhebi
7 Replies

4. Solaris

audit useradd userdel usermod in solaris 10

the previous thread on this problem was closed with no resolution/workaround that i could see...have there been any breakthroughs? :wall: (0 Replies)
Discussion started by: lisah66
0 Replies

5. UNIX for Advanced & Expert Users

Problem with useradd, -p option in Solaris 10

Good day all. I'm trying to add a user with useradd and the -p option to assign a project name, but the result is that the user is created with an error message: "UX: useradd: user.root name should be all lower case or numeric." The command: useradd -d /export/home/tester -g rtpgrp -G... (2 Replies)
Discussion started by: BRH
2 Replies

6. Solaris

useradd giving error in solaris 10

Hi, I have installed Solaris 10 in my PC and now installing Oracle10, but while adding a user i am getting following error: useradd -g oinstall -G dba -d /export/home/oracle oracle UX: useradd: ERROR: Inconsistent password files. See pwconv(1M). I have tried pwconv command,... (4 Replies)
Discussion started by: amitanshu.verma
4 Replies

7. Solaris

Audit in Solaris Servers.

Hi Friends I am a Solaries newbie and I am looking out for a software or command or config that can capture all commands run by all users on a server on a daily basis. I believe that this Audit is being done in almost all enterprises and would like to know how the same is done there. Any... (3 Replies)
Discussion started by: Hari_Ganesh
3 Replies

8. Solaris

audit useradd, userdel on solaris 10

I just want to audit and log to syslog when a user is added, removed or modified from the system. According to the docs I have: #/etc/security/audit_control dir:/var/audit flags:ua minfree:20 naflags:ua plugin:name=audit_syslog.so.1; p_flags=ua But neither syslog nor auditreduce -c ua... (7 Replies)
Discussion started by: glisha
7 Replies

9. Solaris

audit in solaris 10

can you please share what you use to audit what files are deleted, when files are deleted and who deleted them? thx (1 Reply)
Discussion started by: melanie_pfefer
1 Replies

10. Solaris

audit in solaris

How do I know that audit is enabled in soalris. in AIX 'audit query' command gives me the info whether auditing is on or not. Raghav (1 Reply)
Discussion started by: raghavender_sri
1 Replies
Login or Register to Ask a Question