2ba6aac11129bb94721e2ae5d69b788efcd09960
Linux/SELinux.md
| ... | ... | @@ -25,6 +25,23 @@ |
| 25 | 25 | ```
|
| 26 | 26 | - [SELinuxの動作モードをコマンドラインで切り替えるには - @IT](http://www.atmarkit.co.jp/flinux/rensai/linuxtips/979selinuxenforce.html)
|
| 27 | 27 | |
| 28 | +# 動作モードの永続的変更
|
|
| 29 | +- Disabled → Enforcing の場合、設定不備等で最悪起動しなくなる可能性があるので、一旦 Permissive で動作確認する。
|
|
| 30 | +- Disabled → Permissive/Enforcing の場合、再起動時に再ラベル付けが行われるため、起動に時間が掛かることがある。
|
|
| 31 | +- /etc/selinux/config
|
|
| 32 | + - Permissive
|
|
| 33 | + ```
|
|
| 34 | + SELINUX=permissive
|
|
| 35 | + SELINUXTYPE=targeted
|
|
| 36 | + ```
|
|
| 37 | + - Enforcing
|
|
| 38 | + ```
|
|
| 39 | + SELINUX=enforcing
|
|
| 40 | + SELINUXTYPE=targeted
|
|
| 41 | + ```
|
|
| 42 | +
|
|
| 43 | +- [第2章 SELinux のステータスおよびモードの変更 Red Hat Enterprise Linux 8 | Red Hat Customer Portal](https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/8/html/using_selinux/changing-selinux-states-and-modes_using-selinux)
|
|
| 44 | +
|
|
| 28 | 45 | # ログ分析
|
| 29 | 46 | - ログ分析
|
| 30 | 47 | ```
|
| ... | ... | @@ -263,7 +280,7 @@ sub sortInBracket |
| 263 | 280 | ```
|
| 264 | 281 | - 動的コンテンツ
|
| 265 | 282 | ```
|
| 266 | - # chcon -R -t httpd_sys_script_exec_t <ディレクトリ>
|
|
| 283 | + # find . -name "*.cgi" -or -name "*.pl" | xargs chcon -v -t httpd_sys_script_exec_t
|
|
| 267 | 284 | ```
|
| 268 | 285 | - シンボリックリンクに対してコンテキストの変更を行うと、デフォルトではリンク先のコンテキストが変更される。
|
| 269 | 286 | シンボリックリンク自体のコンテキストを変更するには「--no-dereference」を指定する。
|