LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 10-13-2016, 02:03 AM   #1
TripelM
LQ Newbie
 
Registered: Oct 2016
Posts: 6

Rep: Reputation: Disabled
SELinux: unable to send audit message


Hello,

i try to use a script for zabbix.

In the first try i get this message when i try to use the script:

sh: /usr/bin/sudo: no permission

I made new selinux policys with audit2allow -a and then semodule -i.
Here are the new policys that i added:
Quote:
module zabbix_sudo 1.0;

require {
type tmp_t;
type kernel_t;
type mysqld_var_run_t;
type devlog_t;
type mysqld_etc_t;
type cluster_tmpfs_t;
type sudo_exec_t;
type zabbix_agent_t;
class capability { sys_resource audit_write dac_override };
class file { write execute read create unlink open execute_no_trans };
class netlink_audit_socket { nlmsg_relay create };
class sock_file write;
class unix_dgram_socket { create connect sendto };
class dir { write remove_name add_name };
}

#============= zabbix_agent_t ==============
allow zabbix_agent_t cluster_tmpfs_t:file { read write open };
allow zabbix_agent_t devlog_t:sock_file write;
allow zabbix_agent_t kernel_t:unix_dgram_socket sendto;
allow zabbix_agent_t mysqld_etc_t:file read;
allow zabbix_agent_t mysqld_var_run_t:sock_file write;
allow zabbix_agent_t self:capability { sys_resource audit_write dac_override };
allow zabbix_agent_t self:netlink_audit_socket { nlmsg_relay create };
allow zabbix_agent_t self:unix_dgram_socket { create connect };
allow zabbix_agent_t sudo_exec_t:file { execute execute_no_trans };
allow zabbix_agent_t tmp_t:dir { write remove_name add_name };
allow zabbix_agent_t tmp_t:file { write create unlink open };
After this when i try to execute the script i get this message:

sudo: unable to send audit message: Permission denied

If i set zabix_agent_t permissive everything works fine.

Here some additional informations:
- user zabbix is in sudoers group
- i get the same messages if i try it as normal root user
- semodule zabbix is enabled

Thank you in advance for your help.
(Please excuse my bad english)

Last edited by TripelM; 10-13-2016 at 02:05 AM.
 
Old 10-13-2016, 09:46 AM   #2
TripelM
LQ Newbie
 
Registered: Oct 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Problem solved.

After a semodule -DB the error appeard in the audit.log.
I created an extra policy and de audit error was gone.
 
Old 10-13-2016, 05:18 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Thanks for posting your fix.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sendmail unable to send message to external servers (e.g. hotmail,gmail etc) mali2 Linux - Networking 2 07-01-2011 12:41 PM
shutdown: Unable to send message: Connection refused Dims Linux - Newbie 2 06-19-2009 02:04 AM
SELinux: dbus: Can't send to audit system xpucto Linux - Newbie 1 07-05-2007 04:38 PM
app causing selinux audit message dansawyer Linux - Security 1 01-21-2007 11:44 AM
hylafax - unable to send fax - modem not ready message vikram_cvk Linux - Software 0 10-11-2006 09:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration