From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E4066139694 for ; Thu, 25 May 2017 17:09:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DE3B321C233; Thu, 25 May 2017 17:09:03 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9098521C232 for ; Thu, 25 May 2017 17:08:48 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0C9B63416C2 for ; Thu, 25 May 2017 17:08:37 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A1E41746F for ; Thu, 25 May 2017 17:08:34 +0000 (UTC) From: "Jason Zaman" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Jason Zaman" Message-ID: <1495731839.91bc9686ff5065f7cdcce4ec14ac9d6dd89b769d.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:next commit in: policy/modules/contrib/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/contrib/dirmngr.fc policy/modules/contrib/dirmngr.te policy/modules/contrib/gpg.if X-VCS-Directories: policy/modules/contrib/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 91bc9686ff5065f7cdcce4ec14ac9d6dd89b769d X-VCS-Branch: next Date: Thu, 25 May 2017 17:08:34 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 88c075bc-bf37-4c69-aedc-c942f714ccce X-Archives-Hash: 309970b7779a3c16ea936f36d2f8a99c commit: 91bc9686ff5065f7cdcce4ec14ac9d6dd89b769d Author: Jason Zaman perfinion com> AuthorDate: Sun May 7 13:42:53 2017 +0000 Commit: Jason Zaman gentoo org> CommitDate: Thu May 25 17:03:59 2017 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=91bc9686 dirmngr: fcontext for ~/.gnupg/crls.d/ policy/modules/contrib/dirmngr.fc | 2 ++ policy/modules/contrib/dirmngr.te | 7 +++++++ policy/modules/contrib/gpg.if | 20 ++++++++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/policy/modules/contrib/dirmngr.fc b/policy/modules/contrib/dirmngr.fc index a9cf15a8..60f19f47 100644 --- a/policy/modules/contrib/dirmngr.fc +++ b/policy/modules/contrib/dirmngr.fc @@ -1,3 +1,5 @@ +HOME_DIR/\.gnupg/crls\.d(/.+)? gen_context(system_u:object_r:dirmngr_home_t,s0) + /etc/dirmngr(/.*)? gen_context(system_u:object_r:dirmngr_conf_t,s0) /etc/rc\.d/init\.d/dirmngr -- gen_context(system_u:object_r:dirmngr_initrc_exec_t,s0) diff --git a/policy/modules/contrib/dirmngr.te b/policy/modules/contrib/dirmngr.te index 8e4a1a89..17cce56a 100644 --- a/policy/modules/contrib/dirmngr.te +++ b/policy/modules/contrib/dirmngr.te @@ -27,6 +27,9 @@ files_type(dirmngr_var_lib_t) type dirmngr_var_run_t; files_pid_file(dirmngr_var_run_t) +type dirmngr_home_t; +userdom_user_home_content(dirmngr_home_t) + ######################################## # # Local policy @@ -37,6 +40,8 @@ allow dirmngr_t self:fifo_file rw_file_perms; allow dirmngr_t dirmngr_conf_t:dir list_dir_perms; allow dirmngr_t dirmngr_conf_t:file read_file_perms; allow dirmngr_t dirmngr_conf_t:lnk_file read_lnk_file_perms; +allow dirmngr_t dirmngr_home_t:dir list_dir_perms; +allow dirmngr_t dirmngr_home_t:file read_file_perms; manage_dirs_pattern(dirmngr_t, dirmngr_log_t, dirmngr_log_t) append_files_pattern(dirmngr_t, dirmngr_log_t, dirmngr_log_t) @@ -61,6 +66,7 @@ kernel_read_crypto_sysctls(dirmngr_t) files_read_etc_files(dirmngr_t) miscfiles_read_localization(dirmngr_t) +miscfiles_read_generic_certs(dirmngr_t) userdom_search_user_home_dirs(dirmngr_t) userdom_search_user_runtime(dirmngr_t) @@ -68,4 +74,5 @@ userdom_user_runtime_filetrans(dirmngr_t, dirmngr_tmp_t, dir) optional_policy(` gpg_agent_tmp_filetrans(dirmngr_t, dirmngr_tmp_t, sock_file) + gpg_secret_filetrans(dirmngr_t, dirmngr_home_t, dir) ') diff --git a/policy/modules/contrib/gpg.if b/policy/modules/contrib/gpg.if index 4480f9c6..e5a12750 100644 --- a/policy/modules/contrib/gpg.if +++ b/policy/modules/contrib/gpg.if @@ -254,6 +254,26 @@ interface(`gpg_agent_tmp_filetrans',` ######################################## ## +## filetrans in gpg_secret_t dirs +## +## +## +## Domain allowed access. +## +## +# +interface(`gpg_secret_filetrans',` + gen_require(` + type gpg_secret_t; + ') + + filetrans_pattern($1, gpg_secret_t, $2, $3, $4) + allow $1 gpg_secret_t:dir search_dir_perms; + userdom_search_user_home_dirs($1) +') + +######################################## +## ## Send messages to and from gpg ## pinentry over DBUS. ##