Bug 618107 - SELinux is preventing /usr/sbin/postalias "write" access on /etc/postfix.
SELinux is preventing /usr/sbin/postalias "write" access on /etc/postfix.
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
13
i386 Linux
low Severity medium
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
setroubleshoot_trace_hash:8400978dffe...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-26 03:02 EDT by Clinton Work
Modified: 2010-08-10 17:41 EDT (History)
2 users (show)

See Also:
Fixed In Version: selinux-policy-3.7.19-44.fc13
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-08-10 17:41:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Clinton Work 2010-07-26 03:02:49 EDT
Summary:

SELinux is preventing /usr/sbin/postalias "write" access on /etc/postfix.

Detailed Description:

SELinux denied access requested by postalias. It is not expected that this
access is required by postalias and this access may signal an intrusion attempt.
It is also possible that the specific version or configuration of the
application is causing it to require additional access.

Allowing Access:

You can generate a local policy module to allow this access - see FAQ
(http://docs.fedoraproject.org/selinux-faq-fc5/#id2961385) Please file a bug
report.

Additional Information:

Source Context                unconfined_u:system_r:postfix_master_t:s0
Target Context                system_u:object_r:postfix_etc_t:s0
Target Objects                /etc/postfix [ dir ]
Source                        postalias
Source Path                   /usr/sbin/postalias
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           postfix-2.7.0-1.fc13
Target RPM Packages           postfix-2.7.0-1.fc13
Policy RPM                    selinux-policy-3.7.19-39.fc13
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   catchall
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.33.6-147.fc13.i686.PAE #1 SMP Tue Jul 6
                              22:24:44 UTC 2010 i686 i686
Alert Count                   0
First Seen                    Mon 26 Jul 2010 12:51:51 AM MDT
Last Seen                     Mon 26 Jul 2010 12:51:51 AM MDT
Local ID                      2acc7e8a-90cb-42ff-bc42-e01adf9c3f8d
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1280127111.537:27607): avc:  denied  { write } for  pid=4585 comm="postalias" name="postfix" dev=dm-0 ino=27527158 scontext=unconfined_u:system_r:postfix_master_t:s0 tcontext=system_u:object_r:postfix_etc_t:s0 tclass=dir

node=(removed) type=SYSCALL msg=audit(1280127111.537:27607): arch=40000003 syscall=5 success=no exit=-13 a0=12787b8 a1=80c2 a2=1a4 a3=1 items=0 ppid=4580 pid=4585 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=1 comm="postalias" exe="/usr/sbin/postalias" subj=unconfined_u:system_r:postfix_master_t:s0 key=(null)



Hash String generated from  catchall,postalias,postfix_master_t,postfix_etc_t,dir,write
audit2allow suggests:

