2016-05-17 4 views
0

chaque jour j'ai des messages d'erreur à cause de clam AV scan - c'est un problème selinux - j'ai déjà un module selinux créé - mais l'erreur n'est pas résolue. Quelqu'un pourrait-il y jeter un coup d'œil? Je pense que le module devrait permettre l'écriture, l'accès en lecture aux fichiers pour clamscan?Politique Selinux - ne fonctionne pas

erreur de SELinux:

Additional Information: 
Source Context    system_u:system_r:antivirus_t:s0-s0:c0.c1023 
Target Context    system_u:object_r:httpd_sys_rw_content_t:s0 
Target Objects    sess_604rv54bntl70jig0bjf1lfja4 [ file ] 
Source      clamscan 
Source Path     /usr/bin/clamscan 
Port       <Unknown> 
Host       myserver.com 
Source RPM Packages   clamav-0.99.1-1.el7.x86_64 
Target RPM Packages   
Policy RPM     selinux-policy-3.13.1-60.el7_2.3.noarch 
Selinux Enabled    True 
Policy Type     targeted 
Enforcing Mode    Enforcing 
Host Name      myserver.com 
Platform      Linux myserver.com 
          3.10.0-327.18.2.el7.x86_64 #1 SMP Thu May 12 
          11:03:55 UTC 2016 x86_64 x86_64 
Alert Count     94 
First Seen     2016-05-15 03:56:15 CEST 
Last Seen      2016-05-17 03:45:49 CEST 
Local ID      68ee97b8-2226-4481-97be-1eeccbb0e566 

Raw Audit Messages 
type=AVC msg=audit(1463449549.453:49931): avc: denied { read } for pid=9274 comm="clamscan" name="sess_604rv54bntl70jig0bjf1lfja4" dev="dm-1" ino=67123073 scontext=system_u:system_r:antivirus_t:s0-s0:c0.c1023 tcontext=system_u:object_r:httpd_sys_rw_content_t:s0 tclass=file 


type=SYSCALL msg=audit(1463449549.453:49931): arch=x86_64 syscall=open success=no exit=EACCES a0=7f16e0aee540 a1=0 a2=0 a3=fffffffffffffb85 items=0 ppid=9135 pid=9274 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=5454 comm=clamscan exe=/usr/bin/clamscan subj=system_u:system_r:antivirus_t:s0-s0:c0.c1023 key=(null) 

Hash: clamscan,antivirus_t,httpd_sys_rw_content_t,file,read 

et ici la politique:

module clamscanlocal 1.0; 

require { 
type antivirus_t; 
type httpd_sys_rw_content_t; 
type usr_t; 
class dir search; 
class file { write read getattr append }; 
} 

#============= antivirus_t ============== 

#!!!! This avc can be allowed using the boolean 'antivirus_can_scan_system' 
allow antivirus_t httpd_sys_rw_content_t:dir search; 

#!!!! This avc can be allowed using the boolean 'antivirus_can_scan_system' 
allow antivirus_t httpd_sys_rw_content_t:file getattr; 
allow antivirus_t usr_t:file { write read append }; 

Répondre

0

pourquoi ne pas simplement activer le booléen comme indiqué par la sortie de audit2allow au lieu de créer une politique?

setsebool -P antivirus_can_scan_system=on

Bon SELinux Tutoriels: https://wiki.gentoo.org/wiki/SELinux/Tutorials

+0

je vais donner ce un essai - merci ... – heppi75