public inbox for gentoo-hardened@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-hardened] SELinux policy and openrc
@ 2011-05-13 20:06 Sven Vermeulen
  2011-05-14 16:59 ` Chris Richards
  0 siblings, 1 reply; 5+ messages in thread
From: Sven Vermeulen @ 2011-05-13 20:06 UTC (permalink / raw
  To: gentoo-hardened

Hi all,

I've put selinux-base-policy-2.20101213-r14 in the hardened-dev.git overlay.
Its main addition is support for openrc (which is now stable and was hunting
for my patience the last few days) which is done by a few labelling
statements (especially for /lib(64)?/rc/... stuff) as well as to "allow
run_init_t initrc_exec_t:file execute_no_trans", this because
/sbin/runscript was previously a binary and is now a wrapper (hence the
additional rule).

In the further future, we might want to relabel runscript to bin_t (as
run_init_t already has execute_no_trans on those) but for those systems that
have not migrated to openrc yet, such a change would mean disaster.

I've added a reminder for myself around August to make this switch /if/
other architectures have also migrated to openrc (ok, I know we do not
support SELinux on those, but (1.) that doesn't mean no-one uses it, and
(2.) there are a few people waiting for openrc migration until things cool
down).

Sadly, to support openrc, SELinux users will also need to add the following
line to their /etc/fstab (wrapped):
  rc-svcdir	/lib64/rc/init.d	tmpfs	\
  rw,rootcontext=system_u:object_r:initrc_state_t,seclabel,\
  nosuid,nodev,noexec,relatime,size=1024k,mode=755	0 0

I tried labelling /lib64/rc to initrc_state_t, but then I had to put a lot
of other allow rules for less related domains towards initrc_state_t.
Mounting the init.d as initrc_state_t requires no additional updates on the
policy (well, perhaps a few cosmetic ones to hide denials that are seemingly
not needed). Perhaps we could have the openrc people update the
/lib64/rc/sh/init.sh file to do this automatically on SELinux systems, but
let us first see how things turn out.

Anyway, this addition to the /etc/fstab has been put in the SELinux handbook
in hardened-doc.git overlay.

Wkr,
	Sven Vermeulen



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-05-15 14:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-13 20:06 [gentoo-hardened] SELinux policy and openrc Sven Vermeulen
2011-05-14 16:59 ` Chris Richards
2011-05-14 21:41   ` Sven Vermeulen
2011-05-14 22:25   ` Sven Vermeulen
2011-05-15 13:16     ` Sven Vermeulen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox