Bug 1417512

Summary: SELinux is preventing dovecot connection to Postgresql (policy is not included)
Product: [Fedora] Fedora Reporter: Illya <dev>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: dexter, dominick.grift, dwalsh, janfrode, lvrabec, mgrepl, mhlavink, plautrba, pmoore, pokorra.mailinglists, ssekidde
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: selinux-policy-3.13.1-225.20.fc25 selinux-policy-3.13.1-225.22.fc25 selinux-policy-3.13.1-225.23.fc25 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-01 16:38:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
generated SELinux policy that allows connection none

Description Illya 2017-01-30 02:08:16 UTC
Created attachment 1245697 [details]
generated SELinux policy that allows connection

Description of problem:
It is not possible to establish connection from dovecot to postgresql without custom policy

Version-Release number of selected component (if applicable):
dovecot-2.2.27-1.fc25.x86_64
dovecot-pgsql-2.2.27-1.fc25.x86_64
postgresql-server-9.5.5-1.fc25.x86_64

How reproducible:


Steps to Reproduce:
1. Install dovecot and postgresql
2. Configure dovecot to use postgres-db for user and alias storage
3. start services

Actual results:
grep dovecot /var/log/audit/audit.log | grep postgres 
type=AVC msg=audit(1485734136.164:3648): avc:  denied  { name_connect } for  pid=9291 comm="auth" dest=5432 scontext=system_u:system_r:dovecot_auth_t:s0 tcontext=system_u:object_r:postgresql_port_t:s0 tclass=tcp_socket permissive=0

Expected results:
Dovecot can connect DB or there is SE-bool comparable to httpd_can_network_connect_db or exim_can_connect_db

Additional info:
In attachment is generated SELinux policy, that allows connection

Comment 1 Fedora Update System 2017-08-14 15:21:12 UTC
selinux-policy-3.13.1-225.20.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-837f04c39a

Comment 2 Fedora Update System 2017-08-15 03:50:40 UTC
selinux-policy-3.13.1-225.20.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-837f04c39a

Comment 3 Fedora Update System 2017-08-27 06:21:40 UTC
selinux-policy-3.13.1-225.20.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 4 Fedora Update System 2017-09-01 09:34:13 UTC
selinux-policy-3.13.1-225.22.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-5d4f3635ee

Comment 5 Fedora Update System 2017-09-03 06:24:28 UTC
selinux-policy-3.13.1-225.22.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-5d4f3635ee

Comment 6 Fedora Update System 2017-09-07 23:19:49 UTC
selinux-policy-3.13.1-225.22.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2017-10-10 11:59:47 UTC
selinux-policy-3.13.1-225.23.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-4d00e4db6a

Comment 8 Fedora Update System 2017-10-11 04:21:44 UTC
selinux-policy-3.13.1-225.23.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-4d00e4db6a

Comment 9 Fedora Update System 2017-11-01 16:38:51 UTC
selinux-policy-3.13.1-225.23.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.