From: sven.vermeulen@siphos.be (Sven Vermeulen)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] [PATCH 4/4] Allow gpg to search through portage configuration files
Date: Sat, 13 Aug 2011 20:25:04 +0200 [thread overview]
Message-ID: <20110813182504.GE12571@siphos.be> (raw)
In-Reply-To: <20110813182048.GA12571@siphos.be>
When working with signed snapshots, the GnuPG keystore is usually stored in
/etc/portage/gpg. Although the location itself can (and through this patch is)
labeled as gpg_secret_t, gpg does need search privileges to the parent
directories (in this case, /etc/portage as /etc is already implied through gpg
policy).
We create an interface called portage_search_conf which grants exactly these
privileges and assign it to gpg_t.
Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
---
policy/modules/admin/portage.if | 21 +++++++++++++++++++++
policy/modules/apps/gpg.fc | 2 ++
policy/modules/apps/gpg.te | 1 +
3 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/policy/modules/admin/portage.if b/policy/modules/admin/portage.if
index 86948c7..1682add 100644
--- a/policy/modules/admin/portage.if
+++ b/policy/modules/admin/portage.if
@@ -269,6 +269,27 @@ interface(`portage_read_tmp_files',`
########################################
## <summary>
+## Allow a domain search privileges through portage_conf_t
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain to allow search privileges
+## </summary>
+## </param>
+#
+interface(`portage_search_conf',`
+ gen_require(`
+ type portage_conf_t;
+ ')
+
+ allow $1 portage_conf_t:dir search_dir_perms;
+')
+
+
+
+
+########################################
+## <summary>
## Do not audit attempts to search the
## portage temporary directories.
## </summary>
diff --git a/policy/modules/apps/gpg.fc b/policy/modules/apps/gpg.fc
index e9853d4..be2423c 100644
--- a/policy/modules/apps/gpg.fc
+++ b/policy/modules/apps/gpg.fc
@@ -1,5 +1,7 @@
HOME_DIR/\.gnupg(/.+)? gen_context(system_u:object_r:gpg_secret_t,s0)
+/etc/portage/gpg(/.*)? gen_context(system_u:object_r:gpg_secret_t,s0)
+
/usr/bin/gpg(2)? -- gen_context(system_u:object_r:gpg_exec_t,s0)
/usr/bin/gpg-agent -- gen_context(system_u:object_r:gpg_agent_exec_t,s0)
/usr/bin/kgpg -- gen_context(system_u:object_r:gpg_exec_t,s0)
diff --git a/policy/modules/apps/gpg.te b/policy/modules/apps/gpg.te
index 469dc93..90826de 100644
--- a/policy/modules/apps/gpg.te
+++ b/policy/modules/apps/gpg.te
@@ -148,6 +148,7 @@ optional_policy(`
optional_policy(`
portage_read_tmp_files(gpg_t)
+ portage_search_conf(gpg_t)
')
optional_policy(`
--
1.7.3.4
prev parent reply other threads:[~2011-08-13 18:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-13 18:20 [refpolicy] [PATCH 0/4] Portage related updates Sven Vermeulen
2011-08-13 18:22 ` [refpolicy] [PATCH 1/4] Support layman through its own domain Sven Vermeulen
2011-08-16 17:59 ` Christopher J. PeBenito
2011-08-17 4:13 ` Sven Vermeulen
2011-08-17 5:38 ` Sven Vermeulen
2011-08-13 18:23 ` [refpolicy] [PATCH 2/4] Support emerge-webrsync through portage domain Sven Vermeulen
2011-08-16 17:53 ` Christopher J. PeBenito
2011-08-13 18:24 ` [refpolicy] [PATCH 3/4] Allow emerge-webrsync to copy extracted files to the tree Sven Vermeulen
2011-08-13 18:25 ` Sven Vermeulen [this message]
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=20110813182504.GE12571@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.