Bug 1282043

Summary: SELinux is preventing esmtp from 'read' accesses on the file /root/.esmtp_queue/csudEFmV/mail.
Product: [Fedora] Fedora Reporter: Marco Guazzone <marco.guazzone>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 23CC: alain.carcel, dmitry, dominick.grift, dwalsh, iamroot, krzysztofbti, lvrabec, marco.guazzone, mark, mauricio.pronet, mgrepl, mikhail.rokhin, ollran, petr.chinchik, plautrba, reinouts, richkmeli, szmonszmon
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:4271d77dafbc5abd06b9924af51407620790386757b110b2c9ac6cb0cea7cce5;VARIANT_ID=workstation;
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-11 09:54:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marco Guazzone 2015-11-14 14:14:31 UTC
Description of problem:
SELinux is preventing esmtp from 'read' accesses on the file /root/.esmtp_queue/csudEFmV/mail.

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

If you want to fix the label. 
/root/.esmtp_queue/csudEFmV/mail default label should be mail_home_rw_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /root/.esmtp_queue/csudEFmV/mail

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

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

Additional Information:
Source Context                system_u:system_r:system_mail_t:s0-s0:c0.c1023
Target Context                system_u:object_r:admin_home_t:s0
Target Objects                /root/.esmtp_queue/csudEFmV/mail [ file ]
Source                        esmtp
Source Path                   esmtp
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-154.fc23.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.2.5-300.fc23.x86_64+debug #1 SMP
                              Tue Oct 27 04:11:34 UTC 2015 x86_64 x86_64
Alert Count                   1
First Seen                    2015-11-14 15:00:07 CET
Last Seen                     2015-11-14 15:00:07 CET
Local ID                      38b8f6b4-e2f7-406e-b066-7e7fcb362965

Raw Audit Messages
type=AVC msg=audit(1447509607.310:595): avc:  denied  { read } for  pid=32110 comm="esmtp" path="/root/.esmtp_queue/csudEFmV/mail" dev="sda6" ino=420351 scontext=system_u:system_r:system_mail_t:s0-s0:c0.c1023 tcontext=system_u:object_r:admin_home_t:s0 tclass=file permissive=0


Hash: esmtp,system_mail_t,admin_home_t,file,read

Version-Release number of selected component:
selinux-policy-3.13.1-154.fc23.noarch

Additional info:
reporter:       libreport-2.6.3
hashmarkername: setroubleshoot
kernel:         4.2.5-300.fc23.x86_64+debug
type:           libreport

Potential duplicate: bug 828094

Comment 1 Miroslav Grepl 2015-11-20 12:57:34 UTC
Could you please execute

# restorecon -Rv /root/.esmtp_queue

to fix this issue. The problem is how /root/.esmtp_queue was created. Did you create it by hand?

Comment 2 Marco Guazzone 2015-11-22 10:19:24 UTC
O(In reply to Miroslav Grepl from comment #1)
> Could you please execute
> 
> # restorecon -Rv /root/.esmtp_queue
> 
OK, done.

> to fix this issue. The problem is how /root/.esmtp_queue was created. Did
> you create it by hand?

No. I have no idea which program created this directory.
However, digging inside that dir I saw a lot of email messages from:
- freshclam (from package: clamav-update-0.98.7-3.fc23.x86_64)
- rkhunter (from package: rkhunter-1.4.2-8.fc23.noarch)

So, I suspect that one of the above apps created this directory.

Cheers,

Marco

Comment 3 Reinout van Schouwen 2016-03-09 12:35:13 UTC
Description of problem:
I just got an selinux alert.

Version-Release number of selected component:
selinux-policy-3.13.1-158.7.fc23.noarch

Additional info:
reporter:       libreport-2.6.4
hashmarkername: setroubleshoot
kernel:         4.4.2-301.fc23.x86_64
type:           libreport

Comment 4 Reinout van Schouwen 2016-03-09 12:37:00 UTC
I've also ran into this and installed freshclam.

Comment 5 Lukas Vrabec 2016-08-11 09:54:08 UTC

*** This bug has been marked as a duplicate of bug 1366173 ***