#============= postfix_master_t ==============
#!!!! The source type 'postfix_master_t' can write to a 'dir' of the following type:
# postfix_spool_t
#!!!! The source type 'postfix_master_t' can write to a 'dir' of the following types:
# postfix_spool_t, etc_aliases_t
#!!!! The source type 'postfix_master_t' can write to a 'dir' of the following types:
# postfix_spool_t, etc_aliases_t, postfix_private_t
#!!!! The source type 'postfix_master_t' can write to a 'dir' of the following types:
# postfix_spool_t, etc_aliases_t, postfix_private_t, mailman_data_t
#!!!! The source type 'postfix_master_t' can write to a 'dir' of the following types:
# postfix_spool_t, etc_aliases_t, postfix_private_t, mailman_data_t, postfix_spool_flush_t
#!!!! The source type 'postfix_master_t' can write to a 'dir' of the following types:
# postfix_spool_t, etc_aliases_t, postfix_private_t, mailman_data_t, postfix_spool_flush_t, postfix_public_t
#!!!! The source type 'postfix_master_t' can write to a 'dir' of the following types:
# postfix_spool_t, etc_aliases_t, postfix_private_t, mailman_data_t, postfix_spool_flush_t, postfix_public_t, etc_t
#!!!! The source type 'postfix_master_t' can write to a 'dir' of the following types:
# postfix_spool_t, etc_aliases_t, postfix_private_t, mailman_data_t, postfix_spool_flush_t, postfix_public_t, etc_t, postfix_data_t
#!!!! The source type 'postfix_master_t' can write to a 'dir' of the following types:
# postfix_spool_t, etc_aliases_t, postfix_private_t, mailman_data_t, postfix_spool_flush_t, postfix_public_t, etc_t, postfix_data_t, var_spool_t
#!!!! The source type 'postfix_master_t' can write to a 'dir' of the following types:
# postfix_spool_t, etc_aliases_t, postfix_private_t, mailman_data_t, postfix_spool_flush_t, postfix_public_t, etc_t, postfix_data_t, var_spool_t, var_run_t
#!!!! The source type 'postfix_master_t' can write to a 'dir' of the following types:
# postfix_spool_t, etc_aliases_t, postfix_private_t, mailman_data_t, postfix_spool_flush_t, postfix_public_t, etc_t, postfix_data_t, var_spool_t, var_run_t, postfix_spool_maildrop_t
#!!!! The source type 'postfix_master_t' can write to a 'dir' of the following types:
# postfix_spool_t, etc_aliases_t, postfix_private_t, mailman_data_t, postfix_spool_flush_t, postfix_public_t, etc_t, postfix_data_t, var_spool_t, var_run_t, postfix_spool_maildrop_t, postfix_spool_bounce_t
#!!!! The source type 'postfix_master_t' can write to a 'dir' of the following types:
# postfix_spool_t, etc_aliases_t, postfix_private_t, mailman_data_t, postfix_spool_flush_t, postfix_public_t, etc_t, postfix_data_t, var_spool_t, var_run_t, postfix_spool_maildrop_t, postfix_spool_bounce_t, root_t

allow postfix_master_t postfix_etc_t:dir write;
Comment 1 Daniel Walsh 2010-07-29 13:05:49 EDT
Any idea what file postalias is trying to write in /etc/postfix?
Comment 2 Clinton Work 2010-07-29 14:24:00 EDT
(In reply to comment #1)
> Any idea what file postalias is trying to write in /etc/postfix?    

Yeah, postalias was trying to write /etc/postfix/aliases 


My postfix main.cf is configured to put the aliases file in /etc/postfix/aliases.
alias_database = hash:/etc/postfix/aliases

Looks like the fedora default is slightly different:
alias_database = hash:/etc/aliases
Comment 3 Daniel Walsh 2010-07-29 15:09:45 EDT
The problem is the policy is not allowing it to create the file there.


Miroslav lets add

########################################
## <summary>
##	Type transition files created in calling dir 
##	to the mail address aliases type.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <param name="domain">
##	<summary>
##	Directory to transition on.
##	</summary>
## </param>
#
interface(`mta_filetrans_aliases',`
	filetrans_pattern($1, $2, etc_aliases_t, file)
')

mta_filetrans_aliases(postfix_master_t, postfix_etc_t)
Comment 4 Clinton Work 2010-07-29 15:21:41 EDT
I guess I got a couple of options then: 

a) move the alias file to the standard location
b) write a local selinux policy to cover my custom configuration
c) Disable SELinux entirely.   

Are you willing to support another alias file location in the selinux policy or is option a) the recommended solution?
Comment 5 Daniel Walsh 2010-07-30 14:50:22 EDT
We have some policy to handle the /etc/postfix location.  The problem seems to be the policy only covers the case where the file was pre-existing.  We will fix the policy but "a" would be a good option.
Comment 6 Miroslav Grepl 2010-08-02 08:52:36 EDT
Fixed in selinux-policy-3.7.19-42.fc13.
Comment 7 Fedora Update System 2010-08-06 09:41:52 EDT
selinux-policy-3.7.19-44.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/selinux-policy-3.7.19-44.fc13
Comment 8 Fedora Update System 2010-08-06 17:01:04 EDT
selinux-policy-3.7.19-44.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/selinux-policy-3.7.19-44.fc13
Comment 9 Fedora Update System 2010-08-10 17:40:18 EDT
selinux-policy-3.7.19-44.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

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