Bug 1474814 - Permission denied when trying to access clamav-milter from postfix, through an UNIX socket.
Permission denied when trying to access clamav-milter from postfix, through a...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy (Show other bugs)
7.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Lukas Vrabec
BaseOS QE Security Team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-25 08:39 EDT by Ugo Bellavance
Modified: 2017-07-25 13:33 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-07-25 09:34:10 EDT
Type: Bug
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 Ugo Bellavance 2017-07-25 08:39:00 EDT
Description of problem:
When trying to access a milter (clamav-milter) from postfix, through an UNIX socket, I always get "permission denied"

Version-Release number of selected component (if applicable):
selinux-policy-3.13.1-102.el7_3.16.noarch

How reproducible:
Always

Steps to Reproduce:
1. Install the milter and its dependencies.
2. Configure the milter to listen to an UNIX socket (MilterSocket unix:/var/run/clamav-milter/clamav-milter.sock) and (re)start it. At this point, all is good.  The milter listens on the socket.
3. Configure postfix to access the milter through this socket, restart postfix.
4. Test sending an email.

Actual results:
warning: connect to Milter service unix:/var/run/clamav-milter/clamav-milter.sock: Permission denied
NOQUEUE: milter-reject: CONNECT from atq-vg-1.atqlan.agri-tracabilite.qc.ca[192.168.0.181]: 451 4.7.1 Service unavailable - try again later; proto=SMTP

Expected results:
Accepts the message

Additional info:
It's not SELinux related because the problem occurs even with setenforce=0. It's not even a real permission problem because it occurs even after a chmod 700 on the socket file. I know clamav-milter is not supported by Red Hat, but I don't think the 'permission denied' occurs, even with chmod 777:

# getfacl /var/run/clamav-milter/clamav-milter.sock
getfacl: Removing leading '/' from absolute path names
# file: var/run/clamav-milter/clamav-milter.sock
# owner: clamilt
# group: clamilt
user::rwx
group::rwx
other::rwx

I also tried setting the owner of the socket file to postfix. Still not good.
Comment 2 Petr Lautrbach 2017-07-25 09:34:10 EDT
(In reply to Ugo Bellavance from comment #0)
> Description of problem:
> When trying to access a milter (clamav-milter) from postfix, through an UNIX
> socket, I always get "permission denied"
> 
> Version-Release number of selected component (if applicable):
> selinux-policy-3.13.1-102.el7_3.16.noarch
> 
> How reproducible:
> Always
> 
> Steps to Reproduce:
> 1. Install the milter and its dependencies.
> 2. Configure the milter to listen to an UNIX socket (MilterSocket
> unix:/var/run/clamav-milter/clamav-milter.sock) and (re)start it. At this
> point, all is good.  The milter listens on the socket.
> 3. Configure postfix to access the milter through this socket, restart
> postfix.
> 4. Test sending an email.
> 
> Actual results:
> warning: connect to Milter service
> unix:/var/run/clamav-milter/clamav-milter.sock: Permission denied
> NOQUEUE: milter-reject: CONNECT from
> atq-vg-1.atqlan.agri-tracabilite.qc.ca[192.168.0.181]: 451 4.7.1 Service
> unavailable - try again later; proto=SMTP
> 
> Expected results:
> Accepts the message
> 
> Additional info:
> It's not SELinux related because the problem occurs even with setenforce=0.

Ok, closing as NOTABUG

> It's not even a real permission problem because it occurs even after a chmod
> 700 on the socket file. I know clamav-milter is not supported by Red Hat,
> but I don't think the 'permission denied' occurs, even with chmod 777:
> 
> # getfacl /var/run/clamav-milter/clamav-milter.sock
> getfacl: Removing leading '/' from absolute path names
> # file: var/run/clamav-milter/clamav-milter.sock
> # owner: clamilt
> # group: clamilt
> user::rwx
> group::rwx
> other::rwx
> 

What about the underlying directory?

# ls -ld /var/run/clamav-milter              
drwx--x---. 2 clamilt clamilt 40 Jul 25 15:27 /var/run/clamav-milter
Comment 3 Ugo Bellavance 2017-07-25 09:38:24 EDT
Thanks for your quick answer.

I know it is not an SELinux bug, but what component should I choose?

ll /var/run/clamav-milter/ -d
drwx--x---. 2 clamilt clamilt 40 Jul 25 08:50 /var/run/clamav-milter/
Comment 4 Ugo Bellavance 2017-07-25 13:33:22 EDT
You were right, permissions on the parent folder.  I'll figure it out.  Sorry for the noise.

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