2019-05-19 12:07:45 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2005-04-16 22:20:36 +00:00
|
|
|
config SECURITY_SELINUX
|
2023-07-18 17:13:35 +00:00
|
|
|
bool "SELinux Support"
|
2006-02-07 20:58:51 +00:00
|
|
|
depends on SECURITY_NETWORK && AUDIT && NET && INET
|
[SECMARK]: Add new packet controls to SELinux
Add new per-packet access controls to SELinux, replacing the old
packet controls.
Packets are labeled with the iptables SECMARK and CONNSECMARK targets,
then security policy for the packets is enforced with these controls.
To allow for a smooth transition to the new controls, the old code is
still present, but not active by default. To restore previous
behavior, the old controls may be activated at runtime by writing a
'1' to /selinux/compat_net, and also via the kernel boot parameter
selinux_compat_net. Switching between the network control models
requires the security load_policy permission. The old controls will
probably eventually be removed and any continued use is discouraged.
With this patch, the new secmark controls for SElinux are disabled by
default, so existing behavior is entirely preserved, and the user is
not affected at all.
It also provides a config option to enable the secmark controls by
default (which can always be overridden at boot and runtime). It is
also noted in the kconfig help that the user will need updated
userspace if enabling secmark controls for SELinux and that they'll
probably need the SECMARK and CONNMARK targets, and conntrack protocol
helpers, although such decisions are beyond the scope of kernel
configuration.
Signed-off-by: James Morris <jmorris@namei.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-06-09 07:33:33 +00:00
|
|
|
select NETWORK_SECMARK
|
2005-04-16 22:20:36 +00:00
|
|
|
default n
|
|
|
|
help
|
2023-07-18 17:13:35 +00:00
|
|
|
This selects Security-Enhanced Linux (SELinux).
|
2005-04-16 22:20:36 +00:00
|
|
|
You will also need a policy configuration and a labeled filesystem.
|
|
|
|
If you are unsure how to answer this question, answer N.
|
|
|
|
|
|
|
|
config SECURITY_SELINUX_BOOTPARAM
|
2023-07-18 17:13:35 +00:00
|
|
|
bool "SELinux boot parameter"
|
2005-04-16 22:20:36 +00:00
|
|
|
depends on SECURITY_SELINUX
|
|
|
|
default n
|
|
|
|
help
|
|
|
|
This option adds a kernel parameter 'selinux', which allows SELinux
|
|
|
|
to be disabled at boot. If this option is selected, SELinux
|
|
|
|
functionality can be disabled with selinux=0 on the kernel
|
|
|
|
command line. The purpose of this option is to allow a single
|
|
|
|
kernel image to be distributed with SELinux built in, but not
|
|
|
|
necessarily enabled.
|
|
|
|
|
|
|
|
If you are unsure how to answer this question, answer N.
|
|
|
|
|
|
|
|
config SECURITY_SELINUX_DEVELOP
|
2023-07-18 17:13:35 +00:00
|
|
|
bool "SELinux Development Support"
|
2005-04-16 22:20:36 +00:00
|
|
|
depends on SECURITY_SELINUX
|
|
|
|
default y
|
|
|
|
help
|
2023-07-18 17:13:35 +00:00
|
|
|
This enables the development support option of SELinux,
|
2005-04-16 22:20:36 +00:00
|
|
|
which is useful for experimenting with SELinux and developing
|
|
|
|
policies. If unsure, say Y. With this option enabled, the
|
|
|
|
kernel will start in permissive mode (log everything, deny nothing)
|
|
|
|
unless you specify enforcing=1 on the kernel command line. You
|
|
|
|
can interactively toggle the kernel between enforcing mode and
|
2020-01-07 16:35:04 +00:00
|
|
|
permissive mode (if permitted by the policy) via
|
|
|
|
/sys/fs/selinux/enforce.
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
config SECURITY_SELINUX_AVC_STATS
|
2023-07-18 17:13:35 +00:00
|
|
|
bool "SELinux AVC Statistics"
|
2005-04-16 22:20:36 +00:00
|
|
|
depends on SECURITY_SELINUX
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
This option collects access vector cache statistics to
|
2020-01-07 16:35:04 +00:00
|
|
|
/sys/fs/selinux/avc/cache_stats, which may be monitored via
|
2005-04-16 22:20:36 +00:00
|
|
|
tools such as avcstat.
|
|
|
|
|
2019-11-22 09:33:06 +00:00
|
|
|
config SECURITY_SELINUX_SIDTAB_HASH_BITS
|
2023-07-18 17:13:35 +00:00
|
|
|
int "SELinux sidtab hashtable size"
|
2019-11-22 09:33:06 +00:00
|
|
|
depends on SECURITY_SELINUX
|
|
|
|
range 8 13
|
|
|
|
default 9
|
|
|
|
help
|
|
|
|
This option sets the number of buckets used in the sidtab hashtable
|
|
|
|
to 2^SECURITY_SELINUX_SIDTAB_HASH_BITS buckets. The number of hash
|
|
|
|
collisions may be viewed at /sys/fs/selinux/ss/sidtab_hash_stats. If
|
|
|
|
chain lengths are high (e.g. > 20) then selecting a higher value here
|
|
|
|
will ensure that lookups times are short and stable.
|
2019-11-26 13:57:00 +00:00
|
|
|
|
|
|
|
config SECURITY_SELINUX_SID2STR_CACHE_SIZE
|
2023-07-18 17:13:35 +00:00
|
|
|
int "SELinux SID to context string translation cache size"
|
2019-11-26 13:57:00 +00:00
|
|
|
depends on SECURITY_SELINUX
|
|
|
|
default 256
|
|
|
|
help
|
|
|
|
This option defines the size of the internal SID -> context string
|
|
|
|
cache, which improves the performance of context to string
|
|
|
|
conversion. Setting this option to 0 disables the cache completely.
|
|
|
|
|
|
|
|
If unsure, keep the default value.
|
2023-07-18 18:49:19 +00:00
|
|
|
|
|
|
|
config SECURITY_SELINUX_DEBUG
|
|
|
|
bool "SELinux kernel debugging support"
|
|
|
|
depends on SECURITY_SELINUX
|
|
|
|
default n
|
|
|
|
help
|
|
|
|
This enables debugging code designed to help SELinux kernel
|
|
|
|
developers, unless you know what this does in the kernel code you
|
|
|
|
should leave this disabled.
|
2023-08-18 15:12:14 +00:00
|
|
|
|
|
|
|
To fine control the messages to be printed enable
|
|
|
|
CONFIG_DYNAMIC_DEBUG and see
|
|
|
|
Documentation/admin-guide/dynamic-debug-howto.rst for additional
|
|
|
|
information.
|
|
|
|
|
|
|
|
Example usage:
|
|
|
|
|
|
|
|
echo -n 'file "security/selinux/*" +p' > \
|
|
|
|
/proc/dynamic_debug/control
|