Gentoo Archives: gentoo-hardened

From: Sven Vermeulen <swift@g.o>
To: gentoo-hardened@l.g.o
Subject: Re: [gentoo-hardened] Setting filesystem labels for SELinux fails
Date: Thu, 22 Mar 2012 15:50:32
Message-Id: 20120322154931.GC28577@gentoo.org
In Reply to: Re: [gentoo-hardened] Setting filesystem labels for SELinux fails by Tom Petri
1 On Wed, Mar 21, 2012 at 04:40:32PM +0100, Tom Petri wrote:
2 > > I just did a fresh gentoo install (configuration) and proceeded with
3 > > the instructions from the gentoo hardened documentation.
4 > > After compiling re-emerging world the system doesn't get up. I'm able
5 > > to ping it but udev seems to have problems as /dev/console and the
6 > > tty's aren't found:
7 > >
8 > > /etc/init.d/sshd[1205]: ERROR: sshd failed to start
9 > > /etc/init.d/urandom[1219]: ERROR: urandom failed to start
10 > > init: open(/dev/console): No such file or directory
11 > > agetty[1233]: /dev/tty2: not a character device
12 > > agetty[1232]: /dev/tty1: not a character device
13 > >
14 > > My mdadm RAID is recognized properly, in case it matters.
15
16 You aren't by any chance using an initramfs, are you?
17
18 > The udev from the hardened documentation seems to be the problem (udev
19 > /dev tmpfs rw,rootcontext=system_u:object_r:device_t,seclabel,nosuid,relatime,size=10m,mode=755
20 > 0 0).
21 >
22 > The systems boots without this entry, however `sestatus` says "disabled".
23
24 Is SELinux indeed disabled, or does it only "look" like so?
25
26 An easy way to test is when you run in strict policy (or mcs/mls without
27 unconfined domains) and you're in the sysadm_t domain. Then try reading
28 /etc/shadow:
29
30 hpl ~ # id
31 uid=0(root) gid=0(root)
32 groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)
33 context=staff_u:sysadm_r:sysadm_t
34
35 hpl ~ # cat /etc/shadow
36 cat: /etc/shadow: Permission denied
37
38 Wkr,
39 Sven Vermeulen