요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. 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.
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
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``.
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_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_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
================
Set a security attribute of the current process
-----------------------------------------------
.. kernel-doc:: security/lsm_syscalls.c
:identifiers: sys_lsm_set_self_attr
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
Additional documentation
========================
* Documentation/security/lsm.rst
* Documentation/security/lsm-development.rst
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로 표현합니다.
현재 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` 경로에서도 같은 종류의 값을 제공합니다.
공통 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` 경로도 제공합니다.
실행 전환에 사용할 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가 지원합니다.
새 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가 지원합니다.
새 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`도 제공합니다.
현재 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가 지원합니다.
새 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`에서 생성됩니다.
현재 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-73LSM core 설명은 `Documentation/security/lsm.rst`를 참조합니다.
새 security module 개발자를 위한 세부 문서는 `Documentation/security/lsm-development.rst`를 참조합니다.
Additional documentation
========================
* Documentation/security/lsm.rst
* Documentation/security/lsm-development.rst
요약·해설
lsm.rst:1-73LSM_ATTR_CURRENT·EXEC·FSCREATE·KEYCREATE·PREV·SOCKCREATE의 의미, proc 경로와 module별 지원 범위를 정리한 사용자 API 문서입니다.