Skip to contentSkip to conversation

ssh-keysign

PATCH Russell Coker 1 participant 1 message Jun 23, 2005 SELinux security module

lore
Share & tools
lore
#0 lore raw

From the man page it appears that ssh-keysign can only be invoked from ssh(1). Therefore shouldn't this policy:
domain_auto_trans($1_t, ssh_keysign_exec_t, $1_ssh_keysign_t)
Be replaced by this:
domain_auto_trans($1_ssh_t, ssh_keysign_exec_t, $1_ssh_keysign_t)

The $1_ssh_keysign_t domain can read the sshd private keys so we want to restrict transitions to it as much as possible.

I've attached a patch to demonstrate the concept. The boolean allow_ssh_keysign needs to be defined in ssh.te.

Signature · 4 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
program/ssh_macros.te renamed from program/ssh_macros.te.orig +4 -1
@@ -143,7 +143,9 @@
 
 type $1_ssh_keysign_t, domain, nscd_client_domain;
 role $1_r types $1_ssh_keysign_t;
-domain_auto_trans($1_t, ssh_keysign_exec_t, $1_ssh_keysign_t)
+
+if (allow_ssh_keysign) {
+domain_auto_trans($1_ssh_t, ssh_keysign_exec_t, $1_ssh_keysign_t)
 allow $1_ssh_keysign_t sshd_key_t:file { getattr read };
 allow $1_ssh_keysign_t self:capability { setgid setuid };
 allow $1_ssh_keysign_t urandom_device_t:chr_file r_file_perms;
@@ -156,6 +158,7 @@
 allow $1_ssh_keysign_t self:dir search;
 allow $1_ssh_keysign_t self:file { getattr read };
 allow $1_ssh_keysign_t self:unix_stream_socket create_socket_perms;
+}
 
 ')dnl end macro definition
 ', `