← Documents Documentation/userspace-api/lsm.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API

Linux Security Modules 사용자 API

현재 process의 LSM security attribute와 이를 설정·조회·나열하는 syscall을 설명합니다.

Source pathDocumentation/userspace-api/lsm.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

lsm.rst:1-73

LSM_ATTR_CURRENT·EXEC·FSCREATE·KEYCREATE·PREV·SOCKCREATE의 의미, proc 경로와 module별 지원 범위를 정리한 사용자 API 문서입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2 .. Copyright (C) 2022 Casey Schaufler <[email protected]>
3 .. Copyright (C) 2022 Intel Corporation
4
5 =====================================
6 Linux Security Modules
7 =====================================
8
9 :Author: Casey Schaufler
10 :Date: July 2023
11
12 Linux security modules (LSM) provide a mechanism to implement
13 additional access controls to the Linux security policies.
14
15 The various security modules may support any of these attributes:
16
17 ``LSM_ATTR_CURRENT`` is the current, active security context of the
18 process.
19 The proc filesystem provides this value in ``/proc/self/attr/current``.
20 This is supported by the SELinux, Smack and AppArmor security modules.
21 Smack also provides this value in ``/proc/self/attr/smack/current``.
22 AppArmor also provides this value in ``/proc/self/attr/apparmor/current``.
23
24 ``LSM_ATTR_EXEC`` is the security context of the process at the time the
25 current image was executed.
26 The proc filesystem provides this value in ``/proc/self/attr/exec``.
27 This is supported by the SELinux and AppArmor security modules.
28 AppArmor also provides this value in ``/proc/self/attr/apparmor/exec``.
29
30 ``LSM_ATTR_FSCREATE`` is the security context of the process used when
31 creating file system objects.
32 The proc filesystem provides this value in ``/proc/self/attr/fscreate``.
33 This is supported by the SELinux security module.
34
35 ``LSM_ATTR_KEYCREATE`` is the security context of the process used when
36 creating key objects.
37 The proc filesystem provides this value in ``/proc/self/attr/keycreate``.
38 This is supported by the SELinux security module.
39
40 ``LSM_ATTR_PREV`` is the security context of the process at the time the
41 current security context was set.
42 The proc filesystem provides this value in ``/proc/self/attr/prev``.
43 This is supported by the SELinux and AppArmor security modules.
44 AppArmor also provides this value in ``/proc/self/attr/apparmor/prev``.
45
46 ``LSM_ATTR_SOCKCREATE`` is the security context of the process used when
47 creating socket objects.
48 The proc filesystem provides this value in ``/proc/self/attr/sockcreate``.
49 This is supported by the SELinux security module.
50
51 Kernel interface
52 ================
53
54 Set a security attribute of the current process
55 -----------------------------------------------
56
57 .. kernel-doc:: security/lsm_syscalls.c
58 :identifiers: sys_lsm_set_self_attr
59
60 Get the specified security attributes of the current process
61 ------------------------------------------------------------
62
63 .. kernel-doc:: security/lsm_syscalls.c
64 :identifiers: sys_lsm_get_self_attr
65
66 .. kernel-doc:: security/lsm_syscalls.c
67 :identifiers: sys_lsm_list_modules
68
69 Additional documentation
70 ========================
71
72 * Documentation/security/lsm.rst
73 * Documentation/security/lsm-development.rst
74

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

개요

1-13

이 문서는 GPL-2.0 라이선스로 제공되며 2022년 Casey Schaufler와 Intel Corporation의 저작권 고지를 포함합니다. 저자는 Casey Schaufler이고 문서 날짜는 2023년 7월입니다.

Linux Security Modules(LSM)는 Linux 보안 정책에 추가 접근 제어를 구현하는 메커니즘을 제공합니다. 뒤에서 설명하는 attribute는 process의 여러 시점과 객체 생성 시 사용할 security context를 공통 API로 표현합니다.

LSM 사용자 API의 범위
항목설명
대상현재 process의 security context attribute
구현SELinux·Smack·AppArmor 등 security module
kernel APIlsm_set_self_attr·lsm_get_self_attr·lsm_list_modules

현재 process의 security attribute 조회·설정과 활성 module 목록 조회를 다룹니다.

.. SPDX-License-Identifier: GPL-2.0
.. Copyright (C) 2022 Casey Schaufler <[email protected]>
.. Copyright (C) 2022 Intel Corporation

=====================================
Linux Security Modules
=====================================

:Author: Casey Schaufler
:Date: July 2023

Linux security modules (LSM) provide a mechanism to implement
additional access controls to the Linux security policies.

LSM_ATTR_CURRENT

14-24

각 security module은 문서에 나열된 attribute 중 일부를 지원할 수 있습니다.

`LSM_ATTR_CURRENT`는 process의 현재 활성 security context입니다. proc filesystem은 `/proc/self/attr/current`에서 이 값을 제공합니다.

SELinux, Smack, AppArmor가 이 attribute를 지원합니다. Smack은 `/proc/self/attr/smack/current`, AppArmor는 `/proc/self/attr/apparmor/current` 경로에서도 같은 종류의 값을 제공합니다.

CURRENT 지원
항목설명
공통/proc/self/attr/current
SELinux공통 경로 지원
Smack공통 + /proc/self/attr/smack/current
AppArmor공통 + /proc/self/attr/apparmor/current

공통 proc 경로와 module별 경로입니다.


The various security modules may support any of these attributes:

