Skip to content

Instantly share code, notes, and snippets.

@beli-sk
Last active January 18, 2016 08:41
Show Gist options
  • Save beli-sk/57b5b711aa624d718c3e to your computer and use it in GitHub Desktop.
Save beli-sk/57b5b711aa624d718c3e to your computer and use it in GitHub Desktop.
Fix (workaround) for running zabbix agent/server under SELinux
# https://www.zabbix.com/forum/showthread.php?t=43550
policy_module(zabbix-fix, 1.3)
require {
type zabbix_agent_t;
type zabbix_t;
type ping_t;
type zabbix_tmp_t;
class tcp_socket name_connect;
}
allow ping_t zabbix_tmp_t:file read_file_perms;
allow ping_t zabbix_t:tcp_socket { read write };
kernel_read_network_state(zabbix_agent_t)
domain_read_all_domains_state(zabbix_agent_t)
dev_read_sysfs(zabbix_agent_t)
corenet_tcp_connect_all_ports(zabbix_agent_t)
corenet_tcp_connect_all_ports(zabbix_t)
# checkmodule -M -m -o selinux-zabbix-fix.mod selinux-zabbix-fix.te
# semodule_package -o selinux-zabbix-fix.pp -m selinux-zabbix-fix.mod
make -f /usr/share/selinux/devel/Makefile selinux-zabbix-fix.pp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment