Description of problem: Running munin and munin-node at localhost in Fedora 18 with selinux enabled. SELinux is preventing /usr/bin/perl from 'search' accesses on the directory /var/log/munin. ***** Plugin catchall (100. confidence) suggests *************************** If aby perl powinno mieć domyślnie search dostęp do munin directory. Then proszę to zgłosić jako błąd. Można utworzyć lokalny moduł polityki, aby umożliwić ten dostęp. Do można tymczasowo zezwolić na ten dostęp wykonując polecenia: # grep munin-cgi-graph /var/log/audit/audit.log | audit2allow -M mojapolityka # semodule -i mojapolityka.pp Additional Information: Source Context system_u:system_r:httpd_munin_script_t:s0 Target Context system_u:object_r:munin_log_t:s0 Target Objects /var/log/munin [ dir ] Source munin-cgi-graph Source Path /usr/bin/perl Port <Unknown> Host (removed) Source RPM Packages perl-5.16.2-238.fc18.x86_64 Target RPM Packages munin-2.0.11.1-1.fc18.noarch Policy RPM selinux-policy-3.11.1-79.fc18.noarch Selinux Enabled True Policy Type targeted Enforcing Mode Enforcing Host Name (removed) Platform Linux (removed) 3.7.9-201.fc18.x86_64 #1 SMP Mon Feb 18 21:07:56 UTC 2013 x86_64 x86_64 Alert Count 1 First Seen 2013-02-23 03:22:51 CET Last Seen 2013-02-23 03:22:51 CET Local ID 7bf7a3f0-0ada-417c-a1a6-3dc9e070e7e5 Raw Audit Messages type=AVC msg=audit(1361586171.95:743): avc: denied { search } for pid=17520 comm="munin-cgi-graph" name="munin" dev="md2" ino=5243153 scontext=system_u:system_r:httpd_munin_script_t:s0 tcontext=system_u:object_r:munin_log_t:s0 tclass=dir type=SYSCALL msg=audit(1361586171.95:743): arch=x86_64 syscall=open success=no exit=EACCES a0=1a918b0 a1=441 a2=1b6 a3=0 items=0 ppid=17390 pid=17520 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 ses=4294967295 tty=(none) comm=munin-cgi-graph exe=/usr/bin/perl subj=system_u:system_r:httpd_munin_script_t:s0 key=(null) Hash: munin-cgi-graph,httpd_munin_script_t,munin_log_t,dir,search audit2allow #============= httpd_munin_script_t ============== #!!!! This avc is allowed in the current policy allow httpd_munin_script_t munin_log_t:dir search; audit2allow -R #============= httpd_munin_script_t ============== #!!!! This avc is allowed in the current policy allow httpd_munin_script_t munin_log_t:dir search; Additional info: hashmarkername: setroubleshoot kernel: 3.7.9-201.fc18.x86_64 type: libreport
Does it need to read log files? Could you re-test it with # semanage permissive -a httpd_munin_script_t re-test and # ausearch -m avc -ts recent # semanage permissive -d httpd_munin_script_t
I had attached a log file with results of the command: ausearch -m avc -ts recent. try1.log
Created attachment 703175 [details] ausearch -m avc -ts recent
Created attachment 703178 [details] semanage permissive -d httpd_munin_script_t And log after: semanage permissive -d httpd_munin_script_t
By now i can't see zooming images in munin, a have this: Could not draw graph "/var/tmp/munin-cgi-graph/localhost/localhost/users-pinpoint=1358734810,1361586010.png?&lower_limit=&upper_limit=&size_x=800&size_y=400" and apache error_log: [Wed Feb 27 00:12:16.092158 2013] [cgi:error] [pid 1930] [client 127.0.0.1:34013] AH01215: (process:13354): GLib-WARNING **: getpwuid_r(): failed due to: Permission denied., referer: http://127.0.0.1/munin/static/dynazoom.html?cgiurl_graph=/munin-cgi/munin-cgi-graph&plugin_name=localhost/localhost/users&size_x=800&size_y=400&start_epoch=1358734810&stop_epoch=1361586010 So selinux is stopping my system from drawing graph like this above.
I backported fixes from rawhide. commit f6f7205015e2f4a3b8ebca4b1dbbfd538966183f Author: Miroslav Grepl <mgrepl> Date: Thu Feb 28 13:30:52 2013 +0100 Backport munin policy from rawhide
selinux-policy-3.11.1-82.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-82.fc18
Package selinux-policy-3.11.1-82.fc18: * should fix your issue, * was pushed to the Fedora 18 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing selinux-policy-3.11.1-82.fc18' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-3309/selinux-policy-3.11.1-82.fc18 then log in and leave karma (feedback).
SELinux is preventing /usr/bin/perl from using the execmem access on a process. ***** Plugin catchall (100. confidence) suggests *************************** If jeśli perl powinno mieć domyślnie execmem dostęp do procesów z etykietami munin_t. Then proszę to zgłosić jako błąd. Można utworzyć lokalny moduł polityki, aby umożliwić ten dostęp. Do można tymczasowo zezwolić na ten dostęp wykonując polecenia: # grep munin-update /var/log/audit/audit.log | audit2allow -M mojapolityka # semodule -i mojapolityka.pp Additional Information: Source Context system_u:system_r:munin_t:s0-s0:c0.c1023 Target Context system_u:system_r:munin_t:s0-s0:c0.c1023 Target Objects [ process ] Source munin-update Source Path /usr/bin/perl Port <Unknown> Host localhost.localdomain Source RPM Packages perl-5.16.2-238.fc18.x86_64 Target RPM Packages Policy RPM selinux-policy-3.11.1-82.fc18.noarch Selinux Enabled True Policy Type targeted Enforcing Mode Enforcing Host Name localhost.localdomain Platform Linux localhost.localdomain 3.7.9-205.fc18.x86_64 #1 SMP Sun Feb 24 20:10:02 UTC 2013 x86_64 x86_64 Alert Count 410 First Seen 2013-02-27 13:45:03 CET Last Seen 2013-03-02 22:20:01 CET Local ID bcf91fc5-daaf-49de-9add-5437bc0afd9b Raw Audit Messages type=AVC msg=audit(1362259201.853:992): avc: denied { execmem } for pid=15927 comm="munin-update" scontext=system_u:system_r:munin_t:s0-s0:c0.c1023 tcontext=system_u:system_r:munin_t:s0-s0:c0.c1023 tclass=process type=SYSCALL msg=audit(1362259201.853:992): arch=x86_64 syscall=mmap success=no exit=EACCES a0=321c8ca000 a1=3d000 a2=7 a3=812 items=0 ppid=15926 pid=15927 auid=990 uid=990 gid=987 euid=990 suid=990 fsuid=990 egid=987 sgid=987 fsgid=987 ses=115 tty=(none) comm=munin-update exe=/usr/bin/perl subj=system_u:system_r:munin_t:s0-s0:c0.c1023 key=(null) Hash: munin-update,munin_t,munin_t,process,execmem audit2allow #============= munin_t ============== allow munin_t self:process execmem; audit2allow -R #============= munin_t ============== allow munin_t self:process execmem;
Look at bz: 913294 - selinux-policy-3.11.1-82.fc18.noarch still has some issue with munin.
selinux-policy-3.11.1-82.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.