blob: c2683f28ed367b51118a81c37be8ab696743dda4 [file] [log] [blame]
Kees Cooke163bc82011-11-01 17:20:01 -07001Linux Security Module framework
2-------------------------------
3
4The Linux Security Module (LSM) framework provides a mechanism for
5various security checks to be hooked by new kernel extensions. The name
6"module" is a bit of a misnomer since these extensions are not actually
7loadable kernel modules. Instead, they are selectable at build-time via
8CONFIG_DEFAULT_SECURITY and can be overridden at boot-time via the
9"security=..." kernel command line argument, in the case where multiple
10LSMs were built into a given kernel.
11
12The primary users of the LSM interface are Mandatory Access Control
13(MAC) extensions which provide a comprehensive security policy. Examples
14include SELinux, Smack, Tomoyo, and AppArmor. In addition to the larger
15MAC extensions, other extensions can be built using the LSM to provide
16specific changes to system operation when these tweaks are not available
17in the core functionality of Linux itself.
18
19Without a specific LSM built into the kernel, the default LSM will be the
20Linux capabilities system. Most LSMs choose to extend the capabilities
21system, building their checks on top of the defined capability hooks.
22For more details on capabilities, see capabilities(7) in the Linux
23man-pages project.
24
Casey Schauflerd69dece2017-01-18 17:09:05 -080025A list of the active security modules can be found by reading
26/sys/kernel/security/lsm. This is a comma separated list, and
27will always include the capability module. The list reflects the
28order in which checks are made. The capability module will always
29be first, followed by any "minor" modules (e.g. Yama) and then
30the one "major" module (e.g. SELinux) if there is one configured.
31
Pranith Kumar591bcb12014-06-09 11:55:23 -040032Based on https://lkml.org/lkml/2007/10/26/215,
Kees Cooke163bc82011-11-01 17:20:01 -070033a new LSM is accepted into the kernel when its intent (a description of
34what it tries to protect against and in what cases one would expect to
35use it) has been appropriately documented in Documentation/security/.
36This allows an LSM's code to be easily compared to its goals, and so
37that end users and distros can make a more informed decision about which
38LSMs suit their requirements.
39
40For extensive documentation on the available LSM hook interfaces, please
41see include/linux/security.h.