Skip to contentSkip to conversation

ssh problems etc

DISCUSSION Russell Coker 1 participant 1 message Sep 18, 2003 SELinux security module

lore
Share & tools
lore
#0 lore raw

I have written some policy to deal with the problems of ssh and put a test version on my play machine.

The file /root/id_test on the play machine is a ssh identity file to allow you to login as test via the command:
ssh -i id_test [email protected]

Logging in like this gives you the context of test:user_r:user_mini_t and very little access to the system. All that can be done is to allow the shell to execute it's profile (I've assigned a special type for it that only allows read access) and run newrole. Searching /dev/pts and /proc/pid is denied (to prevent gaining access to terminals for other sessions). ptrace is denied for obvious reasons, as is signal access other than sigchld.

The idea is that you have sshd run from inetd and only inetd can bind to port
22. Every port 22 connection causes a new sshd to be launched with no privs to interfere with previously running sshd's (still working on this part). For an external interface (or all interfaces for the more paranoid) the sshd runs in a context that only allows transitioning to a domain such as user_mini_t and therefore cracking a sshd will not grant any significant access. Merely getting user_mini_t gains you nothing.

Of course cracking sshd still does an attacker some good as it allows choosing an arbitary identity and role (from the set of roles that have mini domains defined). If you knew the password of an account where login was prevented by some other means (eg the PermitRootLogin setting of the sshd config) then cracking the sshd would permit you to get the identity and therefore exploit the knowledge of the password in situations where otherwise knowing the password would gain you nothing.

As for whether sshd's can interfere with each other. I'm going through the sshd access right now and reducing what is allowed. I'm not sure if I can totally prevent this without changing the sshd source.

I'll have the policy for this online in the usual place soon.

Signature · 10 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.