All of lore.kernel.org
 help / color / mirror / Atom feed
* [refpolicy] [PATCH v2 1/2] Introduce iptables_admin
@ 2015-06-08 20:38 Jason Zaman
  2015-06-08 20:38 ` [refpolicy] [PATCH v2 2/2] Add all the missing _admin interfaces to sysadm Jason Zaman
  2015-06-09 12:40 ` [refpolicy] [PATCH v2 1/2] Introduce iptables_admin Christopher J. PeBenito
  0 siblings, 2 replies; 4+ messages in thread
From: Jason Zaman @ 2015-06-08 20:38 UTC (permalink / raw)
  To: refpolicy

---
 policy/modules/roles/sysadm.te    |  1 +
 policy/modules/system/iptables.if | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te
index 8219dea..f9919fd 100644
--- a/policy/modules/roles/sysadm.te
+++ b/policy/modules/roles/sysadm.te
@@ -178,6 +178,7 @@ optional_policy(`
 ')
 
 optional_policy(`
+	iptables_admin(sysadm_t, sysadm_r)
 	iptables_run(sysadm_t, sysadm_r)
 ')
 
diff --git a/policy/modules/system/iptables.if b/policy/modules/system/iptables.if
index c42fbc3..26ce647 100644
--- a/policy/modules/system/iptables.if
+++ b/policy/modules/system/iptables.if
@@ -163,3 +163,42 @@ interface(`iptables_manage_config',`
 	files_search_etc($1)
 	manage_files_pattern($1, iptables_conf_t, iptables_conf_t)
 ')
+
+########################################
+## <summary>
+##	All of the rules required to
+##	administrate an iptables
+##	environment.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <param name="role">
+##	<summary>
+##	Role allowed access.
+##	</summary>
+## </param>
+## <rolecap/>
+#
+interface(`iptables_admin',`
+	gen_require(`
+		type iptables_t, iptables_initrc_exec_t, iptables_conf_t;
+		type iptables_tmp_t, iptables_var_run_t;
+	')
+
+	allow $1 iptables_t:process { ptrace signal_perms };
+	ps_process_pattern($1, iptables_t)
+
+	init_startstop_service($1, $2, iptables_t, iptables_initrc_exec_t)
+
+	files_list_etc($1)
+	admin_pattern($1, iptables_conf_t)
+
+	files_list_tmp($1)
+	admin_pattern($1, iptables_tmp_t)
+
+	files_list_pids($1)
+	admin_pattern($1, iptables_var_run_t)
+')
-- 
2.3.6

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-09 12:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-08 20:38 [refpolicy] [PATCH v2 1/2] Introduce iptables_admin Jason Zaman
2015-06-08 20:38 ` [refpolicy] [PATCH v2 2/2] Add all the missing _admin interfaces to sysadm Jason Zaman
2015-06-09 12:40   ` Christopher J. PeBenito
2015-06-09 12:40 ` [refpolicy] [PATCH v2 1/2] Introduce iptables_admin Christopher J. PeBenito

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.