Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id s4RLxhHP013274 for ; Tue, 27 May 2014 17:59:44 -0400 Received: from ferret (fw5540.nrl.navy.mil [132.250.196.100]) by ccs.nrl.navy.mil (8.14.4/8.14.4) with ESMTP id s4RLxjAQ020596 for ; Tue, 27 May 2014 17:59:45 -0400 From: "Kim Lawson-Jenkins" To: Subject: attempting to run a sftpserver in a confined domain Date: Tue, 27 May 2014 18:02:16 -0400 Message-ID: <006b01cf79f7$52566370$f7032a50$@nrl.navy.mil> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_006C_01CF79D5.CB44C370" Reply-To: kim.lawson-jenkins@nrl.navy.mil List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: This is a multipart message in MIME format. ------=_NextPart_000_006C_01CF79D5.CB44C370 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, We are writing SELinux policy for a sftp server to run in a confined domain when an openssh sftp connection is made to it. Using ls -Z we can see the running process labeled as system_u:system_r:sshd_t: s0-s15:c0.c1023 root sshd: guard [priv] system_u:system_r:sshd_t :s0-s15:c0.c1023 guard sshd: guard@notty system_u:system_r:unconfined_t:s0-s15:c0.c1023 guard /usr/lib/openssh/sftpserver with the sftpserver running in the unconfined domain rather than the confined domain sftpserver. The sftp-server executable file is labeled as system_u:system_r:sftpserver_exec_t:s0-s15:c0.c1023 in the directory /usr/lib/openssh. The policy module contains the following statements - attribute sftpserver; ssh_server_template(sftpserver) iptables_domtrans(sftpserver_t) type sftpserver_exec_t; init_daemon_domain(sftpserver_t, sftpserver_exec_t) allow sshd_t sftpserver_exec_t:file { getattr execute ioctl }; corenet_tcp_connect_ssh_port(sftpserver_t) corenet_tcp_bind_ssh_port(sftpserver_t) corenet_tcp_sendrecv_ssh_port(sftpserver_t) Is there a boolean that will block the sftpserver from running in the unconfined domain, and are there missing policy statements that will allow the sftpserver to run in the confined domain? Thanks in advance for any feedback. Kim ------=_NextPart_000_006C_01CF79D5.CB44C370 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

 

We are = writing SELinux policy for a sftp server to run in a confined domain = when an openssh sftp connection is made to it.  =   

 

Using ls -Z we can see the running process labeled = as

 

system_u:system_r:sshd_t: = s0-s15:c0.c1023      = root           &nb= sp;      sshd: guard [priv]

system_u:system_r:sshd_t = :s0-s15:c0.c1023      guard    =            sshd: = guard@notty

system_u:system_r:unconfined_t:s0-s15:c0.c1023 &nb= sp;    guard    = /usr/lib/openssh/sftpserver 

 

with the = sftpserver running in the unconfined domain rather than the confined = domain sftpserver.  The sftp-server executable file is labeled = as

 

system_u:system_r:sftpserver_exec_t:s0-s15:c0.c1023

 

in the directory /usr/lib/openssh.

 

The policy = module contains the following statements –

 

attribute = sftpserver;

ssh_server_template(sftpserver)

iptables_domtrans(sftpserver_t)

type sftpserver_exec_t;

init_daemon_domain(sftpserver_t, = sftpserver_exec_t)

allow sshd_t = sftpserver_exec_t:file { getattr execute ioctl };

 

corenet_tcp_connect_ssh_port(sftpserver_t)

corenet_tcp_bind_ssh_port(sftpserver_t)

<= p = class=3DMsoNormal>corenet_tcp_sendrecv_ssh_port(sftpserver_t)<= /p>

 

 

Is there a = boolean that will block the sftpserver from running in the unconfined = domain, and are there missing policy statements that will allow the = sftpserver to run in the confined domain?

 

Thanks in = advance for any feedback.

 

Kim

------=_NextPart_000_006C_01CF79D5.CB44C370--