On Tue, 2007-03-06 at 15:33 -0500, Mike Edenfield wrote:
> I've recently installed a few proof-of-concept hardened Gentoo servers
> at work, with the hardened toolchain + SELinux as security measures.
> I'll probably end to "training" the admins and other devs on how to
> write and configure security policy, so I'm trying to understand it
> better myself :) The documentation from the hardened project has been
> helpful, but there's one element that I seem to be missing.
>
> I have a good grasp on how the policy rules work, and how to write a
> policy rule, but I'm still confused on exactly *why* I should be writing
> a policy rule. My confusion stems from the fact that there are what I
> believe to be an excessive number of avc denial messages being logged
> right out of the box, just to boot the system. I obviously could run
> audit2allow and figure out what TE rules to add, and silence the log
> messages. But some of the rules it recommends just look wrong to me.
> Things like this:
>
> allow consoletype_t file_t:chr_file { getattr ioctl read write };
> allow consoletype_t file_t:dir search;
> allow dmesg_t file_t:chr_file { read write };
>
> I was under the impression that nothing should ever be permitted to
> transition to file_t, and that errors referencing the file_t domain mean
> there's something mis-labelled. In this case, it looks like
> /dev/console is the biggest culprit, but I've also 20 or so errors from
> initrc, a few from ifconfig, a half-dozen from udev. If I install, say,
> sshd or sudo, I get more, even after merging and reloading their policy
> files.
>
> Is this normal or expected?Sorry for the slow response. These messages are likely due to the static device nodes under a udev /dev. There isn't a good way to automatically relabel these device nodes. The best way would be to reboot with udev temporarily disabled, then do `restorecon -R /dev`, then boot up with udev reenabled. I believe gentoo=noudev on the kernel command line will still disable udev during booting. Alternatively you can use the RC_DEVICES setting in /etc/conf.d/rc to enable or disable udev on boot. -- Chris PeBenito <[EMAIL PROTECTED]> Developer, Hardened Gentoo Linux Public Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE6AF9243 Key fingerprint = B0E6 877A 883F A57A 8E6A CB00 BC8E E42D E6AF 9243
signature.asc
Description: This is a digitally signed message part
