Bug 1590210
| Summary: | selinux preventing clamdscan | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Dr I J Ormshaw <ian_ormshaw> | ||||
| Component: | selinux-policy-targeted | Assignee: | Lukas Vrabec <lvrabec> | ||||
| Status: | CLOSED NOTABUG | QA Contact: | Ben Levenson <benl> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 28 | CC: | dwalsh | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2018-06-23 10:40:21 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: |
|
||||||
The following command
ausearch -m avc --start recent
gives
----
time->Tue Jun 12 09:28:52 2018
type=AVC msg=audit(1528792132.849:796): avc: denied { open } for pid=2598 comm="clamd" path="/home/ian/.ssh" dev="dm-0" ino=16807248 scontext=system_u:system_r:antivirus_t:s0 tcontext=unconfined_u:object_r:ssh_home_t:s0 tclass=dir permissive=1
----
time->Tue Jun 12 09:28:52 2018
type=AVC msg=audit(1528792132.849:795): avc: denied { read } for pid=2598 comm="clamd" name=".ssh" dev="dm-0" ino=16807248 scontext=system_u:system_r:antivirus_t:s0 tcontext=unconfined_u:object_r:ssh_home_t:s0 tclass=dir permissive=1
This is not something we would want to allow by default. This basically allows a tool that is reading untrusted content to read valuable secrets in users home directories. If you want to allow this then you need to create a custom policy and load it. ausearch -m avc --start recent | audit2allow -M myantivirus semodule -i myantivirus.pp |
Created attachment 1450355 [details] Clamd config file Description of problem: With selinux enabled clamdscan produses the following error [ian@WM-ADVMSTECH-03 ~]$ clamdscan . /home/ian/.: lstat() failed: Permission denied. ERROR Version-Release number of selected component (if applicable): This appears only to be a problem with server edition. The KDE spin does not exhibit the same problem How reproducible: Steps to Reproduce: 1. Install clamd and clamav 2. run clamdscan . Actual results: [ian@WM-ADVMSTECH-03 ~]$ sudo setenforce 1 [ian@WM-ADVMSTECH-03 ~]$ clamdscan . /home/ian/.: lstat() failed: Permission denied. ERROR ----------- SCAN SUMMARY ----------- Infected files: 0 Total errors: 1 Time: 0.001 sec (0 m 0 s) Expected results: [ian@WM-ADVMSTECH-03 ~]$ clamdscan . /home/ian/.: OK ----------- SCAN SUMMARY ----------- Infected files: 0 Time: 24.393 sec (0 m 24 s) [ian@WM-ADVMSTECH-03 ~]$ Additional info: The expected results were obtained after the following command. sudo setenforce 0