Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4653049ybl; Wed, 22 Jan 2020 02:07:57 -0800 (PST) X-Google-Smtp-Source: APXvYqyJKVcRcFbfocRL8QGTTnw+UNuOzaH1qjZhpHEE6Jv8BAEsrky1WpNEDuYJ/cVp9gQK7prZ X-Received: by 2002:a05:6808:1c6:: with SMTP id x6mr6255943oic.49.1579687677417; Wed, 22 Jan 2020 02:07:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579687677; cv=none; d=google.com; s=arc-20160816; b=gMlPLWw+fZKol6Hp9DT3k8gVUj4wR1/a0af4bh6hRLSwuuFgwIZwbjttI3RrFEJy4+ bpo/y4Q0OlQrN0xMDIn7dTSb4UXOQyCPFS1vmsnXXIn/E4KyajXca2RJyF6Ypq4/Zq7v O9kYbjGT6YSHPXCcBnxmVIOiDJdhi6YIroge1t4QldLPCFaKGCN3t02igqYnQX20n1V4 4qmhnJOa+I+OESjk5dRQ1TKN3ijT/JeTHHEV+8lsJdpQ5h85ojcYmRgHVa9GhaoNLmbD VChA+S11R+qRbMCCX20n1R6e8i+SltagCLQ2/3bor1CJxIVqFcjH9vh/PcsL0NpqAyyR Nzog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=meIVbaNWF3wMxvGvoTyb/VBIEwT/tVKAhUeffbtXIuI=; b=mpREf/lsEorOzNV51MZ3AFE7i/E9Ns0bzBTzT8uLzull76HJrff3p8bk5diOZC58oA CPhAIxHcX6XEF9gwQRNn2+gVRYGT0lX6PLPgijyTjoqGPB1Voja+FPj6xnUbn/IZ3+x5 /getMMaTC7/l4vSBLPQabcR3IpUH0WNvR9DkG/e/e5k1ndHfd3PDNCr8C4gjyI1MnMOu 8fGffsM7if/a/2dkgRSvodWh+ED1UEpiFQOfSJ33WVp86Ea//FmanEIJLLrYvk61wZGC Ava2EGBU2SB+9cHDMGYUCDkuQIbliIPUPELiM6imR0BzVDBKIDjaqoI50sskVDkZHIPs pbtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=TR4efqtX; spf=pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ieee.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h14si24316402otn.6.2020.01.22.02.07.55; Wed, 22 Jan 2020 02:07:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=TR4efqtX; spf=pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ieee.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729093AbgAVKHi (ORCPT + 13 others); Wed, 22 Jan 2020 05:07:38 -0500 Received: from mail-qk1-f196.google.com ([209.85.222.196]:42612 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725911AbgAVKHh (ORCPT ); Wed, 22 Jan 2020 05:07:37 -0500 Received: by mail-qk1-f196.google.com with SMTP id q15so5086462qke.9 for ; Wed, 22 Jan 2020 02:07:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=meIVbaNWF3wMxvGvoTyb/VBIEwT/tVKAhUeffbtXIuI=; b=TR4efqtXStxyU6i1Iq9iZEikR4b1lcl3uGLGP8Wn3JPEfcED5KBcWpLutzuSn1RoHF cg5lNI/gSTJf9Gxh+1/qzP+n5Jf6ZX+h5v5dfxv5qS6I1FF/RHAgPbI3xT1qNiOtSADj POy3a8k2FyfeqCvhjU5a9i991p318mTo4gZw8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=meIVbaNWF3wMxvGvoTyb/VBIEwT/tVKAhUeffbtXIuI=; b=RjbjT3rEDb5Mz4Y1KnzzXF35mMBeKXBkhk/OMsTj3BOq5IM+zsu5OEy11e7iXvQkbZ jBQ4GtBxQBqz8i/kpFgxi7xjQAcjfTgX4ZxttrJpmTGBYAGFQKt4eUU0i8iG+ql7Ya2d zRcqVDtze2hHyEBs3+AD2FPnaew/u+nUk2w5RiBMa3Pk58+qlFmLhZHnDX4JsoznaOXA NvjaQEKU2dQEHCRqDnAL6oK1d70kitu4OZZ4/eldX8OKPwpd1aNJBKEN2MlsV+Wg3x6H ww8Kq1yVMFjXrpEdoE2aYJVuvFH7GbuUgQH1lJrqoukWtK6swXxmuVcFcfZYpy4K2Dar RSPQ== X-Gm-Message-State: APjAAAX5vNGjxrqpx6UOS7DnvnKB3j+OPIltlUDFQLO/jWLE94lln/Xg KI/WktZBigUD92Ff7RKaLXZ4BpDLCW2gUA== X-Received: by 2002:a37:4c05:: with SMTP id z5mr7616qka.469.1579687656453; Wed, 22 Jan 2020 02:07:36 -0800 (PST) Received: from fedora.pebenito.net (pool-108-15-23-247.bltmmd.fios.verizon.net. [108.15.23.247]) by smtp.gmail.com with ESMTPSA id g52sm21587436qta.58.2020.01.22.02.07.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Jan 2020 02:07:36 -0800 (PST) Subject: Re: [PATCH v2] audit daemon can halt system, allow this to happen. To: "Sugar, David" , "selinux-refpolicy@vger.kernel.org" References: <20200121160346.392210-1-dsugar@tresys.com> From: Chris PeBenito Message-ID: <0c4ce4db-9273-5701-22f6-0a72c308f518@ieee.org> Date: Wed, 22 Jan 2020 05:07:34 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20200121160346.392210-1-dsugar@tresys.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org On 1/21/20 11:04 AM, Sugar, David wrote: > 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 > > Signed-off-by: Dave Sugar > --- > 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 4c11d061..a4c46c81 100644 > --- a/policy/modules/system/logging.te > +++ b/policy/modules/system/logging.te > @@ -223,6 +223,12 @@ ifdef(`distro_ubuntu',` > ') > ') > > +optional_policy(` > + init_list_unit_dirs(auditd_t) > + systemd_start_power_units(auditd_t) > + systemd_status_power_units(auditd_t) > +') > + Needs to move down between the seutil and udev optionals. -- Chris PeBenito