sudo question


 
Thread Tools Search this Thread
Special Forums Cybersecurity sudo question
# 8  
Old 04-18-2008
even if they copy a shell to thier homedir. this is not going to elevate their privledges. unless they have either the root password, or explicitly allowed to become root with the sudoers file, and if that's the case it's a moot point. a shell, bash or otherwise doesn't elevate privledges.
# 9  
Old 04-18-2008
Maybe I haven't defined by question correctly.

What I want to stop is a user elevating to root via the following:

sudo bash.

This is easy enough to do via a sudoers restriction on running the command.

Now, I have a group of admins that need to be able to run most system commands. However, I want to be able to log all commands they run as root, for auditing purposes. So I use sudo.log.

The user bypasses sudo logging if they execute su or a shell via sudo. As mentioned above, I can prevent this by explicitly denying the commands in sudoers file.

However, if the user (or admin) copies a shell (say /usr/bin/bash, but could be any shell) to another location/name (could be any location or name), what's to stop them now executing this renamed and relocated shell command via sudo, which in effect, gives them root access without sudo.log logging.

Please don't get hung up on homedir being the location - it could be any directory with write and execute permissions.

So, is it possible on your system for a user to copy(rename) a shell command to another location and then execute it via sudo?
If not, why not?

This is what I want to prevent.
# 10  
Old 05-18-2008
Hi,
Yes any user can copy bash to /userpath/notbash
But when a non root user issues a sudo notbash,
the user will need to enter root's password to gain root priveleges.

If correct password is not entered, it will not be executed. So it remains secure.

Hope this answers your concern. Smilie


Quote:
Originally Posted by melias
Maybe I haven't defined by question correctly.

What I want to stop is a user elevating to root via the following:

sudo bash.

This is easy enough to do via a sudoers restriction on running the command.

Now, I have a group of admins that need to be able to run most system commands. However, I want to be able to log all commands they run as root, for auditing purposes. So I use sudo.log.

The user bypasses sudo logging if they execute su or a shell via sudo. As mentioned above, I can prevent this by explicitly denying the commands in sudoers file.

However, if the user (or admin) copies a shell (say /usr/bin/bash, but could be any shell) to another location/name (could be any location or name), what's to stop them now executing this renamed and relocated shell command via sudo, which in effect, gives them root access without sudo.log logging.

Please don't get hung up on homedir being the location - it could be any directory with write and execute permissions.

So, is it possible on your system for a user to copy(rename) a shell command to another location and then execute it via sudo?
If not, why not?

This is what I want to prevent.
# 11  
Old 05-18-2008
Quote:
Originally Posted by divh18
Yes any user can copy bash to /userpath/notbash
But when a non root user issues a sudo notbash,
the user will need to enter root's password to gain root priveleges.
This is not correct. sudo only requires the user's own password.

If I understand correctly, you have configured sudo to allow these users to execute any command they want, and then separately prohibited the shell, in order to prevent them from evading the logging.

The problem is that you cannot enforce your policy if you have a "permit unless prohibited" policy. Only with "prohibit unless permitted" and by explicitly listing the commands the users are allowed to execute as admin can you meaningfully enforce your policy.

These are your options; I don't think you like the answer, but that's how it is. Either explicitly list all the permitted commands, or live with the fact that some user could come up with a workaround to evade the logging. If you trust them to run arbitrary commands, what's to prevent them from installing a remote backdoor if they wanted to? It's "turtles all the way down".
# 12  
Old 05-25-2008
Thank you Era, I suspected the prohibit unless permitted policy was going to be my only option. I was hoping that someone had worked some magic so that I didn't need to go down that path since, in my environment, the number of permitted commands far outweighs the number of restricted commands. As they say, the easy way is seldom the right way.
# 13  
Old 05-26-2008
If you have logs of the commands they have executed, isn't that pretty much a listing of the set of commands you want to permit?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Sudo question

I am running AIX 6.6.5.115 and am experiencing a problem using sudo. I have shell scripts that I created for our HR user and shell scripts that I created for root administrators. I do have a need to embed a sudo command in the user shell script to run one command as root. However the two... (8 Replies)
Discussion started by: RonDeF
8 Replies

2. UNIX for Advanced & Expert Users

Sudo question

Hi All I want to grant elevated privs to a user that will be running a script as a background task. It will be launched from an ssh session via an embedded command in its key that just allows that account to run that script. I'm reading up on sudo and notice that - user ALL=(ALL) ALL ... (2 Replies)
Discussion started by: steadyonabix
2 Replies

3. UNIX for Dummies Questions & Answers

Question about sudo

Hello all, I have a script (script.sh) that is owned and executed by root. Now I need to give another user (user1) sudo access to execute that script. I edited the /etc/sudoers file, and created the following: # Runas alias specification Runas_Alias RO = root user1 ALL=(RO)... (1 Reply)
Discussion started by: designbc
1 Replies

4. UNIX for Dummies Questions & Answers

Sudo question

Folks; I have SUDO configured on my SUSE boxes to allow a specific groups to run specific duties so one group has ALL permission & other group has permission to run a few commands only. when i look at the sudoer log, i see people login info only, Is there a way to capture every thing users do... (3 Replies)
Discussion started by: Katkota
3 Replies

5. Ubuntu

sudo question.

Hello all, Anyone fimilar with su -l command? So when I do su -l <user> any user it doesn't prompt me for password for that user. How I enable sudo to prompt for password whenever su -l command is used. Please help! thanks, -Lalit :D (7 Replies)
Discussion started by: email-lalit
7 Replies

6. Linux

Sudo question

Hello, I would like to know what should I put on the sudoers file to block a determined group os using just one specific command as root? He can do anything, but not execute program X, how can I do this? Thank you very much. (2 Replies)
Discussion started by: Zarnick
2 Replies

7. UNIX for Dummies Questions & Answers

Sudo question

Folks; I have a sudo question: - I have a real user named "greg" and another generic user named "devuser" & application that must be run like start/stop as "devuser" user. Is there a way to: Have user Greg login into the Solaris 10 box as himself then sudo as "devuser" to be able to... (10 Replies)
Discussion started by: Katkota
10 Replies

8. UNIX for Advanced & Expert Users

SUDO question - please help

Hi, I was wondering if someone can give me some pointers about configuring SUDO. I am trying to configure SUDO to have about 30 users run about 200 scripts as a different user. I understand that I can create an User_Alias but how do I give that User_Alias rights to run all the scripts in a certain... (5 Replies)
Discussion started by: sajjad02
5 Replies

9. UNIX for Dummies Questions & Answers

sudo question

how do i go about adding a file to sudo so a user name oracle can run the file??? for some reason my man pages dont have anything for sudo. files sudoers exist in /etc can anyone help this is urgent thank you (1 Reply)
Discussion started by: TRUEST
1 Replies
Login or Register to Ask a Question