xref: /linux/security/selinux/Kconfig (revision 016b9bdb81d9c9c7800e4e224ade38d8b37669d3)
11da177e4SLinus Torvaldsconfig SECURITY_SELINUX
21da177e4SLinus Torvalds	bool "NSA SELinux Support"
399f6d61bSStephen Smalley	depends on SECURITY_NETWORK && AUDIT && NET && INET
44e5ab4cbSJames Morris	select NETWORK_SECMARK
51da177e4SLinus Torvalds	default n
61da177e4SLinus Torvalds	help
71da177e4SLinus Torvalds	  This selects NSA Security-Enhanced Linux (SELinux).
81da177e4SLinus Torvalds	  You will also need a policy configuration and a labeled filesystem.
91da177e4SLinus Torvalds	  You can obtain the policy compiler (checkpolicy), the utility for
101da177e4SLinus Torvalds	  labeling filesystems (setfiles), and an example policy configuration
111da177e4SLinus Torvalds	  from <http://www.nsa.gov/selinux/>.
121da177e4SLinus Torvalds	  If you are unsure how to answer this question, answer N.
131da177e4SLinus Torvalds
141da177e4SLinus Torvaldsconfig SECURITY_SELINUX_BOOTPARAM
151da177e4SLinus Torvalds	bool "NSA SELinux boot parameter"
161da177e4SLinus Torvalds	depends on SECURITY_SELINUX
171da177e4SLinus Torvalds	default n
181da177e4SLinus Torvalds	help
191da177e4SLinus Torvalds	  This option adds a kernel parameter 'selinux', which allows SELinux
201da177e4SLinus Torvalds	  to be disabled at boot.  If this option is selected, SELinux
211da177e4SLinus Torvalds	  functionality can be disabled with selinux=0 on the kernel
221da177e4SLinus Torvalds	  command line.  The purpose of this option is to allow a single
231da177e4SLinus Torvalds	  kernel image to be distributed with SELinux built in, but not
241da177e4SLinus Torvalds	  necessarily enabled.
251da177e4SLinus Torvalds
261da177e4SLinus Torvalds	  If you are unsure how to answer this question, answer N.
271da177e4SLinus Torvalds
281da177e4SLinus Torvaldsconfig SECURITY_SELINUX_BOOTPARAM_VALUE
291da177e4SLinus Torvalds	int "NSA SELinux boot parameter default value"
301da177e4SLinus Torvalds	depends on SECURITY_SELINUX_BOOTPARAM
311da177e4SLinus Torvalds	range 0 1
321da177e4SLinus Torvalds	default 1
331da177e4SLinus Torvalds	help
341da177e4SLinus Torvalds	  This option sets the default value for the kernel parameter
351da177e4SLinus Torvalds	  'selinux', which allows SELinux to be disabled at boot.  If this
361da177e4SLinus Torvalds	  option is set to 0 (zero), the SELinux kernel parameter will
371da177e4SLinus Torvalds	  default to 0, disabling SELinux at bootup.  If this option is
381da177e4SLinus Torvalds	  set to 1 (one), the SELinux kernel parameter will default to 1,
391da177e4SLinus Torvalds	  enabling SELinux at bootup.
401da177e4SLinus Torvalds
411da177e4SLinus Torvalds	  If you are unsure how to answer this question, answer 1.
421da177e4SLinus Torvalds
431da177e4SLinus Torvaldsconfig SECURITY_SELINUX_DISABLE
441da177e4SLinus Torvalds	bool "NSA SELinux runtime disable"
451da177e4SLinus Torvalds	depends on SECURITY_SELINUX
461da177e4SLinus Torvalds	default n
471da177e4SLinus Torvalds	help
481da177e4SLinus Torvalds	  This option enables writing to a selinuxfs node 'disable', which
491da177e4SLinus Torvalds	  allows SELinux to be disabled at runtime prior to the policy load.
501da177e4SLinus Torvalds	  SELinux will then remain disabled until the next boot.
511da177e4SLinus Torvalds	  This option is similar to the selinux=0 boot parameter, but is to
521da177e4SLinus Torvalds	  support runtime disabling of SELinux, e.g. from /sbin/init, for
531da177e4SLinus Torvalds	  portability across platforms where boot parameters are difficult
541da177e4SLinus Torvalds	  to employ.
551da177e4SLinus Torvalds
561da177e4SLinus Torvalds	  If you are unsure how to answer this question, answer N.
571da177e4SLinus Torvalds
581da177e4SLinus Torvaldsconfig SECURITY_SELINUX_DEVELOP
591da177e4SLinus Torvalds	bool "NSA SELinux Development Support"
601da177e4SLinus Torvalds	depends on SECURITY_SELINUX
611da177e4SLinus Torvalds	default y
621da177e4SLinus Torvalds	help
631da177e4SLinus Torvalds	  This enables the development support option of NSA SELinux,
641da177e4SLinus Torvalds	  which is useful for experimenting with SELinux and developing
651da177e4SLinus Torvalds	  policies.  If unsure, say Y.  With this option enabled, the
661da177e4SLinus Torvalds	  kernel will start in permissive mode (log everything, deny nothing)
671da177e4SLinus Torvalds	  unless you specify enforcing=1 on the kernel command line.  You
681da177e4SLinus Torvalds	  can interactively toggle the kernel between enforcing mode and
691da177e4SLinus Torvalds	  permissive mode (if permitted by the policy) via /selinux/enforce.
701da177e4SLinus Torvalds
711da177e4SLinus Torvaldsconfig SECURITY_SELINUX_AVC_STATS
721da177e4SLinus Torvalds	bool "NSA SELinux AVC Statistics"
731da177e4SLinus Torvalds	depends on SECURITY_SELINUX
741da177e4SLinus Torvalds	default y
751da177e4SLinus Torvalds	help
761da177e4SLinus Torvalds	  This option collects access vector cache statistics to
771da177e4SLinus Torvalds	  /selinux/avc/cache_stats, which may be monitored via
781da177e4SLinus Torvalds	  tools such as avcstat.
791da177e4SLinus Torvalds
801da177e4SLinus Torvaldsconfig SECURITY_SELINUX_CHECKREQPROT_VALUE
811da177e4SLinus Torvalds	int "NSA SELinux checkreqprot default value"
821da177e4SLinus Torvalds	depends on SECURITY_SELINUX
831da177e4SLinus Torvalds	range 0 1
841da177e4SLinus Torvalds	default 1
851da177e4SLinus Torvalds	help
861da177e4SLinus Torvalds	  This option sets the default value for the 'checkreqprot' flag
871da177e4SLinus Torvalds	  that determines whether SELinux checks the protection requested
881da177e4SLinus Torvalds	  by the application or the protection that will be applied by the
891da177e4SLinus Torvalds	  kernel (including any implied execute for read-implies-exec) for
901da177e4SLinus Torvalds	  mmap and mprotect calls.  If this option is set to 0 (zero),
911da177e4SLinus Torvalds	  SELinux will default to checking the protection that will be applied
921da177e4SLinus Torvalds	  by the kernel.  If this option is set to 1 (one), SELinux will
931da177e4SLinus Torvalds	  default to checking the protection requested by the application.
941da177e4SLinus Torvalds	  The checkreqprot flag may be changed from the default via the
951da177e4SLinus Torvalds	  'checkreqprot=' boot parameter.  It may also be changed at runtime
961da177e4SLinus Torvalds	  via /selinux/checkreqprot if authorized by policy.
971da177e4SLinus Torvalds
981da177e4SLinus Torvalds	  If you are unsure how to answer this question, answer 1.
994e5ab4cbSJames Morris
1004e5ab4cbSJames Morrisconfig SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT
1014e5ab4cbSJames Morris	bool "NSA SELinux enable new secmark network controls by default"
1024e5ab4cbSJames Morris	depends on SECURITY_SELINUX
1034e5ab4cbSJames Morris	default n
1044e5ab4cbSJames Morris	help
1054e5ab4cbSJames Morris	  This option determines whether the new secmark-based network
1064e5ab4cbSJames Morris	  controls will be enabled by default.  If not, the old internal
1074e5ab4cbSJames Morris	  per-packet controls will be enabled by default, preserving
1084e5ab4cbSJames Morris	  old behavior.
1094e5ab4cbSJames Morris
1104e5ab4cbSJames Morris	  If you enable the new controls, you will need updated
1114e5ab4cbSJames Morris	  SELinux userspace libraries, tools and policy.  Typically,
1124e5ab4cbSJames Morris	  your distribution will provide these and enable the new controls
1134e5ab4cbSJames Morris	  in the kernel they also distribute.
1144e5ab4cbSJames Morris
1154e5ab4cbSJames Morris	  Note that this option can be overriden at boot with the
1164e5ab4cbSJames Morris	  selinux_compat_net parameter, and after boot via
1174e5ab4cbSJames Morris	  /selinux/compat_net.  See Documentation/kernel-parameters.txt
1184e5ab4cbSJames Morris	  for details on this parameter.
1194e5ab4cbSJames Morris
1204e5ab4cbSJames Morris	  If you enable the new network controls, you will likely
1214e5ab4cbSJames Morris	  also require the SECMARK and CONNSECMARK targets, as
1224e5ab4cbSJames Morris	  well as any conntrack helpers for protocols which you
1234e5ab4cbSJames Morris	  wish to control.
1244e5ab4cbSJames Morris
1254e5ab4cbSJames Morris	  If you are unsure what do do here, select N.
1264e5ab4cbSJames Morris
127*016b9bdbSStephen Smalleyconfig SECURITY_SELINUX_POLICYDB_VERSION_MAX
128*016b9bdbSStephen Smalley	bool "NSA SELinux maximum supported policy format version"
129*016b9bdbSStephen Smalley	depends on SECURITY_SELINUX
130*016b9bdbSStephen Smalley	default n
131*016b9bdbSStephen Smalley	help
132*016b9bdbSStephen Smalley	  This option enables the maximum policy format version supported
133*016b9bdbSStephen Smalley	  by SELinux to be set to a particular value.  This value is reported
134*016b9bdbSStephen Smalley	  to userspace via /selinux/policyvers and used at policy load time.
135*016b9bdbSStephen Smalley	  It can be adjusted downward to support legacy userland (init) that
136*016b9bdbSStephen Smalley	  does not correctly handle kernels that support newer policy versions.
137*016b9bdbSStephen Smalley
138*016b9bdbSStephen Smalley	  Examples:
139*016b9bdbSStephen Smalley	  For the Fedora Core 3 or 4 Linux distributions, enable this option
140*016b9bdbSStephen Smalley	  and set the value via the next option. For Fedore Core 5 and later,
141*016b9bdbSStephen Smalley	  do not enable this option.
142*016b9bdbSStephen Smalley
143*016b9bdbSStephen Smalley	  If you are unsure how to answer this question, answer N.
144*016b9bdbSStephen Smalley
145*016b9bdbSStephen Smalleyconfig SECURITY_SELINUX_POLICYDB_VERSION_MAX_VALUE
146*016b9bdbSStephen Smalley	int "NSA SELinux maximum supported policy format version value"
147*016b9bdbSStephen Smalley	depends on SECURITY_SELINUX_POLICYDB_VERSION_MAX
148*016b9bdbSStephen Smalley	range 15 20
149*016b9bdbSStephen Smalley	default 19
150*016b9bdbSStephen Smalley	help
151*016b9bdbSStephen Smalley	  This option sets the value for the maximum policy format version
152*016b9bdbSStephen Smalley	  supported by SELinux.
153*016b9bdbSStephen Smalley
154*016b9bdbSStephen Smalley	  Examples:
155*016b9bdbSStephen Smalley	  For Fedora Core 3, use 18.
156*016b9bdbSStephen Smalley	  For Fedora Core 4, use 19.
157*016b9bdbSStephen Smalley
158*016b9bdbSStephen Smalley	  If you are unsure how to answer this question, look for the
159*016b9bdbSStephen Smalley	  policy format version supported by your policy toolchain, by
160*016b9bdbSStephen Smalley	  running 'checkpolicy -V'. Or look at what policy you have
161*016b9bdbSStephen Smalley	  installed under /etc/selinux/$SELINUXTYPE/policy, where
162*016b9bdbSStephen Smalley	  SELINUXTYPE is defined in your /etc/selinux/config.
163*016b9bdbSStephen Smalley
164