SELinuxの最近のブログ記事

dmesgの内容からpolicyを更新する

|

# cd /etc/selinux/targeted/src/policy/domains/program
# audit2allow -d >> apache.te

# cd /etc/selinux/targeted/src/policy # make # make reload

# setenforse 1

{}    アクセス・ベクター
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

SELinuxの切り替え

|
■現在のモードをみる
# 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

このアーカイブについて

このページには、過去に書かれたブログ記事のうちSELinuxカテゴリに属しているものが含まれています。

前のカテゴリはRedHat系 Linuxです。

次のカテゴリはSolaris8です。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。

SELinux: 月別アーカイブ

Powered by Movable Type 4.1