요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
Dummy policy
SELinux.rst:29-44시험용 dummy policy의 compile·설치·filesystem relabel 절차를 설명합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
=======
SELinux
=======
Information about the SELinux kernel subsystem can be found at the
following links:
https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git/tree/README.md
https://github.com/selinuxproject/selinux-kernel/wiki
Information about the SELinux userspace can be found at:
https://github.com/SELinuxProject/selinux/wiki
If you want to use SELinux, chances are you will want
to use the distro-provided policies, or install the
latest reference policy release from
https://github.com/SELinuxProject/refpolicy
However, if you want to install a dummy policy for
testing, you can do using ``mdp`` provided under
scripts/selinux. Note that this requires the selinux
userspace to be installed - in particular you will
need checkpolicy to compile a kernel, and setfiles and
fixfiles to label the filesystem.
1. Compile the kernel with selinux enabled.
2. Type ``make`` to compile ``mdp``.
3. Make sure that you are not running with
SELinux enabled and a real policy. If
you are, reboot with selinux disabled
before continuing.
4. Run install_policy.sh::
cd scripts/selinux
sh install_policy.sh
Step 4 will create a new dummy policy valid for your
kernel, with a single selinux user, role, and type.
It will compile the policy, will set your ``SELINUXTYPE`` to
``dummy`` in ``/etc/selinux/config``, install the compiled policy
as ``dummy``, and relabel your filesystem.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Kernel과 userspace 자료
1-15SELinux kernel subsystem 정보는 다음 자료에서 확인할 수 있습니다.
배포판 policy와 dummy policy
16-28SELinux를 사용하려면 대개 distribution이 제공하는 policy를 쓰거나 최신 reference policy release를 설치합니다.
시험용 dummy policy를 설치하려면 `scripts/selinux` 아래의 `mdp`를 사용할 수 있습니다. SELinux userspace가 설치되어 있어야 하며, kernel policy를 compile하려면 특히 `checkpolicy`, filesystem을 label하려면 `setfiles`와 `fixfiles`가 필요합니다.
Dummy policy 설치 절차
29-39| 단계 | 작업 |
|---|---|
| 1 | SELinux를 활성화하여 kernel을 compile합니다. |
| 2 | `make`로 `mdp`를 compile합니다. |
| 3 | SELinux와 실제 policy를 활성화한 상태가 아닌지 확인합니다. 활성화되어 있다면 SELinux를 끄고 reboot한 뒤 계속합니다. |
| 4 | `install_policy.sh`를 실행합니다. |
cd scripts/selinux
sh install_policy.sh
설치 결과
40-444단계는 현재 kernel에 유효하고 SELinux user, role, type이 각각 하나인 새 dummy policy를 만듭니다.
Policy를 compile하고 `/etc/selinux/config`의 `SELINUXTYPE`을 `dummy`로 설정하며, compile한 policy를 `dummy`로 설치한 뒤 filesystem을 다시 label합니다.
SELinux 자료
SELinux.rst:1-28Kernel, userspace와 reference policy 자료를 연결합니다.