xref: /linux/Documentation/admin-guide/LSM/index.rst (revision 12d5fc96ebbb3b948861805b32a4c3a96105ccd9)
1===========================
2Linux Security Module Usage
3===========================
4
5The Linux Security Module (LSM) framework provides a mechanism for
6various security checks to be hooked by new kernel extensions. The name
7"module" is a bit of a misnomer since these extensions are not actually
8loadable kernel modules. Instead, they are selectable at build-time via
9CONFIG_LSM, an ordered list of the LSMs to enable, and can be
10overridden at boot-time via the ``"lsm=..."`` kernel command line
11argument. The ``"security=..."`` kernel command line argument remains
12available to choose a legacy "major" security module, but has been
13deprecated by the ``"lsm=..."`` parameter.
14
15The primary users of the LSM interface are Mandatory Access Control
16(MAC) extensions which provide a comprehensive security policy. Examples
17include SELinux, Smack, Tomoyo, and AppArmor. In addition to the larger
18MAC extensions, other extensions can be built using the LSM to provide
19specific changes to system operation when these tweaks are not available
20in the core functionality of Linux itself.
21
22The Linux capabilities modules will always be included. This may be
23followed by any number of "minor" modules and at most one "major" module.
24For more details on capabilities, see ``capabilities(7)`` in the Linux
25man-pages project.
26
27A list of the active security modules can be found by reading
28``/sys/kernel/security/lsm``. This is a comma separated list, and
29will always include the capability module. The list reflects the
30order in which checks are made. The capability module will be
31first, unless CONFIG_SECURITY_LOCKDOWN_LSM_EARLY is enabled, in
32which case the lockdown module will precede it. The integrity
33modules (e.g. IMA and EVM), if enabled in the kernel
34configuration, are always placed at the end of the list. Any
35other "minor" modules (e.g. Yama) and the one "major" module
36(e.g. SELinux), if there is one configured, appear in between,
37in the order given by CONFIG_LSM or the ``"lsm=..."`` kernel
38command line parameter.
39
40Process attributes associated with "major" security modules should
41be accessed and maintained using the special files in ``/proc/.../attr``.
42A security module may maintain a module specific subdirectory there,
43named after the module. ``/proc/.../attr/smack`` is provided by the Smack
44security module and contains all its special files. The files directly
45in ``/proc/.../attr`` remain as legacy interfaces for modules that provide
46subdirectories.
47
48.. toctree::
49   :maxdepth: 1
50
51   apparmor
52   LoadPin
53   SELinux
54   Smack
55   tomoyo
56   Yama
57   SafeSetID
58   ipe
59   landlock
60