From: sven.vermeulen@siphos.be (Sven Vermeulen)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] [PATCH 5/7] Zabbix agent binds on its own port, connects to zabbix server
Date: Mon, 13 Jun 2011 10:34:12 +0200 [thread overview]
Message-ID: <20110613083412.GF18072@siphos.be> (raw)
In-Reply-To: <20110613083136.GE18072@siphos.be>
The zabbix agent has its own dedicated port (10050) on which it needs to
bind/listen.
Also, the agent connects to the server so we add the zabbix_tcp_connect
interface (shamelessly copied from mysql_tcp_connect) and use it for the
zabbix_agent_t domain.
Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
---
policy/modules/kernel/corenetwork.te.in | 1 +
policy/modules/services/zabbix.if | 21 +++++++++++++++++++++
policy/modules/services/zabbix.te | 6 ++++++
3 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/policy/modules/kernel/corenetwork.te.in b/policy/modules/kernel/corenetwork.te.in
index f4937b9..fb5dd13 100644
--- a/policy/modules/kernel/corenetwork.te.in
+++ b/policy/modules/kernel/corenetwork.te.in
@@ -224,6 +224,7 @@ network_port(xfs, tcp,7100,s0)
network_port(xserver, tcp,6000-6020,s0)
network_port(zarafa, tcp,236,s0, tcp,237,s0)
network_port(zabbix, tcp,10051,s0)
+network_port(zabbix_agent, tcp,10050,s0)
network_port(zookeeper_client, tcp,2181,s0)
network_port(zookeeper_election, tcp,3888,s0)
network_port(zookeeper_leader, tcp,2888,s0)
diff --git a/policy/modules/services/zabbix.if b/policy/modules/services/zabbix.if
index d77e631..7e37c21 100644
--- a/policy/modules/services/zabbix.if
+++ b/policy/modules/services/zabbix.if
@@ -79,6 +79,27 @@ interface(`zabbix_read_pid_files',`
########################################
## <summary>
+## Allow connectivity to the zabbix server
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`zabbix_tcp_connect',`
+ gen_require(`
+ type zabbix_t;
+ ')
+
+ corenet_tcp_recvfrom_labeled($1, zabbix_t)
+ corenet_tcp_sendrecv_zabbix_port($1)
+ corenet_tcp_connect_zabbix_port($1)
+ corenet_sendrecv_zabbix_agent_packets($1)
+')
+
+########################################
+## <summary>
## All of the rules required to administrate
## an zabbix environment
## </summary>
diff --git a/policy/modules/services/zabbix.te b/policy/modules/services/zabbix.te
index 83bb522..a5fc923 100644
--- a/policy/modules/services/zabbix.te
+++ b/policy/modules/services/zabbix.te
@@ -93,10 +93,16 @@ manage_files_pattern(zabbix_agent_t, zabbix_log_t, zabbix_log_t)
# PID file management
manage_files_pattern(zabbix_agent_t, zabbix_var_run_t, zabbix_var_run_t)
files_pid_filetrans(zabbix_agent_t, zabbix_var_run_t, file)
+# Port access
+zabbix_tcp_connect(zabbix_agent_t)
# Shared memory
rw_files_pattern(zabbix_agent_t, zabbix_tmpfs_t, zabbix_tmpfs_t)
fs_tmpfs_filetrans(zabbix_agent_t, zabbix_tmpfs_t, { dir file })
## kernel layer module calls
+corenet_tcp_bind_generic_node(zabbix_agent_t)
+corenet_tcp_bind_zabbix_agent_port(zabbix_agent_t)
+corenet_tcp_connect_zabbix_port(zabbix_agent_t)
## system layer module calls
+sysnet_dns_name_resolve(zabbix_agent_t)
--
1.7.3.4
next prev parent reply other threads:[~2011-06-13 8:34 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-13 8:20 [refpolicy] [PATCH 0/7] Updates on zabbix service Sven Vermeulen
2011-06-13 8:25 ` [refpolicy] [PATCH 1/7] zabbix server spawns multiple processes Sven Vermeulen
2011-06-13 8:28 ` [refpolicy] [PATCH 2/7] Support shared memory Sven Vermeulen
2011-06-13 8:29 ` [refpolicy] [PATCH 3/7] Define zabbix port and allow server to listen/bind on it Sven Vermeulen
2011-06-13 8:31 ` [refpolicy] [PATCH 4/7] Support different domain for zabbix agent (start with skeleton) Sven Vermeulen
2011-06-13 8:34 ` Sven Vermeulen [this message]
2011-06-13 8:35 ` [refpolicy] [PATCH 6/7] Allow zabbix server to connect to agent (active monitoring) Sven Vermeulen
2011-06-13 8:40 ` [refpolicy] [PATCH 7/7] Allow zabbix agent to query system state and other monitorable aspects Sven Vermeulen
2011-06-15 13:26 ` Christopher J. PeBenito
2011-06-15 16:59 ` Sven Vermeulen
2011-06-13 10:14 ` [refpolicy] [PATCH 6/7] Allow zabbix server to connect to agent (active monitoring) Sven Vermeulen
2011-06-15 16:58 ` Sven Vermeulen
2011-06-13 10:13 ` [refpolicy] [PATCH 5/7] Zabbix agent binds on its own port, connects to zabbix server Sven Vermeulen
2011-06-15 16:57 ` Sven Vermeulen
[not found] ` <20110613101151.GB26655@siphos.be>
2011-06-13 10:22 ` [refpolicy] [PATCH 4/7] Support different domain for zabbix agent (start with skeleton) Sven Vermeulen
2011-06-15 16:56 ` Sven Vermeulen
2011-06-13 10:10 ` [refpolicy] [PATCH 2/7] Support shared memory Sven Vermeulen
2011-06-15 18:20 ` [refpolicy] [PATCH 0/7] Updates on zabbix service Christopher J. PeBenito
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110613083412.GF18072@siphos.be \
--to=sven.vermeulen@siphos.be \
--cc=refpolicy@oss.tresys.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.