Невозможно изменить ТИП в целевом контексте безопасности - PullRequest
0 голосов
/ 23 декабря 2018

Я использую SELinux.Я использовал команду chcon, чтобы изменить свой ТИП в целевом контексте безопасности.Но chcon не имеет никакого эффекта.Я хочу изменить свой ТИП с undefined_t на httpd_t.

1.Оригинальный ТИП httpd процесса

[centos~]$ ps -efZ | grep httpd
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 root 27870 1  0 11:50 ? 00:00:00 /usr/local/apache/bin/httpd -k start
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 daemon 27874 27870  0 11:50 ? 00:00:00 /usr/local/apache/bin/httpd -k start
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 daemon 27875 27870  0 11:50 ? 00:00:00 /usr/local/apache/bin/httpd -k start
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 daemon 27876 27870  0 11:50 ? 00:00:00 /usr/local/apache/bin/httpd -k start
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 centos 27961 27132  0 11:50 pts/0 00:00:00 grep --color=auto httpd

2.Оригинальный ТИП httpd

[centos@bin]$ ls -lZ | grep httpd
-r-x--x--x. root   root   unconfined_u:object_r:usr_t:s0   httpd
[centos@bin]$ ls -lZ | grep apachectl
-r-x--x--x. centos centos unconfined_u:object_r:usr_t:s0   apachectl

3.Используется chcon для изменения ТИПА httpd

[centos@bin]$ sudo ./apachectl stop
[centos@bin]$ sudo chcon -t httpd_exec_t httpd

4.Новый ТИП httpd

[centos@bin]$ ls -lZ | grep httpd
-rwxr-xr-x. root   root   unconfined_u:object_r:httpd_exec_t:s0 httpd

5.Запустил httpd и проверил новый ТИП процесса httpd

[centos@bin]$ sudo ./apachectl start
[centos@bin]$ ps -efZ | grep httpd
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 root 3390 1  0 14:26 ? 00:00:00 /usr/local/apache/bin/httpd -k start
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 daemon 3394 3390  0 14:26 ? 00:00:00 /usr/local/apache/bin/httpd -k start
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 daemon 3395 3390  0 14:26 ? 00:00:00 /usr/local/apache/bin/httpd -k start
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 daemon 3396 3390  0 14:26 ? 00:00:00 /usr/local/apache/bin/httpd -k start
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 centos 3486 1974  0 14:26 pts/0 00:00:00 grep --color=auto httpd

chcon не дал эффекта.ТИП по-прежнему не определен.Что я должен делать?Понятия не имею.

...