SELinux semanageの導入

 
概要:SELinuxが制御するファイルタイプを設定するツールsemanageを導入します。
 

1.semanageの確認

semanageがインストールされているか確認します。以下のようなメッセージが表示された場合はインストールされていません。

# which semanage
/usr/bin/which: no semanage in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin)
 

2.パッケージの調査

yumコマンドでsemanageがどのパッケージに含まれているか調べます。

# yum provides *bin/semanage
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * base: mirror.fairway.ne.jp
 * extras: mirror.fairway.ne.jp
 * updates: mirror.fairway.ne.jp

policycoreutils-pythonパッケージに含まれていることが分かります。

 

3.semanageのインストール

policycoreutils-pythonと依存しているパッケージをインストールします。

# yum install policycoreutils-python
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * base: mirror.fairway.ne.jp
 * extras: mirror.fairway.ne.jp
 * updates: mirror.fairway.ne.jp
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package policycoreutils-python.i686 0:2.0.83-19.30.el6 will be installed
--> Processing Dependency: libsemanage-python >= 2.0.43-4 for package: policycoreutils-python-2.0.83-19.30.el6.i686
--> Processing Dependency: audit-libs-python >= 1.4.2-1 for package: policycoreutils-python-2.0.83-19.30.el6.i686
--> Processing Dependency: setools-libs-python for package: policycoreutils-python-2.0.83-19.30.el6.i686
--> Processing Dependency: libselinux-python for package: policycoreutils-python-2.0.83-19.30.el6.i686
--> Processing Dependency: libcgroup for package: policycoreutils-python-2.0.83-19.30.el6.i686
--> Running transaction check
---> Package audit-libs-python.i686 0:2.2-2.el6 will be installed
---> Package libcgroup.i686 0:0.37-7.2.el6_4 will be installed
---> Package libselinux-python.i686 0:2.0.94-5.3.el6_4.1 will be installed
--> Processing Dependency: libselinux = 2.0.94-5.3.el6_4.1 for package: libselinux-python-2.0.94-5.3.el6_4.1.i686
---> Package libsemanage-python.i686 0:2.0.43-4.2.el6 will be installed
---> Package setools-libs-python.i686 0:3.3.7-4.el6 will be installed
--> Processing Dependency: setools-libs = 3.3.7-4.el6 for package: setools-libs-python-3.3.7-4.el6.i686
--> Processing Dependency: libsefs.so.4(VERS_4.0) for package: setools-libs-python-3.3.7-4.el6.i686
--> Processing Dependency: libsefs.so.4 for package: setools-libs-python-3.3.7-4.el6.i686
--> Processing Dependency: libseaudit.so.4(VERS_4.2) for package: setools-libs-python-3.3.7-4.el6.i686
--> Processing Dependency: libseaudit.so.4(VERS_4.1) for package: setools-libs-python-3.3.7-4.el6.i686
--> Processing Dependency: libseaudit.so.4 for package: setools-libs-python-3.3.7-4.el6.i686
--> Processing Dependency: libqpol.so.1(VERS_1.4) for package: setools-libs-python-3.3.7-4.el6.i686
--> Processing Dependency: libqpol.so.1(VERS_1.3) for package: setools-libs-python-3.3.7-4.el6.i686
--> Processing Dependency: libqpol.so.1(VERS_1.2) for package: setools-libs-python-3.3.7-4.el6.i686
--> Processing Dependency: libqpol.so.1 for package: setools-libs-python-3.3.7-4.el6.i686
--> Processing Dependency: libpoldiff.so.1(VERS_1.3) for package: setools-libs-python-3.3.7-4.el6.i686
--> Processing Dependency: libpoldiff.so.1(VERS_1.2) for package: setools-libs-python-3.3.7-4.el6.i686
--> Processing Dependency: libpoldiff.so.1 for package: setools-libs-python-3.3.7-4.el6.i686
--> Processing Dependency: libapol.so.4(VERS_4.1) for package: setools-libs-python-3.3.7-4.el6.i686
--> Processing Dependency: libapol.so.4(VERS_4.0) for package: setools-libs-python-3.3.7-4.el6.i686
--> Processing Dependency: libapol.so.4 for package: setools-libs-python-3.3.7-4.el6.i686
--> Running transaction check
---> Package libselinux.i686 0:2.0.94-5.3.el6 will be updated
--> Processing Dependency: libselinux = 2.0.94-5.3.el6 for package: libselinux-utils-2.0.94-5.3.el6.i686
---> Package libselinux.i686 0:2.0.94-5.3.el6_4.1 will be an update
---> Package setools-libs.i686 0:3.3.7-4.el6 will be installed
--> Running transaction check
---> Package libselinux-utils.i686 0:2.0.94-5.3.el6 will be updated
---> Package libselinux-utils.i686 0:2.0.94-5.3.el6_4.1 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================
 Package                       Arch        Version                   Repository      Size
==========================================================================================
Installing:
 policycoreutils-python        i686        2.0.83-19.30.el6          base           340 k
Installing for dependencies:
 audit-libs-python             i686        2.2-2.el6                 base            57 k
 libcgroup                     i686        0.37-7.2.el6_4            updates        110 k
 libselinux-python             i686        2.0.94-5.3.el6_4.1        updates        199 k
 libsemanage-python            i686        2.0.43-4.2.el6            base            80 k
 setools-libs                  i686        3.3.7-4.el6               base           400 k
 setools-libs-python           i686        3.3.7-4.el6               base           210 k
Updating for dependencies:
 libselinux                    i686        2.0.94-5.3.el6_4.1        updates        108 k
 libselinux-utils              i686        2.0.94-5.3.el6_4.1        updates         81 k

Transaction Summary
==========================================================================================
Install       7 Package(s)
Upgrade       2 Package(s)

Total download size: 1.5 M
Is this ok [y/N]: y
Downloading Packages:
(1/9): audit-libs-python-2.2-2.el6.i686.rpm                        |  57 kB     00:00     
(2/9): libcgroup-0.37-7.2.el6_4.i686.rpm                           | 110 kB     00:00     
(3/9): libselinux-2.0.94-5.3.el6_4.1.i686.rpm                      | 108 kB     00:00     
(4/9): libselinux-python-2.0.94-5.3.el6_4.1.i686.rpm               | 199 kB     00:00     
(5/9): libselinux-utils-2.0.94-5.3.el6_4.1.i686.rpm                |  81 kB     00:00     
(6/9): libsemanage-python-2.0.43-4.2.el6.i686.rpm                  |  80 kB     00:00     
(7/9): policycoreutils-python-2.0.83-19.30.el6.i686.rpm            | 340 kB     00:01     
(8/9): setools-libs-3.3.7-4.el6.i686.rpm                           | 400 kB     00:01     
(9/9): setools-libs-python-3.3.7-4.el6.i686.rpm                    | 210 kB     00:00     
------------------------------------------------------------------------------------------
Total                                                     310 kB/s | 1.5 MB     00:05     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : libselinux-2.0.94-5.3.el6_4.1.i686                                    1/11
  Installing : setools-libs-3.3.7-4.el6.i686                                         2/11
  Installing : setools-libs-python-3.3.7-4.el6.i686                                  3/11
  Installing : libselinux-python-2.0.94-5.3.el6_4.1.i686                             4/11
  Installing : audit-libs-python-2.2-2.el6.i686                                      5/11
  Installing : libsemanage-python-2.0.43-4.2.el6.i686                                6/11
  Installing : libcgroup-0.37-7.2.el6_4.i686                                         7/11
  Installing : policycoreutils-python-2.0.83-19.30.el6.i686                          8/11
  Updating   : libselinux-utils-2.0.94-5.3.el6_4.1.i686                              9/11
  Cleanup    : libselinux-utils-2.0.94-5.3.el6.i686                                 10/11
  Cleanup    : libselinux-2.0.94-5.3.el6.i686                                       11/11
  Verifying  : setools-libs-3.3.7-4.el6.i686                                         1/11
  Verifying  : libcgroup-0.37-7.2.el6_4.i686                                         2/11
  Verifying  : libselinux-python-2.0.94-5.3.el6_4.1.i686                             3/11
  Verifying  : libselinux-utils-2.0.94-5.3.el6_4.1.i686                              4/11
  Verifying  : policycoreutils-python-2.0.83-19.30.el6.i686                          5/11
  Verifying  : libsemanage-python-2.0.43-4.2.el6.i686                                6/11
  Verifying  : audit-libs-python-2.2-2.el6.i686                                      7/11
  Verifying  : setools-libs-python-3.3.7-4.el6.i686                                  8/11
  Verifying  : libselinux-2.0.94-5.3.el6_4.1.i686                                    9/11
  Verifying  : libselinux-2.0.94-5.3.el6.i686                                       10/11
  Verifying  : libselinux-utils-2.0.94-5.3.el6.i686                                 11/11
Installed:
  policycoreutils-python.i686 0:2.0.83-19.30.el6
Dependency Installed:
  audit-libs-python.i686 0:2.2-2.el6            libcgroup.i686 0:0.37-7.2.el6_4
  libselinux-python.i686 0:2.0.94-5.3.el6_4.1   libsemanage-python.i686 0:2.0.43-4.2.el6
  setools-libs.i686 0:3.3.7-4.el6               setools-libs-python.i686 0:3.3.7-4.el6
Dependency Updated:
  libselinux.i686 0:2.0.94-5.3.el6_4.1     libselinux-utils.i686 0:2.0.94-5.3.el6_4.1

Complete!

以下のコマンドでインストールを確認します。コマンド実行後にsemanageの使用方法が表示されます。

# semanage
 

最終更新のRSS
Last-modified: 2014-03-11 (火) 02:00:03 (2276d)