Kees Cook | 504f231 | 2017-05-13 04:51:43 -0700 | [diff] [blame] | 1 | =========================== |
| 2 | Linux Security Module Usage |
| 3 | =========================== |
Kees Cook | e163bc8 | 2011-11-01 17:20:01 -0700 | [diff] [blame] | 4 | |
| 5 | The Linux Security Module (LSM) framework provides a mechanism for |
| 6 | various 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 |
| 8 | loadable kernel modules. Instead, they are selectable at build-time via |
| 9 | CONFIG_DEFAULT_SECURITY and can be overridden at boot-time via the |
Kees Cook | 504f231 | 2017-05-13 04:51:43 -0700 | [diff] [blame] | 10 | ``"security=..."`` kernel command line argument, in the case where multiple |
Kees Cook | e163bc8 | 2011-11-01 17:20:01 -0700 | [diff] [blame] | 11 | LSMs were built into a given kernel. |
| 12 | |
| 13 | The primary users of the LSM interface are Mandatory Access Control |
| 14 | (MAC) extensions which provide a comprehensive security policy. Examples |
| 15 | include SELinux, Smack, Tomoyo, and AppArmor. In addition to the larger |
| 16 | MAC extensions, other extensions can be built using the LSM to provide |
| 17 | specific changes to system operation when these tweaks are not available |
| 18 | in the core functionality of Linux itself. |
| 19 | |
| 20 | Without a specific LSM built into the kernel, the default LSM will be the |
| 21 | Linux capabilities system. Most LSMs choose to extend the capabilities |
| 22 | system, building their checks on top of the defined capability hooks. |
Kees Cook | 504f231 | 2017-05-13 04:51:43 -0700 | [diff] [blame] | 23 | For more details on capabilities, see ``capabilities(7)`` in the Linux |
Kees Cook | e163bc8 | 2011-11-01 17:20:01 -0700 | [diff] [blame] | 24 | man-pages project. |
| 25 | |
Casey Schaufler | d69dece5 | 2017-01-18 17:09:05 -0800 | [diff] [blame] | 26 | A list of the active security modules can be found by reading |
Kees Cook | 504f231 | 2017-05-13 04:51:43 -0700 | [diff] [blame] | 27 | ``/sys/kernel/security/lsm``. This is a comma separated list, and |
Casey Schaufler | d69dece5 | 2017-01-18 17:09:05 -0800 | [diff] [blame] | 28 | will always include the capability module. The list reflects the |
| 29 | order in which checks are made. The capability module will always |
| 30 | be first, followed by any "minor" modules (e.g. Yama) and then |
| 31 | the one "major" module (e.g. SELinux) if there is one configured. |
Kees Cook | 229fd05 | 2017-05-13 04:51:44 -0700 | [diff] [blame] | 32 | |
| 33 | .. toctree:: |
| 34 | :maxdepth: 1 |
| 35 | |
Kees Cook | 26fccd9 | 2017-05-13 04:51:45 -0700 | [diff] [blame] | 36 | apparmor |
Kees Cook | 30da4f7 | 2017-05-13 04:51:48 -0700 | [diff] [blame] | 37 | LoadPin |
Kees Cook | 229fd05 | 2017-05-13 04:51:44 -0700 | [diff] [blame] | 38 | SELinux |
Kees Cook | a5606ce | 2017-05-13 04:51:49 -0700 | [diff] [blame] | 39 | Smack |
Kees Cook | 5ea672c | 2017-05-13 04:51:46 -0700 | [diff] [blame] | 40 | tomoyo |
Kees Cook | 90bb766 | 2017-05-13 04:51:47 -0700 | [diff] [blame] | 41 | Yama |