← Documents Documentation/admin-guide/LSM/SELinux.rst GitHub 원문 ↗

Linux 6.18.37 · Administration / LSM

SELinux

SELinux kernel·userspace 자료와 reference policy, scripts/selinux의 mdp를 이용한 dummy policy 설치 절차를 안내합니다.

Source pathDocumentation/admin-guide/LSM/SELinux.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

SELinux 자료

SELinux.rst:1-28

Kernel, userspace와 reference policy 자료를 연결합니다.

Dummy policy

SELinux.rst:29-44

시험용 dummy policy의 compile·설치·filesystem relabel 절차를 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 =======
2 SELinux
3 =======
4
5 Information about the SELinux kernel subsystem can be found at the
6 following links:
7
8 https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git/tree/README.md
9
10 https://github.com/selinuxproject/selinux-kernel/wiki
11
12 Information about the SELinux userspace can be found at:
13
14 https://github.com/SELinuxProject/selinux/wiki
15
16 If you want to use SELinux, chances are you will want
17 to use the distro-provided policies, or install the
18 latest reference policy release from
19
20 https://github.com/SELinuxProject/refpolicy
21
22 However, if you want to install a dummy policy for
23 testing, you can do using ``mdp`` provided under
24 scripts/selinux. Note that this requires the selinux
25 userspace to be installed - in particular you will
26 need checkpolicy to compile a kernel, and setfiles and
27 fixfiles to label the filesystem.
28
29 1. Compile the kernel with selinux enabled.
30 2. Type ``make`` to compile ``mdp``.
31 3. Make sure that you are not running with
32 SELinux enabled and a real policy. If
33 you are, reboot with selinux disabled
34 before continuing.
35 4. Run install_policy.sh::
36
37 cd scripts/selinux
38 sh install_policy.sh
39
40 Step 4 will create a new dummy policy valid for your
41 kernel, with a single selinux user, role, and type.
42 It will compile the policy, will set your ``SELINUXTYPE`` to
43 ``dummy`` in ``/etc/selinux/config``, install the compiled policy
44 as ``dummy``, and relabel your filesystem.
45

3. 한국어 전문 번역

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

배포판 policy와 dummy policy

16-28

SELinux를 사용하려면 대개 distribution이 제공하는 policy를 쓰거나 최신 reference policy release를 설치합니다.

시험용 dummy policy를 설치하려면 `scripts/selinux` 아래의 `mdp`를 사용할 수 있습니다. SELinux userspace가 설치되어 있어야 하며, kernel policy를 compile하려면 특히 `checkpolicy`, filesystem을 label하려면 `setfiles`와 `fixfiles`가 필요합니다.

Dummy policy 설치 절차

29-39
단계작업
1SELinux를 활성화하여 kernel을 compile합니다.
2`make`로 `mdp`를 compile합니다.
3SELinux와 실제 policy를 활성화한 상태가 아닌지 확인합니다. 활성화되어 있다면 SELinux를 끄고 reboot한 뒤 계속합니다.
4`install_policy.sh`를 실행합니다.
cd scripts/selinux
sh install_policy.sh

설치 결과

40-44

4단계는 현재 kernel에 유효하고 SELinux user, role, type이 각각 하나인 새 dummy policy를 만듭니다.

Policy를 compile하고 `/etc/selinux/config`의 `SELINUXTYPE`을 `dummy`로 설정하며, compile한 policy를 `dummy`로 설치한 뒤 filesystem을 다시 label합니다.