Здравейте,
преди да започна да пиша, искам да кажа, че изчетох документацията за SELinux в сайта на федората и от там възникна следния въпрос и проблем.
Аз използвам Федора 6 и имам много съобщения в логовете като:
Цитат |
Aug 2 14:34:45 asgard kernel: audit(1186058085.931:2226): avc: denied { getattr } for pid=21344 comm="httpd" name="xmlrpclist.cs" dev=dm-0 ino=34448178 scontext=root:system_ r:httpd_t:s0 tcontext=root:object_r:var_t:s0 tclass=file Aug 2 14:35:15 asgard kernel: audit(1186058115.869:2227): avc: denied { getattr } for pid=21337 comm="httpd" name="index.php" dev=dm-0 ino=29105344 scontext=root:system_r:ht tpd_t:s0 tcontext=user_u:object_r:tmp_t:s0 tclass=file Aug 2 14:35:15 asgard kernel: audit(1186058115.912:2228): avc: denied { read } for pid=21337 comm="httpd" name="index.php" dev=dm-0 ino=29105344 scontext=root:system_r:httpd _t:s0 tcontext=user_u:object_r:tmp_t:s0 tclass=file Aug 2 14:35:16 asgard kernel: audit(1186058116.351:2229): avc: denied { read } for pid=21337 comm="httpd" name="storage" dev=dm-0 ino=29097988 scontext=root:system_r:httpd_t :s0 tcontext=user_u:object_r:tmp_t:s0 tclass=lnk_file Aug 2 14:35:22 asgard kernel: audit(1186058122.060:2230): avc: denied { getattr } for pid=26664 comm="httpd" name="storage" dev=dm-0 ino=29097988 scontext=root:system_r:http d_t:s0 tcontext=user_u:object_r:tmp_t:s0 tclass=lnk_file Aug 2 14:39:16 asgard nagios: SERVICE ALERT: w3host.cubaencuentro.com;Check load in remote machines;WARNING;SOFT;2;WARNING - load average: 11.16, 8.94, 6.30 Aug 2 14:43:21 asgard kernel: audit(1186058601.709:2231): avc: denied { read write } for pid=31839 comm="status.cgi" name="[3691849]" dev=sockfs ino=3691849 scontext=root:sy stem_r:nagios_cgi_t:s0 tcontext=root:system_r:httpd_t:s0 tclass=unix_stream_socket Aug 2 14:43:21 asgard kernel: audit(1186058601.709:2232): avc: denied { read write } for pid=31839 comm="status.cgi" name="[3695592]" dev=sockfs ino=3695592 scontext=root:sy stem_r:nagios_cgi_t:s0 tcontext=root:system_r:httpd_t:s0 tclass=tcp_socket Aug 2 14:43:21 asgard kernel: audit(1186058601.709:2233): avc: denied { append } for pid=31839 comm="status.cgi" name="trac.log" dev=dm-0 ino=38472960 scontext=root:system_r :nagios_cgi_t:s0 tcontext=user_u:object_r:httpd_sys_content_t:s0 tclass=file Aug 2 14:44:10 asgard nagios: SERVICE ALERT: w3host.cubaencuentro.com;Check load in remote machines;WARNING;SOFT;3;WARNING - load average: 15.61, 10.61, 7.54 Aug 2 14:44:11 asgard nagios: SERVICE ALERT: w3host.cubaencuentro.com;Check sensors;CRITICAL;SOFT;1;CHECK_NRPE: Socket timeout after 10 seconds. Aug 2 14:49:02 asgard kernel: audit(1186058942.932:2234): avc: denied { getattr } for pid=21344 comm="httpd" name="InfoIco.png" dev=dm-0 ino=29331988 scontext=root:system_r: httpd_t:s0 tcontext=user_u:object_r:tmp_t:s0 tclass=file
|
В документацията на SELinux пише, че трябва да използвам инструмента audit2allow и съответно да създам правила зе тези неща, които са блокирани. Между другото използвам селинукс в пермисив мод за сега.
Та в документацията пише, че нещата, които ги изведе audit2allow трябва да ги съхраня в /etc/selinux/$SELINUX/src/policy
примерно local.te и ако е необходимо да направя корекции в това, което генерира audit2allow в зависимост от моите нужди.
Проблемът е, че във федора 6, няма такъв път. Аз имам това:
Цитат |
[anebi@hugo ~]$ ls -la /etc/selinux/ total 64 drwxr-xr-x 3 root root 4096 Aug 2 15:03 . drwxr-xr-x 111 root root 12288 Aug 2 15:36 .. -rw-r--r-- 1 root root 513 Aug 2 15:03 config -r--r--r-- 1 root root 630 Jun 7 11:56 config,v -rw------- 1 root root 177 Apr 27 20:27 restorecond.conf -rw-r--r-- 1 root root 1752 Sep 29 2006 semanage.conf drwxr-xr-x 5 root root 4096 Aug 2 10:15 targeted [anebi@hugo ~]$ ls -la /etc/selinux/targeted/ total 56 drwxr-xr-x 5 root root 4096 Aug 2 10:15 . drwxr-xr-x 3 root root 4096 Aug 2 15:03 .. drwxr-xr-x 4 root root 4096 Aug 2 10:15 contexts drwxr-xr-x 4 root root 4096 Aug 2 10:15 modules drwxr-xr-x 2 root root 4096 Aug 2 14:33 policy -rw-r--r-- 1 root root 598 Jul 17 23:24 setrans.conf -rw-r--r-- 1 root root 176 Aug 2 10:15 seusers
|
къде трябва да съхраня този файл или ако има друг начин за решаване на тези неща как да го направя?
Другият ми въпрос е следния:
Както по горе ще видите audit deny забранява достъпа до даден файл, но пише name="index.php" и не е описан пътя до файла, как мога да разбера кой файл е точно, за да мога да проверя дали няма нещо друго нередно?