Bug 720572

Summary: SELinux is preventing /usr/sbin/zabbix_server_pgsql from write access on the directory /tmp
Product: [Fedora] Fedora Reporter: Anthony Messina <amessina>
Component: selinux-policy-targetedAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED WONTFIX QA Contact: Ben Levenson <benl>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: dwalsh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-07 19:58:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Raw AVCs none

Description Anthony Messina 2011-07-12 06:03:25 UTC
I have just installed zabbix-server-pgsql, with the server configured to access PostgreSQL on the unix socket, which happens to be in /tmp

srwxrwxrwx. 1 postgres postgres 0 Jul 12 00:55 .s.PGSQL.5432

Running in permissive mode: I am flooded with the following AVCs (which may not have anything to do with the PostgreSQL socket--I just mention it as many people may not have it configg'd that way.):


#============= zabbix_t ==============
#!!!! The source type 'zabbix_t' can write to a 'dir' of the following types:
# zabbix_log_t, var_run_t, var_log_t, zabbix_var_run_t, root_t

allow zabbix_t tmp_t:dir { write add_name };
#!!!! The source type 'zabbix_t' can write to a 'file' of the following types:
# zabbix_log_t, zabbix_var_run_t, root_t

allow zabbix_t tmp_t:file { write create open };

audit2allow -R

#============= zabbix_t ==============
#!!!! The source type 'zabbix_t' can write to a 'dir' of the following types:
# zabbix_log_t, var_run_t, var_log_t, zabbix_var_run_t, root_t


This takes quite the custom audit2allow policy to work:

[root@chicago ~]# cat fixzabbix.te

module fixzabbix 1.0;

require {
        type snmpd_var_lib_t;
        type tmp_t;
        type ping_exec_t;
        type zabbix_t;
        type usr_t;
        type shell_exec_t;
        type proc_t;
        type tmpfs_t;
        type bin_t;
        class process signal;
        class capability net_raw;
        class file { execute read create execute_no_trans write getattr unlink open };
        class rawip_socket { write read create setopt };
        class lnk_file read;
        class shm { write unix_read unix_write read destroy create };
        class dir { write remove_name getattr search add_name };
}

#============= zabbix_t ==============
allow zabbix_t bin_t:lnk_file read;
allow zabbix_t ping_exec_t:file { read execute open execute_no_trans };
allow zabbix_t proc_t:file { read getattr open };
allow zabbix_t self:capability net_raw;
allow zabbix_t self:process signal;
allow zabbix_t self:rawip_socket { write read create setopt };
allow zabbix_t self:shm { write unix_read unix_write read destroy create };
allow zabbix_t shell_exec_t:file { read execute open getattr execute_no_trans };
allow zabbix_t snmpd_var_lib_t:dir { getattr search };
#!!!! The source type 'zabbix_t' can write to a 'dir' of the following types:
# zabbix_log_t, var_run_t, var_log_t, zabbix_var_run_t, root_t

allow zabbix_t tmp_t:dir { write remove_name add_name };
#!!!! The source type 'zabbix_t' can write to a 'file' of the following types:
# zabbix_log_t, zabbix_var_run_t, root_t

allow zabbix_t tmp_t:file { write getattr read create unlink open };
allow zabbix_t tmpfs_t:file { read write };
allow zabbix_t usr_t:file { read getattr open };

allow zabbix_t tmp_t:dir { write add_name };
#!!!! The source type 'zabbix_t' can write to a 'file' of the following types:
# zabbix_log_t, zabbix_var_run_t, root_t

allow zabbix_t tmp_t:file { write create open };

Comment 1 Miroslav Grepl 2011-07-12 07:20:41 UTC
Anthony,
could you send me raw avc msgs (compressed audit.log)? I want to re-write zabbix policy.

Comment 2 Anthony Messina 2011-07-12 07:32:35 UTC
Created attachment 512350 [details]
Raw AVCs

grep zabbix /var/log/audit/audit.log > zabbix_avc.log

Comment 3 Fedora End Of Life 2012-08-07 19:58:42 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 15. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we were unable to fix it before Fedora 15 reached end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged to click on
"Clone This Bug" (top right of this page) and open it against that
version of Fedora.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping