SELinux/Config

From FedoraProject

Jump to: navigation, search

/etc/selinux/config

The original SELinux config files was stored in /etc/sysconfig/selinux, and it still exists as a symlink to /etc/selinux/config. Where all the magic of selinux starts. libselinux reads this file to figure out how the system is configured.

This file usually looks like this.

SELINUX=enforcing
SELINUXTYPE=targeted

In FC5 there are two additional variables, which I will talk about later.

# SETLOCALDEFS= Check local definition changes
SETLOCALDEFS=0

This file is read by libselinux and is used to determine the mode to run SELinux in and which policy to use. When booting up the machine, init uses libselinux to read this file, and determines which policy to load and what mode to put the machine in.

Variables

1. The kernel will only report the first access violation in Enforcing mode for a confined domain on a particular object, where as in Permissive mode, it will report each and every denied access. 2. You can get many additional AVC messages that would never have shown up in enforcing mode. For example if a confined domain was not allowed to read a directory or any of the files in it. In enforcing mode the directory access would be denied and one AVC message would be generated. In Permissive mode, the directory access would generate an AVC, and each file read would generate an AVC.

There are two kernel parameters that can override these settings. If you want to boot a system with SELinux disabled you can enter the selinux=0 boot param. This will cause init to not even look at the /etc/selinux/config directory. You can cause the machine to boot in permissive mode by booting with the enforcing=0 parameter. And you can cause it to boot in enforcing mode with the enforcing=1 parameter.


Now what about those other two fields. I call these the Wizard of Oz fields, "Ignore the man behind the curtain". So don't touch these fields unless you know what you are doing. I don't touch these flags either.

My advise, don't touch these flags.