[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-hardened
Subject:    Re: [gentoo-hardened] Setting filesystem labels for SELinux fails
From:       Sven Vermeulen <swift () gentoo ! org>
Date:       2012-03-22 15:49:31
Message-ID: 20120322154931.GC28577 () gentoo ! org
[Download RAW message or body]

On Wed, Mar 21, 2012 at 04:40:32PM +0100, Tom Petri wrote:
> > I just did a fresh gentoo install (configuration) and proceeded with
> > the instructions from the gentoo hardened documentation.
> > After compiling re-emerging world the system doesn't get up. I'm able
> > to ping it but udev seems to have problems as /dev/console and the
> > tty's aren't found:
> >
> > /etc/init.d/sshd[1205]: ERROR: sshd failed to start
> > /etc/init.d/urandom[1219]: ERROR: urandom failed to start
> > init: open(/dev/console): No such file or directory
> > agetty[1233]: /dev/tty2: not a character device
> > agetty[1232]: /dev/tty1: not a character device
> >
> > My mdadm RAID is recognized properly, in case it matters.

You aren't by any chance using an initramfs, are you?

> The udev from the hardened documentation seems to be the problem (udev
> /dev tmpfs rw,rootcontext=system_u:object_r:device_t,seclabel,nosuid,relatime,size=10m,mode=755
> 0 0).
> 
> The systems boots without this entry, however `sestatus` says "disabled".

Is SELinux indeed disabled, or does it only "look" like so?

An easy way to test is when you run in strict policy (or mcs/mls without
unconfined domains) and you're in the sysadm_t domain. Then try reading
/etc/shadow:

hpl ~ # id
uid=0(root) gid=0(root)
groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)
context=staff_u:sysadm_r:sysadm_t

hpl ~ # cat /etc/shadow
cat: /etc/shadow: Permission denied

Wkr,
	Sven Vermeulen

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic