[SELinux] 'ps aux' vanuit httpd toestaan

Pagina: 1
Acties:

Acties:
  • 0 Henk 'm!

  • LeonM
  • Registratie: Oktober 2001
  • Laatst online: 26-08 08:22
Ik heb een webapplicatie welke bepaalde processen probeert te monitoren dmv:
PHP:
1
exec('ps aux | grep <proces>');


Echter is de CentOS 6.2 server geconfigureerd met SELinux (welke ik niet wil uitschakelen). En SELinux staat alleen toe om attributen van /proc/<pid> te lezen waarvan httpd eigenaar is.

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
--------------------------------------------------------------------------------

SELinux is preventing /bin/ps from getattr access on the directory /proc/<pid>.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that ps should be allowed getattr access on the <pid> directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep ps /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp


Uiteraard heb ik via audit2allow een local audit gegenereerd en geinstalleerd, maar dit mocht niet baten. Blijkbaar gebeurd dat wel vaker, getuige deze HowTo van CentOS. Die howto heb ik gevolgd maar zonder enig succes.

Hoe krijg ik SELinux zover dat getattr word toegestaan voor httpd voor elke /proc/<pid> directory?