sudo:PAM audit_log_acct_message()失败:权限被拒绝

..任何时候我通过NRPE运行sudo ,我在/var/log/secure得到以下消息,我无法弄清楚如何解决它。

 sudo: PAM audit_log_acct_message() failed: Permission denied 

请指教。

*更新*

 [root@XXXXX ~]# ausearch -m avc -ts today | tail type=SYSCALL msg=audit(1381429383.104:128936): arch=c000003e syscall=44 success=no exit=-13 a0=8 a1=7fffd40dfac0 a2=8 a3=0 items=0 ppid=24708 pid=24711 auid=4294967295 uid=0 gid=496 euid=0 suid=0 fsuid=0 egid=496 sgid=496 fsgid=496 tty=(none) ses=4294967295 comm="sudo" exe="/usr/bin/sudo" subj=system_u:system_r:nrpe_t:s0 key=(null) type=AVC msg=audit(1381429383.104:128936): avc: denied { sendto } for pid=24711 comm="sudo" scontext=system_u:system_r:nrpe_t:s0 tcontext=system_u:system_r:nrpe_t:s0 tclass=unix_dgram_socket ---- time->Thu Oct 10 14:23:03 2013 type=SYSCALL msg=audit(1381429383.125:128937): arch=c000003e syscall=44 success=no exit=-13 a0=8 a1=7fff6a74a1f0 a2=8 a3=0 items=0 ppid=24710 pid=24712 auid=4294967295 uid=0 gid=496 euid=0 suid=0 fsuid=0 egid=496 sgid=496 fsgid=496 tty=(none) ses=4294967295 comm="sudo" exe="/usr/bin/sudo" subj=system_u:system_r:nrpe_t:s0 key=(null) type=AVC msg=audit(1381429383.125:128937): avc: denied { sendto } for pid=24712 comm="sudo" scontext=system_u:system_r:nrpe_t:s0 tcontext=system_u:system_r:nrpe_t:s0 tclass=unix_dgram_socket ---- time->Thu Oct 10 14:23:02 2013 type=SYSCALL msg=audit(1381429382.133:128935): arch=c000003e syscall=44 success=no exit=-13 a0=8 a1=7fff549492e0 a2=8 a3=0 items=0 ppid=24699 pid=24700 auid=4294967295 uid=0 gid=496 euid=0 suid=0 fsuid=0 egid=496 sgid=496 fsgid=496 tty=(none) ses=4294967295 comm="sudo" exe="/usr/bin/sudo" subj=system_u:system_r:nrpe_t:s0 key=(null) type=AVC msg=audit(1381429382.133:128935): avc: denied { sendto } for pid=24700 comm="sudo" scontext=system_u:system_r:nrpe_t:s0 tcontext=system_u:system_r:nrpe_t:s0 tclass=unix_dgram_socket [root@XXXXX ~]# 

*更新#2 *

 [root@XXXXX ~]# ausearch -m avc -ts today | audit2allow #============= nrpe_t ============== #!!!! This avc is allowed in the current policy allow nrpe_t self:capability sys_nice; #!!!! This avc is allowed in the current policy allow nrpe_t self:key write; #!!!! This avc is allowed in the current policy allow nrpe_t self:unix_dgram_socket sendto; #!!!! This avc is allowed in the current policy allow nrpe_t tmp_t:dir read; [root@XXXX ~]# 

*更新3 *

 [root@XXXXX ~]# semanage permissive -a npre_t libsepol.print_missing_requirements: permissive_npre_t's global requirements were not met: type/attribute npre_t (No such file or directory). libsemanage.semanage_link_sandbox: Link packages failed (No such file or directory). /usr/sbin/semanage: Could not commit semanage transaction [root@XXXXX ~]# 

无论如何这不会工作。 看看NRPE政策,它不允许你使用sudo。 您需要更改政策以允许。

所以修复你的错误是不太可能有所作为。

解决这个问题的最快捷的方式就是使这种types变得宽容。 请注意,您可能最终会为此types的整个SELlinux警报负载。

semanage permissive -a nrpe_t

否则,这将是一个制定很多政策来支持sudoing的问题。

如果您已经在使用RHEL 7,那么这个bug已经修复( https://bugzilla.redhat.com/show_bug.cgi?id=1201054

您可以使用以下命令启用/禁用nrpe的sudo。

 setsebool nagios_run_sudo on setsebool nagios_run_sudo off