# cd /etc/selinux/targeted/src/policy/domains/program # audit2allow -d >> apache.te# cd /etc/selinux/targeted/src/policy # make # make reload
# setenforse 1
SELinuxの最近のブログ記事
{} アクセス・ベクター
exe= プロセスの名前
name= アクセスしたファイル(ディレクトリ)名
scontext= プロセスのドメイン
tcontext= ファイルのタイプ
tclass= オブジェクトクラス
■例:
Feb 23 12:11:46 sv001 kernel: audit(1109128306.119:0): avc: denied { search } for pid=5453 exe=/usr/sbin/suexec name=hoge dev=dm-0 ino=294936 scontext=user_u:system_r:httpd_suexec_t
tcontext=system_u:object_r:user_home_dir_t
tclass=dir
Feb 23 12:11:46 sv001 kernel: audit(1109128306.129:0): avc: denied { search } for pid=5453 exe=/usr/bin/perl scontext=user_u:system_r:httpd_sys_script_t
tcontext=system_u:object_r:sysctl_kernel_t
tclass=dir
Feb 23 12:11:46 sv001 kernel: audit(1109128306.129:0): avc: denied { read } for pid=5453 exe=/usr/bin/perl scontext=user_u:system_r:httpd_sys_script_t
tcontext=system_u:object_r:sysctl_kernel_t
tclass=file
■全部
# fixfiles relabel■ユーザーディレクトリのpublic_htmlを初期化する
# restorecon -R /home■タイプの変更
# chcon system_u:object_r:httpd_sys_content_t <ディレクトリ> -R
■現在のモードをみる
# getenforce■モードを切り替える
# setenforce 0 // Permissiveモードになる # setenforce 1 // enforcingモードになる■設定ファイル
#cat /etc/sysconfig/selinux # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - SELinux is fully disabled. SELINUX=enforcing #SELINUX=disabled # SELINUXTYPE= type of policy in use. Possible values are: # targeted - Only targeted network daemons are protected. # strict - Full SELinux protection. SELINUXTYPE=targeted
