All of lore.kernel.org
 help / color / mirror / Atom feed
From: sven.vermeulen@siphos.be (Sven Vermeulen)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] [PATCH 4/7] Support different domain for zabbix agent (start with skeleton)
Date: Wed, 15 Jun 2011 18:56:35 +0200	[thread overview]
Message-ID: <20110615165634.GA17584@siphos.be> (raw)
In-Reply-To: <20110613083136.GE18072@siphos.be>

The zabbix agent should be confined within its own domain. We start with the
definition of a small(er) skeleton to work from. This includes proper file
context definitions, standard interdomain privileges (which are quite
similar to those of the server) and the proper log- and pid access
privileges.

Update: attempt to follow styleguide more closely

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
---
 policy/modules/services/zabbix.fc |    4 ++-
 policy/modules/services/zabbix.te |   39 +++++++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 1 deletions(-)

diff --git a/policy/modules/services/zabbix.fc b/policy/modules/services/zabbix.fc
index 3102286..fb88f70 100644
--- a/policy/modules/services/zabbix.fc
+++ b/policy/modules/services/zabbix.fc
@@ -1,6 +1,8 @@
 /etc/rc\.d/init\.d/zabbix --	gen_context(system_u:object_r:zabbix_initrc_exec_t,s0)
+/etc/rc\.d/init\.d/zabbix-agentd	--	gen_context(system_u:object_r:zabbix_agent_initrc_exec_t,s0)
 
-/usr/bin/zabbix_server	--	gen_context(system_u:object_r:zabbix_exec_t,s0)
+/usr/(s)?bin/zabbix_server	--	gen_context(system_u:object_r:zabbix_exec_t,s0)
+/usr/(s)?bin/zabbix_agentd	--	gen_context(system_u:object_r:zabbix_agent_t,s0)
 
 /var/log/zabbix(/.*)?		gen_context(system_u:object_r:zabbix_log_t,s0)
 
diff --git a/policy/modules/services/zabbix.te b/policy/modules/services/zabbix.te
index 163f581..457aa2f 100644
--- a/policy/modules/services/zabbix.te
+++ b/policy/modules/services/zabbix.te
@@ -12,6 +12,14 @@ init_daemon_domain(zabbix_t, zabbix_exec_t)
 type zabbix_initrc_exec_t;
 init_script_file(zabbix_initrc_exec_t)
 
+# agent definition
+type zabbix_agent_t;
+type zabbix_agent_exec_t;
+init_daemon_domain(zabbix_agent_t, zabbix_agent_exec_t)
+
+type zabbix_agent_initrc_exec_t;
+init_script_file(zabbix_agent_initrc_exec_t)
+
 # log files
 type zabbix_log_t;
 logging_log_file(zabbix_log_t)
@@ -65,3 +73,34 @@ optional_policy(`
 optional_policy(`
 	postgresql_stream_connect(zabbix_t)
 ')
+
+########################################
+#
+# zabbix agent local policy
+#
+
+allow zabbix_agent_t self:capability { setuid setgid };
+allow zabbix_agent_t self:process { setsched getsched signal };
+allow zabbix_agent_t self:fifo_file rw_file_perms;
+allow zabbix_agent_t self:sem create_sem_perms;
+allow zabbix_agent_t self:shm create_shm_perms;
+allow zabbix_agent_t self:tcp_socket create_stream_socket_perms;
+allow zabbix_agent_t self:unix_stream_socket create_stream_socket_perms;
+
+## Rules related to the types managed by this policy file
+
+# Logging access
+filetrans_pattern(zabbix_agent_t, zabbix_log_t, zabbix_log_t, file)
+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)
+
+# Shared Memory support
+rw_files_pattern(zabbix_agent_t, zabbix_tmpfs_t, zabbix_tmpfs_t)
+fs_tmpfs_filetrans(zabbix_agent_t, zabbix_tmpfs_t, file)
+
+## Kernel layer module calls
+
+## System layer module calls
-- 
1.7.3.4

  parent reply	other threads:[~2011-06-15 16:56 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         ` [refpolicy] [PATCH 5/7] Zabbix agent binds on its own port, connects to zabbix server Sven Vermeulen
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 [this message]
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=20110615165634.GA17584@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.