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 BE544138C92 for ; Mon, 24 Oct 2016 16:02:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 448A4E0AA9; Mon, 24 Oct 2016 16:02:24 +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 1F406E0AA9 for ; Mon, 24 Oct 2016 16:02:24 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1B3573413E9 for ; Mon, 24 Oct 2016 16:02:23 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8082B24A2 for ; Mon, 24 Oct 2016 16:02:21 +0000 (UTC) From: "Sven Vermeulen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sven Vermeulen" Message-ID: <1477324655.7ba6a2c036470cfa2cf1cac7665275ba48f45627.swift@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/contrib/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/contrib/logrotate.te policy/modules/contrib/webalizer.if policy/modules/contrib/webalizer.te X-VCS-Directories: policy/modules/contrib/ X-VCS-Committer: swift X-VCS-Committer-Name: Sven Vermeulen X-VCS-Revision: 7ba6a2c036470cfa2cf1cac7665275ba48f45627 X-VCS-Branch: master Date: Mon, 24 Oct 2016 16:02:21 +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: cddc399c-0841-42a5-a43d-0fee43c4f67b X-Archives-Hash: 069d1d6751a8eff01f2b0aee2d6c9db4 Message-ID: <20161024160221.MoDhSDQJDnp1tiaJbIH9oH6cfMNZNImJoZf2ZrTcI5U@z> commit: 7ba6a2c036470cfa2cf1cac7665275ba48f45627 Author: Russell Coker via refpolicy oss tresys com> AuthorDate: Wed Oct 19 06:07:20 2016 +0000 Commit: Sven Vermeulen gentoo org> CommitDate: Mon Oct 24 15:57:35 2016 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=7ba6a2c0 webalizer patch for inclusion Thanks Chris for the suggestions, here's a patch that I think is worthy of inclusion. Signed-off-by: Sven Vermeulen siphos.be> policy/modules/contrib/logrotate.te | 5 +++++ policy/modules/contrib/webalizer.if | 20 ++++++++++++++++++++ policy/modules/contrib/webalizer.te | 2 ++ 3 files changed, 27 insertions(+) diff --git a/policy/modules/contrib/logrotate.te b/policy/modules/contrib/logrotate.te index a1670d0..f7a70da 100644 --- a/policy/modules/contrib/logrotate.te +++ b/policy/modules/contrib/logrotate.te @@ -242,6 +242,11 @@ optional_policy(` varnishd_manage_log(logrotate_t) ') +optional_policy(` + manage_webalizer_var_lib(logrotate_t) + webalizer_run(logrotate_t, system_r) +') + ####################################### # # Mail local policy diff --git a/policy/modules/contrib/webalizer.if b/policy/modules/contrib/webalizer.if index fa28353..cc831b6 100644 --- a/policy/modules/contrib/webalizer.if +++ b/policy/modules/contrib/webalizer.if @@ -45,3 +45,23 @@ interface(`webalizer_run',` webalizer_domtrans($1) roleattribute $2 webalizer_roles; ') + +######################################## +## +## Manage webalizer usage files +## +## +## +## Domain allowed to manage webalizer usage files +## +## +## +# +interface(`manage_webalizer_var_lib',` + gen_require(` + type webalizer_var_lib_t; + ') + + allow $1 webalizer_var_lib_t:dir manage_dir_perms; + allow $1 webalizer_var_lib_t:file manage_file_perms; +') diff --git a/policy/modules/contrib/webalizer.te b/policy/modules/contrib/webalizer.te index 99bef4a..ff69b41 100644 --- a/policy/modules/contrib/webalizer.te +++ b/policy/modules/contrib/webalizer.te @@ -36,6 +36,7 @@ allow webalizer_t self:unix_stream_socket { accept connectto listen }; allow webalizer_t self:tcp_socket { accept listen }; allow webalizer_t webalizer_etc_t:file read_file_perms; +files_read_usr_files(webalizer_t) manage_dirs_pattern(webalizer_t, webalizer_tmp_t, webalizer_tmp_t) manage_files_pattern(webalizer_t, webalizer_tmp_t, webalizer_tmp_t) @@ -50,6 +51,7 @@ kernel_read_kernel_sysctls(webalizer_t) kernel_read_system_state(webalizer_t) files_read_etc_runtime_files(webalizer_t) +miscfiles_read_fonts(webalizer_t) fs_search_auto_mountpoints(webalizer_t) fs_getattr_xattr_fs(webalizer_t)