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 EDF00139694 for ; Thu, 18 May 2017 17:02:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 60958E0F05; Thu, 18 May 2017 17:02:51 +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 428B4E0F05 for ; Thu, 18 May 2017 17:02:46 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 7CA193416A1 for ; Thu, 18 May 2017 17:02:40 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B3C0B7461 for ; Thu, 18 May 2017 17:02:37 +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: <1495126851.1b7b773c1a5f2df67ef78aa7e5cb1016d4d82638.swift@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:swift commit in: policy/modules/kernel/, policy/modules/system/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/kernel/files.if policy/modules/system/init.te X-VCS-Directories: policy/modules/kernel/ policy/modules/system/ X-VCS-Committer: swift X-VCS-Committer-Name: Sven Vermeulen X-VCS-Revision: 1b7b773c1a5f2df67ef78aa7e5cb1016d4d82638 X-VCS-Branch: swift Date: Thu, 18 May 2017 17:02:37 +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: 446ff022-7e92-4b35-b248-0372266f2a70 X-Archives-Hash: d57e09546670ec3e6b5e9c5986809799 Message-ID: <20170518170237.3wvyzi7qi1ZeprHcjR_a4s_eFG9NPrP_iRirc-oPs_I@z> commit: 1b7b773c1a5f2df67ef78aa7e5cb1016d4d82638 Author: Krzysztof Nowicki op pl> AuthorDate: Sun May 14 15:24:03 2017 +0000 Commit: Sven Vermeulen gentoo org> CommitDate: Thu May 18 17:00:51 2017 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=1b7b773c Enable /etc directory protection using ProtectSystem Setting this service option to 'full' or 'strict' will also remount the /etc directory. Allow this in the policy. This fixes the systemd-networkd service, but will also positively affect any other service using the above hardening option. policy/modules/kernel/files.if | 19 +++++++++++++++++++ policy/modules/system/init.te | 1 + 2 files changed, 20 insertions(+) diff --git a/policy/modules/kernel/files.if b/policy/modules/kernel/files.if index a74f7913..c6df0a62 100644 --- a/policy/modules/kernel/files.if +++ b/policy/modules/kernel/files.if @@ -2853,6 +2853,25 @@ interface(`files_relabelto_etc_dirs',` ######################################## ## +## Mount a filesystem on the +## etc directories. +## +## +## +## Domain allowed access. +## +## +# +interface(`files_mounton_etc_dirs',` + gen_require(` + type etc_t; + ') + + allow $1 etc_t:dir mounton; +') + +######################################## +## ## Read generic files in /etc. ## ## diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te index f388f1e0..3d3697fb 100644 --- a/policy/modules/system/init.te +++ b/policy/modules/system/init.te @@ -288,6 +288,7 @@ ifdef(`init_systemd',` files_search_kernel_modules(init_t) # for privatetmp functions files_mounton_tmp(init_t) + files_mounton_etc_dirs(init_t) fs_relabel_cgroup_dirs(init_t) fs_rw_cgroup_files(init_t)