I'm writing a Puppet module to install Zabbix onto a Puppet agent. Everything is working as intended, but SELinux isn't playing nicely with Zabbix. I'm getting the following error from SELinux in the audit log:
type=AVC msg=audit(% audit_id): avc: denied { connect } for pid=2383 comm="zabbix_agentd" scontext=system_u:system_r:zabbix_agent_t:s0 tcontext=system_u:system_r:zabbix_agent_t:s0 tclass=unix_dgram_socket permissive=0
I changed my Puppet class to look like this using this website as reference:
class { 'zabbix::agent':
server => '<server_ip>',
tlsaccept => 'psk',
tlsconnect => 'psk',
tlspskfile => $pskfilepath,
tlspskidentity => $pskidentity,
manage_selinux => true,
selinux_require => [
'type kernel_t',
'type devlog_t',
'type zabbix_agent_t',
'class sock_file write',
'class process setrlimit',
'class unix_dgram_socket {connect create sendto}',
],
selinux_rules => { 'zabbix_agent_t' => [
'allow zabbix_agent_t kernel_t:unix_dgram_socket sendto',
'allow zabbix_agent_t self:process setrlimit',
'allow zabbix_agent_t self:unix_dgram_socket { connect create }',
]
}
Now, I'm getting this instead:
type=AVC msg=audit($audit_id): avc: denied { write } for pid=4293 comm="zabbix_agentd" name="log" dev="devtmpfs" ino=8160 scontext=system_u:system_r:zabbix_agent_t:s0 tcontext=system_u:object_r:devlog_t:s0 tclass=sock_file permissive=0
It changed from { connect }
to { write }
, can anyone please tell me why SELinux isn't working well with Zabbix?