Aggiornamento selinux-policy-targeted su virtual machine vmware
Ahhrgh panico! I siti si caricano però le pagine dinamiche hanno qualche problema...
Ummmm, vuoi vedere che è colpa di SELinux? Avete presente il parafulmini?
Infatti con un bel:
>tail -f /var/log/messages
Nov 27 13:55:51 web01 kernel: audit(1196168151.942:21): avc: denied { name_connect } for pid=2279 comm="httpd" dest=43 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:reserved_port_t:s0 tclass=tcp_socket
Nov 27 16:37:14 web01 kernel: audit(1196177834.774:22): avc: denied { name_connect } for pid=2279 comm="httpd" dest=43 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:reserved_port_t:s0 tclass=tcp_socket
Nov 28 06:11:15 web01 kernel: audit(1196226675.834:23): avc: denied { name_connect } for pid=2280 comm="httpd" dest=43 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:reserved_port_t:s0 tclass=tcp_socket
Nov 28 12:37:12 web01 kernel: audit(1196249832.393:24): avc: denied { append } for pid=9315 comm="sendmail" name="access_log" dev=dm-0 ino=6286320 scontext=system_u:system_r:system_mail_t:s0 tcontext=root:object_r:httpd_sys_content_t:s0 tclass=file
Nov 28 12:37:12 web01 kernel: audit(1196249832.394:25): avc: denied { read } for pid=9315 comm="sendmail" name="[10513]" dev=eventpollfs ino=10513 scontext=system_u:system_r:system_mail_t:s0 tcontext=system_u:system_r:httpd_t:s0 tclass=file
Nov 29 05:40:07 web01 kernel: audit(1196311207.673:26): avc: denied { name_connect } for pid=2278 comm="httpd" dest=43 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:reserved_port_t:s0 tclass=tcp_socket
eccolo la, infatti con
>setenforce 0tutto torna a rifunzionare...
allora proviamo a controllare le impostazioni SELinux di httpd (apache)
>getseboolean -a|grep httpd
allow_httpd_anon_write --> off
allow_httpd_apcupsd_cgi_script_anon_write --> off
allow_httpd_bugzilla_script_anon_write --> off
allow_httpd_mod_auth_pam --> off
allow_httpd_nagios_script_anon_write --> off
allow_httpd_squid_script_anon_write --> off
allow_httpd_sys_script_anon_write --> off
httpd_builtin_scripting --> on
httpd_can_network_connect --> off
httpd_can_network_connect_db --> off
httpd_can_network_relay --> off
httpd_disable_trans --> off
httpd_enable_cgi --> on
httpd_enable_ftp_server --> off
httpd_enable_homedirs --> on
httpd_rotatelogs_disable_trans --> off
httpd_ssi_exec --> off
httpd_suexec_disable_trans --> off
httpd_tty_comm --> off
httpd_unified --> on
eccola, l'avete vista la magagna?
Allora rimediamo con:
>setsebool httpd_can_network_connect_db one
>setsebool httpd_can_network_connect on
riprovo a riabilitare SELinux con
>setenforce 1
e magicamente tutto funziona!
infatti controllando nei log
>tail -f /var/log/messages
Nov 29 19:10:45 web01 kernel: audit(1196359845.077:27): bool=httpd_can_network_connect_db val=1 old_val=0 auid=4294967295
Nov 29 19:10:45 web01 kernel: audit(1196359845.849:28): user pid=1882 uid=81 auid=4294967295 subj=system_u:system_r:system_dbusd_t:s0 msg='avc: received policyload notice (seqno=2)
Nov 29 19:10:45 web01 kernel: : exe="?" (sauid=81, hostname=?, addr=?, terminal=?)'
Nov 29 19:10:53 web01 setsebool: The httpd_can_network_connect_db policy boolean was changed to on by root
Nov 29 19:11:32 web01 kernel: audit(1196359892.377:29): bool=httpd_can_network_connect val=1 old_val=0 auid=4294967295
Nov 29 19:11:32 web01 kernel: audit(1196359892.399:30): user pid=1882 uid=81 auid=4294967295 subj=system_u:system_r:system_dbusd_t:s0 msg='avc: received policyload notice (seqno=3)
Nov 29 19:11:32 web01 kernel: : exe="?" (sauid=81, hostname=?, addr=?, terminal=?)'
Nov 29 19:11:34 web01 setsebool: The httpd_can_network_connect policy boolean was changed to on by root
Nov 29 19:11:51 web01 kernel: audit(1196359911.409:31): enforcing=1 old_enforcing=0 auid=4294967295
Nov 29 19:11:51 web01 kernel: audit(1196359911.412:32): user pid=1882 uid=81 auid=4294967295 subj=system_u:system_r:system_dbusd_t:s0 msg='avc: received setenforce notice (enforcing=1)
Nov 29 19:11:51 web01 kernel: : exe="?" (sauid=81, hostname=?, addr=?, terminal=?)'
Ma come può essere successo?
Pensa che ti ripensa, vuoi vedere che si è trattato di un aggiornamento auto-magico?
E infatti dal
> cat /var/log/yum.log|grep selinux
Oct 12 13:17:02 Updated: libselinux.i386 1.33.4-2.fc6
Oct 12 13:22:47 Updated: libselinux-python.i386 1.33.4-2.fc6
Oct 12 13:35:10 Updated: selinux-policy.noarch 2.4.6-94.fc6
Oct 12 13:35:32 Updated: selinux-policy-devel.noarch 2.4.6-94.fc6
Oct 12 13:42:30 Updated: selinux-policy-targeted.noarch 2.4.6-94.fc6
ecco trovata la patata, molto meglio usare la prossima volta "Yum VersionLock e VMWare server e tools"
Beh adesso lo sapete anche voi, magari la prossima volta che vi succede qualcosa di inspiegabile avete un'idea in più su quello che può capitare... :D
Byez














Digg/dgrossato
Flickr/dgrossato
Linkedin/dgrossato
YouTube/dgrossato
Del.icio.us/dgrossato
Technorati/dgrossato
MyBlogLog/dgrossato