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 14A76138351 for ; Sat, 15 Feb 2020 07:33:42 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1791EE0949; Sat, 15 Feb 2020 07:33:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D9829E0943 for ; Sat, 15 Feb 2020 07:33:35 +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 CFDBC34ED21 for ; Sat, 15 Feb 2020 07:33:34 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 362BA151 for ; Sat, 15 Feb 2020 07:33:30 +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: <1581751925.5668039ba3897f9ca837387d67b039e51fe1e41b.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/system/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/system/logging.te policy/modules/system/systemd.if X-VCS-Directories: policy/modules/system/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 5668039ba3897f9ca837387d67b039e51fe1e41b X-VCS-Branch: master Date: Sat, 15 Feb 2020 07:33:30 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ce319c9b-31f1-4969-9975-c6c5cd997599 X-Archives-Hash: 85d44cfeab0c1a3b62895fb6de1256c1 commit: 5668039ba3897f9ca837387d67b039e51fe1e41b Author: Sugar, David tresys com> AuthorDate: Wed Jan 22 12:35:42 2020 +0000 Commit: Jason Zaman gentoo org> CommitDate: Sat Feb 15 07:32:05 2020 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=5668039b audit daemon can halt system, allow this to happen. auditd can halt the system for several reasons based on configuration. These mostly revovle around audit partition full issues. I am seeing the following denials when attempting to halt the system. Jan 12 03:38:48 localhost audispd: node=localhost type=USER_AVC msg=audit(1578800328.122:1943): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc: denied { start } for auid=n/a uid=0 gid=0 path="/usr/lib/systemd/system/poweroff.target" cmdline="/sbin/init 0" scontext=system_u:system_r:auditd_t:s0 tcontext=system_u:object_r:power_unit_t:s0 tclass=service exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?' Jan 12 03:38:48 localhost audispd: node=localhost type=USER_AVC msg=audit(1578800328.147:1944): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc: denied { status } for auid=n/a uid=0 gid=0 path="/usr/lib/systemd/system/poweroff.target" cmdline="/sbin/init 0" scontext=system_u:system_r:auditd_t:s0 tcontext=system_u:object_r:power_unit_t:s0 tclass=service exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?' Jan 12 04:44:54 localhost audispd: node=localhost type=AVC msg=audit(1578804294.103:1923): avc: denied { getattr } for pid=6936 comm="systemctl" path="/run/systemd/system" dev="tmpfs" ino=45 scontext=system_u:system_r:auditd_t:s0 tcontext=system_u:object_r:systemd_unit_t:s0 tclass=dir permissive=1 v2 - use optional rather than ifdef v3 - fix order Signed-off-by: Dave Sugar tresys.com> Signed-off-by: Jason Zaman gentoo.org> policy/modules/system/logging.te | 6 ++++++ policy/modules/system/systemd.if | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te index 19ef420f..d763b06e 100644 --- a/policy/modules/system/logging.te +++ b/policy/modules/system/logging.te @@ -231,6 +231,12 @@ optional_policy(` seutil_sigchld_newrole(auditd_t) ') +optional_policy(` + init_list_unit_dirs(auditd_t) + systemd_start_power_units(auditd_t) + systemd_status_power_units(auditd_t) +') + optional_policy(` udev_read_db(auditd_t) ') diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if index 8f50e39e..4dd26458 100644 --- a/policy/modules/system/systemd.if +++ b/policy/modules/system/systemd.if @@ -819,6 +819,26 @@ interface(`systemd_start_power_units',` allow $1 power_unit_t:service start; ') +######################################## +## +## Get the system status information about power units +## +## +## +## Domain allowed access. +## +## +# +interface(`systemd_status_power_units',` + gen_require(` + type power_unit_t; + class service status; + ') + + allow $1 power_unit_t:service status; +') + + ######################################## ## ## Make the specified type usable for