``LSM_ATTR_CURRENT`` is the current, active security context of the
process.
The proc filesystem provides this value in ``/proc/self/attr/current``.
This is supported by the SELinux, Smack and AppArmor security modules.
Smack also provides this value in ``/proc/self/attr/smack/current``.
AppArmor also provides this value in ``/proc/self/attr/apparmor/current``.

``LSM_ATTR_EXEC`` is the security context of the process at the time the

LSM_ATTR_EXEC

25-32

`LSM_ATTR_EXEC`는 현재 image가 실행됐을 때 process에 적용할 security context입니다. proc filesystem은 `/proc/self/attr/exec`에서 이 값을 제공합니다.

SELinux와 AppArmor가 이 attribute를 지원하며, AppArmor는 `/proc/self/attr/apparmor/exec` 경로도 제공합니다.

EXEC 지원
항목설명
공통/proc/self/attr/exec
SELinux지원
AppArmor공통 + /proc/self/attr/apparmor/exec

실행 전환에 사용할 security context 경로입니다.

current image was executed.
The proc filesystem provides this value in ``/proc/self/attr/exec``.
This is supported by the SELinux and AppArmor security modules.
AppArmor also provides this value in ``/proc/self/attr/apparmor/exec``.

``LSM_ATTR_FSCREATE`` is the security context of the process used when
creating file system objects.
The proc filesystem provides this value in ``/proc/self/attr/fscreate``.

LSM_ATTR_FSCREATE

33-38

`LSM_ATTR_FSCREATE`는 filesystem 객체를 만들 때 process가 사용할 security context입니다.

proc filesystem 경로는 `/proc/self/attr/fscreate`이며 SELinux가 지원합니다.

FSCREATE
항목설명
proc 경로/proc/self/attr/fscreate
지원 moduleSELinux

새 filesystem 객체의 context를 지정합니다.

This is supported by the SELinux security module.

``LSM_ATTR_KEYCREATE`` is the security context of the process used when
creating key objects.
The proc filesystem provides this value in ``/proc/self/attr/keycreate``.
This is supported by the SELinux security module.

LSM_ATTR_KEYCREATE

39-44

`LSM_ATTR_KEYCREATE`는 key 객체를 만들 때 process가 사용할 security context입니다.

proc filesystem 경로는 `/proc/self/attr/keycreate`이며 SELinux가 지원합니다.

KEYCREATE
항목설명
proc 경로/proc/self/attr/keycreate
지원 moduleSELinux

새 key 객체의 context를 지정합니다.


``LSM_ATTR_PREV`` is the security context of the process at the time the
current security context was set.
The proc filesystem provides this value in ``/proc/self/attr/prev``.
This is supported by the SELinux and AppArmor security modules.
AppArmor also provides this value in ``/proc/self/attr/apparmor/prev``.

LSM_ATTR_PREV

45-52

`LSM_ATTR_PREV`는 현재 security context가 설정될 당시 process가 갖고 있던 이전 security context입니다. proc filesystem은 `/proc/self/attr/prev`에서 이 값을 제공합니다.

SELinux와 AppArmor가 지원하며, AppArmor는 `/proc/self/attr/apparmor/prev`도 제공합니다.

PREV 지원
항목설명
공통/proc/self/attr/prev
SELinux지원
AppArmor공통 + /proc/self/attr/apparmor/prev

현재 context 이전 값을 노출합니다.


``LSM_ATTR_SOCKCREATE`` is the security context of the process used when
creating socket objects.
The proc filesystem provides this value in ``/proc/self/attr/sockcreate``.
This is supported by the SELinux security module.

Kernel interface
================

LSM_ATTR_SOCKCREATE

53-58

`LSM_ATTR_SOCKCREATE`는 socket 객체를 만들 때 process가 사용할 security context입니다.

proc filesystem 경로는 `/proc/self/attr/sockcreate`이며 SELinux가 지원합니다.

SOCKCREATE
항목설명
proc 경로/proc/self/attr/sockcreate
지원 moduleSELinux

새 socket 객체의 context를 지정합니다.


Set a security attribute of the current process
-----------------------------------------------

.. kernel-doc:: security/lsm_syscalls.c
    :identifiers: sys_lsm_set_self_attr

Kernel interface

59-68

현재 process의 security attribute를 설정하는 syscall 문서는 `security/lsm_syscalls.c`의 `sys_lsm_set_self_attr` kernel-doc에서 생성됩니다.

지정한 security attribute를 가져오는 syscall 문서는 같은 파일의 `sys_lsm_get_self_attr`에서 생성됩니다.

사용 가능한 LSM module을 나열하는 syscall 문서는 `sys_lsm_list_modules`에서 생성됩니다.

LSM syscall
항목설명
sys_lsm_set_self_attr현재 process의 security attribute 설정
sys_lsm_get_self_attr지정한 security attribute 조회
sys_lsm_list_modules활성 LSM module 목록 조회

현재 process attribute와 module 목록을 다루는 세 interface입니다.


Get the specified security attributes of the current process
------------------------------------------------------------

.. kernel-doc:: security/lsm_syscalls.c
    :identifiers: sys_lsm_get_self_attr

.. kernel-doc:: security/lsm_syscalls.c
    :identifiers: sys_lsm_list_modules

추가 문서

69-73

LSM core 설명은 `Documentation/security/lsm.rst`를 참조합니다.

새 security module 개발자를 위한 세부 문서는 `Documentation/security/lsm-development.rst`를 참조합니다.

Additional documentation
========================

* Documentation/security/lsm.rst
* Documentation/security/lsm-development.rst