Bug 981672 - SELinux is preventing qmgr from 'read' accesses on the file /etc/postfix/main.cf.
Summary: SELinux is preventing qmgr from 'read' accesses on the file /etc/postfix/main...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 18
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:24017b13074b2e53fb4a3bad642...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-05 12:52 UTC by George Sicherman
Modified: 2013-07-12 12:49 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-12 12:49:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description George Sicherman 2013-07-05 12:52:32 UTC
Description of problem:
When my system booted, it automatically started Postfix.  The SELinux messages started coming immediately.
SELinux is preventing qmgr from 'read' accesses on the file /etc/postfix/main.cf.

*****  Plugin restorecon (99.5 confidence) suggests  *************************

If you want to fix the label. 
/etc/postfix/main.cf default label should be postfix_etc_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /etc/postfix/main.cf

*****  Plugin catchall (1.49 confidence) suggests  ***************************

If you believe that qmgr should be allowed read access on the main.cf file 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 qmgr /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:postfix_qmgr_t:s0
Target Context                system_u:object_r:etc_aliases_t:s0
Target Objects                /etc/postfix/main.cf [ file ]
Source                        qmgr
Source Path                   qmgr
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           postfix-2.9.6-5.fc18.x86_64
Target RPM Packages           postfix-2.9.6-5.fc18.x86_64
Policy RPM                    selinux-policy-3.11.1-97.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.9.6-200.fc18.x86_64 #1 SMP Thu
                              Jun 13 18:56:55 UTC 2013 x86_64 x86_64
Alert Count                   686
First Seen                    2013-07-04 21:12:35 EDT
Last Seen                     2013-07-05 08:49:21 EDT
Local ID                      7c15b017-7756-484a-b016-7d64269e4673

Raw Audit Messages
type=AVC msg=audit(1373028561.142:1879): avc:  denied  { read } for  pid=2617 comm="qmgr" name="main.cf" dev="dm-1" ino=426338 scontext=system_u:system_r:postfix_qmgr_t:s0 tcontext=system_u:object_r:etc_aliases_t:s0 tclass=file


type=SYSCALL msg=audit(1373028561.142:1879): arch=x86_64 syscall=open success=no exit=EACCES a0=7f904d6550c0 a1=0 a2=0 a3=25 items=0 ppid=1115 pid=2617 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=qmgr exe=/usr/libexec/postfix/qmgr subj=system_u:system_r:postfix_qmgr_t:s0 key=(null)

Hash: qmgr,postfix_qmgr_t,etc_aliases_t,file,read

audit2allow

#============= postfix_qmgr_t ==============
allow postfix_qmgr_t etc_aliases_t:file read;

audit2allow -R
require {
	type postfix_qmgr_t;
}

#============= postfix_qmgr_t ==============
mta_read_aliases(postfix_qmgr_t)


Additional info:
reporter:       libreport-2.1.5
hashmarkername: setroubleshoot
kernel:         3.9.6-200.fc18.x86_64
type:           libreport

Comment 1 Daniel Walsh 2013-07-10 23:02:27 UTC
c06d5fe6673b332871ba54443d869f29a1ab4f04 fixes this in git.

Comment 2 Miroslav Grepl 2013-07-12 12:49:11 UTC
This is more mislabeling file.

George,
could you run

# restorecon -R -v /etc/postfix

and re-open it if you see it again. Thank you.


Note You need to log in before you can comment on or make changes to this bug.