page counter next up previous contents
Next: SELinux 基本用法 Up: SELinux Previous: 啟動、關閉與觀察   Contents   DYWANG_HOME

SELinux 執行策略

  1. 配置檔案 /etc/selinux/config 還包含了 SELinux 執行策略的資訊,透過改變變數 SELINUXTYPE 的值實現:
    [root@kvm7 ~]# tail -5 /etc/selinux/config 
    # SELINUXTYPE= can take one of three two values:
    #     targeted - Targeted processes are protected,
    #     minimum - Modification of targeted policy. Only selected processes are protected. 
    #     mls - Multi Level Security protection.
    SELINUXTYPE=targeted
    
  2. 策略說明
    1. targeted:預設使用的策略,對大部分網絡服務程序進行管制。
    2. minimum:以 targeted 為基礎,僅對選定的網絡服務程序進行管制。
    3. mls:多級安全保護,對所有的程序進行管制,是最嚴格的策略,配置難度非常大。一般不用,除非對安全性有極高的要求。
  3. 查詢系統只安裝 targeted 策略。
    [root@kvm7 ~]# ll -lrt /etc/selinux/
    total 12
    -rw-r--r--. 1 root root 2321 Jun 10  2014 semanage.conf
    drwxr-xr-x. 6 root root 4096 Dec 28  2018 targeted
    -rw-r--r--. 1 root root  546 Oct 14 19:24 config
    
  4. 若要使用 mls 策略必須安裝 安裝套件。
    [root@kvm7 ~]# yum install selinux-policy-mls
    



De-Yu Wang 2020-05-14