Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1825712ybv; Sat, 8 Feb 2020 06:50:11 -0800 (PST) X-Google-Smtp-Source: APXvYqxpy8WD93cLII5H6+S4f40J+EyP/X3E5/iFfaz9DjK9+BOBJ03xS3cZFP1UANvkTHYz4Zu4 X-Received: by 2002:a05:6830:1bda:: with SMTP id v26mr3531239ota.314.1581173411496; Sat, 08 Feb 2020 06:50:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581173411; cv=none; d=google.com; s=arc-20160816; b=NcTFZMOwYRfAtRJaIYAPeOei7CHC3sgTgj/3dFwPA9kTRdFa92pvUK9GnEa2Up0Aj5 hhzh7s0G3HOa01BsOfDqGL/hruxurMPNBspvgEasiEk/ofPYmFmNIn/GPauaXI8uVynA NrM1uLGfQZ3BWb9BFuATDbWIyqQsi4mvFM5VwBeJTOxJZa+dqxIMbnoIBcoGg/MhPZKp vL/xW3TQCsXonsVZ4Y63bNtn0DIQKLU0gbqT0A/3mY8zopLt+0a3Lvv/EOrqJ9kN8/xr njQMd5Np5Lk8CWWKwXUUmto5TIf1WyJl/T3J4c8Z1820vmcww4tk0aES094zeNB2wPyh zuvg== 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=d13aBYreI8WtjWk2AIENIezs1zLnPPQBHpyu5k86f/k=; b=TQDfFZR0vJ68gEk+xurcMKjDXYTziDxZDuqGPqsZVB4iKk2lj8KTeBXZjfXfKT4LGb mX0g8mwqp1HwNm/3J8ZvJtRJG84YVHDtMGiR3iJBSMRhXrxz/PlHz3mjVfGt1n3UeqJz I5R6tty6tVh2XSpdIdQAHW43ukkfEsp8bO/+U1fB2zHEKLKAC9vi6VuncrdwQ+E/QRh4 ap3uEjnM0byIJ6qVbWWxjll3M2b/OvPnm3FqexEW1eUL1QdWdIXAhmXSZDCNeHAL8mWJ mIGzQMORqvrUjTr7+FMWu2WZz4eEJm9Onh3wp5Nx3H0Nr2VBjvdygpXcNrY2mQkr0+di 70Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=AvyBO0rz; 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 v13si1726494otp.273.2020.02.08.06.50.06; Sat, 08 Feb 2020 06:50:11 -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=AvyBO0rz; 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 S1727340AbgBHOuC (ORCPT + 13 others); Sat, 8 Feb 2020 09:50:02 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:37867 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727335AbgBHOuC (ORCPT ); Sat, 8 Feb 2020 09:50:02 -0500 Received: by mail-qk1-f193.google.com with SMTP id c188so2098120qkg.4 for ; Sat, 08 Feb 2020 06:50:00 -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=d13aBYreI8WtjWk2AIENIezs1zLnPPQBHpyu5k86f/k=; b=AvyBO0rzYJGVEY4rieYX1ODAdk0XSUR326QnP/fEbqhQVJ5zsQiGI35H1LmDfaOit7 7bf6mb7ixqRqAqZQhgPMOfDTUizwAWo2+rJv4Wzf6e3ygyfWH2w3aPPfvuUHPbQXf7+w j39rkzOSsyOcScdwnzdeHzQ37F67iJQhkypv4= 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=d13aBYreI8WtjWk2AIENIezs1zLnPPQBHpyu5k86f/k=; b=ZfEJL+SFkj/7JBkn/d+n6sSlI4Zu6w6IUNlJGcB/jNWu7U99EnThojf8rw7fAkOLTJ YvMyjc7Wwunq68R/SCALxOeNACe/m/zLyGmGx/dko4RcvwnyM+MPt/Q21ZWozW7DVG5R n7iuBU/4bCneuSA0Bf0q2TFafiUvt9SfGDFHTI0yYAupySutKQkqlQEsvJcLi6fSdSkU OwKJspVdZHPoXTA3UvtIsScDuZRzFPn9t56pd2yRiXLoeZ+FAtTEXrW4xWiRGdxQ/DZa 7wpDBlq/09MjoPd/7hvLSgDnrJFSGV9X/10NRdEu1AYWEAH6M45DlscochMF5le6Vz28 wZvg== X-Gm-Message-State: APjAAAV9BDPc2tUa2JCTWNOdF/ihVpMqVwgmSGOgr8ugIlHosr2+dD6E MfNwiifZqJY8z4xtOBwp4XsZ2cySDtE= X-Received: by 2002:a05:620a:2018:: with SMTP id c24mr3615814qka.170.1581173399970; Sat, 08 Feb 2020 06:49:59 -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 u12sm3225238qtj.84.2020.02.08.06.49.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 08 Feb 2020 06:49:59 -0800 (PST) Subject: Re: [PATCH v3] audit daemon can halt system, allow this to happen. To: "Sugar, David" , "selinux-refpolicy@vger.kernel.org" References: <20200122123529.691385-1-dsugar@tresys.com> From: Chris PeBenito Message-ID: <57ead422-4a1f-1f61-d037-c9a4697b2192@ieee.org> Date: Sat, 8 Feb 2020 09:41:53 -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: <20200122123529.691385-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/22/20 7:35 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 > v3 - fix order > > 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..bce6b4d8 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 a49b0f77..8e46f443 100644 > --- a/policy/modules/system/systemd.if > +++ b/policy/modules/system/systemd.if > @@ -791,6 +791,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 Sorry for the delay. Merged. -- Chris PeBenito