- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- modify systems "su" for monitoring reasons?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2005 08:09 AM
02-16-2005 08:09 AM
I initially started thinking of the following script, which appeared to work fine until I started looking at crontab entries...
---------------------------------------------------
#!/bin/sh
#the production su is moved to su.hp
#this script takes it's place, and is initiated when an su is called.
#user/requestor information will be captured each time it is initiated.
fileD=`date '+%b%d-%Y'`
if test $2
then
echo "at `date '+%b%d-%Y %H':'%M'` the following user initiated the su command :" >> /root/Security/$fileD-SU.log
echo "`id`" >> /root/Security/$fileD-SU.log
echo "command = su $1 $2" >> /root/Security/$fileD-SU.log
echo "" >> /root/Security/$fileD-SU.log
/usr/bin/su.hp $1 $2
exit
fi
if test $1
then
echo "at `date '+%b%d-%Y %H':'%M'` the following user initiated the su command :" >> /root/Security/$fileD-SU.log
echo "`id`" >> /root/Security/$fileD-SU.log
echo "command = su $1" >> /root/Security/$fileD-SU.log
echo "" >> /root/Security/$fileD-SU.log
/usr/bin/su.hp $1
exit
fi
echo "at `date '+%b%d-%Y %H':'%M'` the following user initiated the su command :" >> /root/Security/$fileD-SU.log
echo "`id`" >> /root/Security/$fileD-SU.log
echo "command = su " >> /root/Security/$fileD-SU.log
echo "" >> /root/Security/$fileD-SU.log
/usr/bin/su.hp
exit
------------------------------------------------
I would like some input on changes that would accommodate su requests like the following:
/usr/bin/su -c user "/home/is/user/scripts/daily.sh" > /apps/is/user/logs/daily.log 2>&1
or
/usr/bin/su -c user /home/is/user/scripts/daily.sh > /apps/is/user/logs/daily.log 2>&1
my system is NOT trusted, and I am beginning to think that implementing this to track additional info may NOT be the best way to accomplish this...
your input is appreciated,
manuel
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2005 08:20 AM
02-16-2005 08:20 AM
Re: modify systems "su" for monitoring reasons?
http://www.courtesan.com/sudo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2005 08:20 AM
02-16-2005 08:20 AM
Solutionif [[ $# -gt o ]]
then
arg_list=$*
echo "at `date '+%b%d-%Y %H':'%M'` the following user initiated the su command :" >> /root/Security/$fileD-SU.log
echo "`id`" >> /root/Security/$fileD-SU.log
echo "command = su $1 $2" >> /root/Security/$fileD-SU.log
echo "" >> /root/Security/$fileD-SU.log
/usr/bin/su.hp $*
exit
fi
if [[ $0 = "su" ]]
then
echo "at `date '+%b%d-%Y %H':'%M'` the following user initiated the su command :" >> /root/Security/$fileD-SU.log
echo "`id`" >> /root/Security/$fileD-SU.log
echo "command = su $1 $2" >> /root/Security/$fileD-SU.log
echo "" >> /root/Security/$fileD-SU.log
/usr/bin/su.hp
exit
fi
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2005 08:46 AM
02-16-2005 08:46 AM
Re: modify systems "su" for monitoring reasons?
Sweet...after a quick "o" change your idea is looking quite promising :)
Patrick,
Sudo is quite the life saver, has helped me a great deal w/providing access to support personnel.
Highly recommended...
I guess additional su monitoring is common in non-trusted envs?
thanks for the input,
manuel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2005 08:48 AM
02-16-2005 08:48 AM
Re: modify systems "su" for monitoring reasons?
IF/WHEN you install patches, and if/when a patch happens to modify 'su', then your modified su script will be overwritten by the patched su. If you forget and don't check after EVERY patch install, then the information you require will not get logged.
I don't like replacing system executables for exactly that reason.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2005 08:56 AM
02-16-2005 08:56 AM
Re: modify systems "su" for monitoring reasons?
manuel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2005 09:53 AM
02-16-2005 09:53 AM
Re: modify systems "su" for monitoring reasons?
at one site they also ran a modified version of su, and from my experience there I can just say You're right about that this is a less-than-optimal way.
usually, every su to root generates a syslog entry anyway, so You might be better off dedicating a cheap (but raid-supporting) pc box as a central loghost with no external access.
also, using a trusted system will pay off in the long term, unless You find the process of writing a wrapper script about everything that out to be monitored very intriguing :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2005 03:54 PM
02-16-2005 03:54 PM
Re: modify systems "su" for monitoring reasons?
If it's been requested to track su work because problems are occurring, perhaps a non-technical solution is in order. What I'm wondering is "why monitor now?" If it's because people are su'ing and not cooperating nicely, perhaps management needs to get together and work out the problem -- in addition to something like sudo or your script.
Just my $.02.
Mic