blob: c980dfe9abf17afc5431048fd7df58b69562955b [file] [log] [blame]
Kees Cook504f2312017-05-13 04:51:43 -07001===========================
2Linux Security Module Usage
3===========================
Kees Cooke163bc82011-11-01 17:20:01 -07004
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_DEFAULT_SECURITY and can be overridden at boot-time via the
Kees Cook504f2312017-05-13 04:51:43 -070010``"security=..."`` kernel command line argument, in the case where multiple
Kees Cooke163bc82011-11-01 17:20:01 -070011LSMs were built into a given kernel.
12
13The primary users of the LSM interface are Mandatory Access Control
14(MAC) extensions which provide a comprehensive security policy. Examples
15include SELinux, Smack, Tomoyo, and AppArmor. In addition to the larger
16MAC extensions, other extensions can be built using the LSM to provide
17specific changes to system operation when these tweaks are not available
18in the core functionality of Linux itself.
19
20Without a specific LSM built into the kernel, the default LSM will be the
21Linux capabilities system. Most LSMs choose to extend the capabilities
22system, building their checks on top of the defined capability hooks.
Kees Cook504f2312017-05-13 04:51:43 -070023For more details on capabilities, see ``capabilities(7)`` in the Linux
Kees Cooke163bc82011-11-01 17:20:01 -070024man-pages project.
25
Casey Schauflerd69dece52017-01-18 17:09:05 -080026A list of the active security modules can be found by reading
Kees Cook504f2312017-05-13 04:51:43 -070027``/sys/kernel/security/lsm``. This is a comma separated list, and
Casey Schauflerd69dece52017-01-18 17:09:05 -080028will always include the capability module. The list reflects the
29order in which checks are made. The capability module will always
30be first, followed by any "minor" modules (e.g. Yama) and then
31the one "major" module (e.g. SELinux) if there is one configured.
Kees Cook229fd052017-05-13 04:51:44 -070032
33.. toctree::
34 :maxdepth: 1
35
Kees Cook26fccd92017-05-13 04:51:45 -070036 apparmor
Kees Cook30da4f72017-05-13 04:51:48 -070037 LoadPin
Kees Cook229fd052017-05-13 04:51:44 -070038 SELinux
Kees Cooka5606ce2017-05-13 04:51:49 -070039 Smack
Kees Cook5ea672c2017-05-13 04:51:46 -070040 tomoyo
Kees Cook90bb7662017-05-13 04:51:47 -070041 Yama