SELinuxで権限がない処理を行ったときのpermissiveモードでのログ

あるディレクトリにファイルを作成するPerlスクリプトCGI経由で実行するときにその挙動がSELinux的に許可されていないときのpermissiveモードでのログは次のような感じ。

  1. audit(1153293699.464:19): avc: denied { write } for pid=28742 comm="test.cgi" name="dat" dev=dm-0 ino=2425101 scontext=root:system_r:httpd_sys_script_t tcontext=root:object_r:httpd_sys_script_exec_t tclass=dir
  2. audit(1153293699.465:20): avc: denied { add_name } for pid=28742 comm="test.cgi" name="test.txt" scontext=root:system_r:httpd_sys_script_t tcontext=root:object_r:httpd_sys_script_exec_t tclass=dir
  3. audit(1153293699.466:21): avc: denied { create } for pid=28742 comm="test.cgi" name="test.txt" scontext=root:system_r:httpd_sys_script_t tcontext=root:object_r:httpd_sys_script_exec_t tclass=file
  4. audit(1153293699.474:22): avc: denied { write } for pid=28742 comm="test.cgi" name="test.txt" dev=dm-0 ino=2425103 scontext=root:system_r:httpd_sys_script_t tcontext=root:object_r:httpd_sys_script_exec_t tclass=file

つまり、このような挙動が許可されていない。逆に言えば、このような挙動を許可するつもりならば、このログを参照してポリシーを設定すればいいということ。