Skip to contentSkip to conversation

sshd mods

DISCUSSION Russell Coker 2 participants 2 messages Jul 31, 2002 – Aug 1, 2002 SELinux security module

lore
Share & tools
lore
#0 lore raw

With the current sshd on SE Linux a compromised sshd can't directly run "/bin/rm", but it can run "sh -c rm -rf /home/user".

I think that we could probably benefit from a wrapper program that ssh would run. This wrapper would perhaps have a configuration method somewhat similar to sudo to determine what programs ssh could run and what parameters can be passed to them. Then we could deny sshd access to change domain/role and only allow this wrapper to do that, then sshd would only be able to execute the wrapper (and hopefully the vast majority of ssh exploits would then be unable to affect us).

This should also benefit non-SE users, the ability to limit in detail what a user can do with an ssh account is something that many people have been asking for. Having it implemented by a separate wrapper program (that will hopefully be well audited and unlikely to contain bugs) will also give advantages for security systems other than SE Linux (any MAC system should benefit greatly from this).

Signature · 3 lines
I do not get viruses because I do not use MS software.
If you use Outlook then please do not put my email address in your
address-book so that WHEN you get a virus it won't use my address in the
Quoted 1 line

From field.

--
You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 7 lines · Russell Coker

I think that we could probably benefit from a wrapper program that ssh would run. This wrapper would perhaps have a configuration method somewhat similar to sudo to determine what programs ssh could run and what parameters can be passed to them. Then we could deny sshd access to change domain/role and only allow this wrapper to do that, then sshd would only be able to execute the wrapper (and hopefully the vast majority of ssh exploits would then be unable to affect us).

It sounds very much like a compromise between useability and security here.

For instance, I might really want to login to a remote box and run rm.

I might even want to do this as a non-interactive command.

In fact, my scripts I use to download BSTMP (batched SMTP) from the Debian server do just this:

ssh -l$USER $HOST bin/downloadmail
rsync -essh -avz --progress $USER@$HOST:download/ $HOME/download shopt -s nullglob
for i in *
do
/usr/sbin/rbsmtp < $i
rm $i
ssh -l$USER $HOST rm -f download/$i
done

A better long term solution might be to somehow require the remote host has a SPKI key or something (a public key can already be used to limit what commands the remote host can execute, but that doesn't work if sshd has been compromised) that somehow can be used to limit what domains sshd can run. However, I have not put any thought into if this is possible, practical or feasible.

Signature · 6 lines
Brian May <[email protected]>

--
You have received this message because you are subscribed to the selinux list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.