public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Jason Zaman" <perfinion@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/hardened-refpolicy:next commit in: policy/modules/roles/, policy/modules/system/
Date: Sun,  2 Aug 2015 19:06:33 +0000 (UTC)	[thread overview]
Message-ID: <1438274487.41f2cdfadbb7cb1fd016839b923846a9946f3cab.perfinion@gentoo> (raw)

commit:     41f2cdfadbb7cb1fd016839b923846a9946f3cab
Author:     Jason Zaman <jason <AT> perfinion <DOT> com>
AuthorDate: Sat Jul 11 09:15:45 2015 +0000
Commit:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
CommitDate: Thu Jul 30 16:41:27 2015 +0000
URL:        https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=41f2cdfa

Introduce ipsec_admin interface

 policy/modules/roles/sysadm.te |  8 +------
 policy/modules/system/ipsec.if | 51 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 7 deletions(-)

diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te
index 1ee88cd..5901b2f 100644
--- a/policy/modules/roles/sysadm.te
+++ b/policy/modules/roles/sysadm.te
@@ -473,13 +473,7 @@ optional_policy(`
 ')
 
 optional_policy(`
-	# allow system administrator to use the ipsec script to look
-	# at things (e.g., ipsec auto --status)
-	# probably should create an ipsec_admin role for this kind of thing
-	ipsec_exec_mgmt(sysadm_t)
-	ipsec_stream_connect(sysadm_t)
-	# for lsof
-	ipsec_getattr_key_sockets(sysadm_t)
+	ipsec_admin(sysadm_t, sysadm_r)
 ')
 
 optional_policy(`

diff --git a/policy/modules/system/ipsec.if b/policy/modules/system/ipsec.if
index 0d4c8d3..3d64054 100644
--- a/policy/modules/system/ipsec.if
+++ b/policy/modules/system/ipsec.if
@@ -369,3 +369,54 @@ interface(`ipsec_run_setkey',`
 	ipsec_domtrans_setkey($1)
 	role $2 types setkey_t;
 ')
+
+########################################
+## <summary>
+##	All of the rules required to
+##	administrate an ipsec environment.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <param name="role">
+##	<summary>
+##	Role allowed access.
+##	</summary>
+## </param>
+## <rolecap/>
+#
+interface(`ipsec_admin',`
+	gen_require(`
+		type ipsec_t, ipsec_initrc_exec_t, ipsec_conf_file_t;
+		type ipsec_key_file_t, ipsec_log_t, ipsec_tmp_t;
+		type ipsec_var_run_t, ipsec_mgmt_lock_t;
+		type ipsec_mgmt_var_run_t, racoon_tmp_t;
+	')
+
+	allow $1 ipsec_t:process { ptrace signal_perms };
+	ps_process_pattern($1, ipsec_t)
+
+	init_startstop_service($1, $2, ipsec_t, ipsec_initrc_exec_t)
+
+	ipsec_exec_mgmt($1)
+	ipsec_stream_connect($1)
+	# for lsof
+	ipsec_getattr_key_sockets($1)
+
+	files_search_etc($1)
+	admin_pattern($1, { ipsec_conf_file_t ipsec_key_file_t })
+
+	files_search_tmp($1)
+	admin_pattern($1, { ipsec_tmp_t racoon_tmp_t })
+
+	files_search_pids($1)
+	admin_pattern($1, { ipsec_var_run_t ipsec_mgmt_var_run_t })
+
+	files_search_locks($1)
+	admin_pattern($1, ipsec_mgmt_lock_t)
+
+	logging_search_logs($1)
+	admin_pattern($1, ipsec_log_t)
+')


WARNING: multiple messages have this Message-ID (diff)
From: "Jason Zaman" <perfinion@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/roles/, policy/modules/system/
Date: Fri, 31 Jul 2015 14:15:38 +0000 (UTC)	[thread overview]
Message-ID: <1438274487.41f2cdfadbb7cb1fd016839b923846a9946f3cab.perfinion@gentoo> (raw)
Message-ID: <20150731141538.zc1yQqhrmQwRI24Te99Dee4bZCJOUlQ4p8lQMiYFpfg@z> (raw)

commit:     41f2cdfadbb7cb1fd016839b923846a9946f3cab
Author:     Jason Zaman <jason <AT> perfinion <DOT> com>
AuthorDate: Sat Jul 11 09:15:45 2015 +0000
Commit:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
CommitDate: Thu Jul 30 16:41:27 2015 +0000
URL:        https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=41f2cdfa

Introduce ipsec_admin interface

 policy/modules/roles/sysadm.te |  8 +------
 policy/modules/system/ipsec.if | 51 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 7 deletions(-)

diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te
index 1ee88cd..5901b2f 100644
--- a/policy/modules/roles/sysadm.te
+++ b/policy/modules/roles/sysadm.te
@@ -473,13 +473,7 @@ optional_policy(`
 ')
 
 optional_policy(`
-	# allow system administrator to use the ipsec script to look
-	# at things (e.g., ipsec auto --status)
-	# probably should create an ipsec_admin role for this kind of thing
-	ipsec_exec_mgmt(sysadm_t)
-	ipsec_stream_connect(sysadm_t)
-	# for lsof
-	ipsec_getattr_key_sockets(sysadm_t)
+	ipsec_admin(sysadm_t, sysadm_r)
 ')
 
 optional_policy(`

diff --git a/policy/modules/system/ipsec.if b/policy/modules/system/ipsec.if
index 0d4c8d3..3d64054 100644
--- a/policy/modules/system/ipsec.if
+++ b/policy/modules/system/ipsec.if
@@ -369,3 +369,54 @@ interface(`ipsec_run_setkey',`
 	ipsec_domtrans_setkey($1)
 	role $2 types setkey_t;
 ')
+
+########################################
+## <summary>
+##	All of the rules required to
+##	administrate an ipsec environment.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <param name="role">
+##	<summary>
+##	Role allowed access.
+##	</summary>
+## </param>
+## <rolecap/>
+#
+interface(`ipsec_admin',`
+	gen_require(`
+		type ipsec_t, ipsec_initrc_exec_t, ipsec_conf_file_t;
+		type ipsec_key_file_t, ipsec_log_t, ipsec_tmp_t;
+		type ipsec_var_run_t, ipsec_mgmt_lock_t;
+		type ipsec_mgmt_var_run_t, racoon_tmp_t;
+	')
+
+	allow $1 ipsec_t:process { ptrace signal_perms };
+	ps_process_pattern($1, ipsec_t)
+
+	init_startstop_service($1, $2, ipsec_t, ipsec_initrc_exec_t)
+
+	ipsec_exec_mgmt($1)
+	ipsec_stream_connect($1)
+	# for lsof
+	ipsec_getattr_key_sockets($1)
+
+	files_search_etc($1)
+	admin_pattern($1, { ipsec_conf_file_t ipsec_key_file_t })
+
+	files_search_tmp($1)
+	admin_pattern($1, { ipsec_tmp_t racoon_tmp_t })
+
+	files_search_pids($1)
+	admin_pattern($1, { ipsec_var_run_t ipsec_mgmt_var_run_t })
+
+	files_search_locks($1)
+	admin_pattern($1, ipsec_mgmt_lock_t)
+
+	logging_search_logs($1)
+	admin_pattern($1, ipsec_log_t)
+')


             reply	other threads:[~2015-08-02 19:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-02 19:06 Jason Zaman [this message]
2015-07-31 14:15 ` [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/roles/, policy/modules/system/ Jason Zaman
  -- strict thread matches above, loose matches on Subject: below --
2015-07-31 14:15 Jason Zaman
2015-08-02 19:06 ` [gentoo-commits] proj/hardened-refpolicy:next " Jason Zaman

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=1438274487.41f2cdfadbb7cb1fd016839b923846a9946f3cab.perfinion@gentoo \
    --to=perfinion@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox