Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3706623ybl; Tue, 21 Jan 2020 05:43:24 -0800 (PST) X-Google-Smtp-Source: APXvYqyIAfoJGjvbGU4YC+tG9ZLBfzT86FITk7BmANhjkJ6JMspYbNh0q2FEtF8iB0WRP1XEvAXQ X-Received: by 2002:a05:6808:53:: with SMTP id v19mr2844085oic.169.1579614203977; Tue, 21 Jan 2020 05:43:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579614203; cv=none; d=google.com; s=arc-20160816; b=VVRdqDLvgN3kgkTks+M0acNZ0UHRNMxppWwKLJYZit2a/sLBDfKV6rgIAvUvN/eoNp Xtd/lYepY0X99KRb6uX4OiU7fwdU6+wTaZu6JXZN8matvD/7YdoLhKkVptfnKpqlQxOi jgekbLIQpTF80W6Q40QWYNXM5ChSxLam5XlPOTYM23tbr/IrfLiUtk13YUqgY7VywthV tub8SvIMF5EZVF2rKsFKQaxcAG+2TA/mnOadOGJ/1ztaWbO91RU2cB+pAsGKkChCUrV6 h+IhnRrH/3JTk95ewlysj/OOduKBpY3xj+WclsQigE39gPi0TOG/sImiunBX8FhzuxaB Skuw== 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=c+kDU23JEjqpmK4aMGwqnZnOE081pdVn0aWnGy6+OIM=; b=I9OBIHsYypzFXsgt44v2/UeDrcvQkmyJTiQK++k0Z4vrkMA5Hyb0eidqQx28f1K+cm cKhW3eAL/v4QPfa4b7a635zfIc4Tr93Qsdv3/eBKu/ceKrs4oNf8VzJpTIJNa0Zfd6Ip yE1NwNw9i9ofTEz1QKYA6zeic7ij+IfOMfbDCN9nrxuuIxlHyvK679kJgrLP88dnY1gv dHbn52gDJ6uVMUHp4NuVqDlwvURVMsWbGfCagsYk3LtJ9JRoI2Q6P0mbqWoRqPXYaWW2 PjoKD/rhCUw+Am80BDVnZCTf5B1ONUEDtPGneXTocUVpPlRYtEuzrrdaEr9Y8WoqYAxY Pnog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=N4xvpzcz; 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 w19si21721134otj.209.2020.01.21.05.43.21; Tue, 21 Jan 2020 05:43:23 -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=N4xvpzcz; 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 S1726968AbgAUNnT (ORCPT + 13 others); Tue, 21 Jan 2020 08:43:19 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:38894 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728709AbgAUNnS (ORCPT ); Tue, 21 Jan 2020 08:43:18 -0500 Received: by mail-qk1-f194.google.com with SMTP id k6so2685072qki.5 for ; Tue, 21 Jan 2020 05:43:18 -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=c+kDU23JEjqpmK4aMGwqnZnOE081pdVn0aWnGy6+OIM=; b=N4xvpzczKDAFdnvkbD40vyxvuBabhbqSE2SB5mrC3hW6W2tRlnLbaT6O8PwgWNhfiF 25dClF3T5M1IoxqZQeRuvHAaYe9cgnsqnBjigvMLeO3DrpO1Bm3DCZzvg4mS4rMUYwon axtdgnaJV+isYcJBZI7zXUqP5SETQ2WYcrtgY= 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=c+kDU23JEjqpmK4aMGwqnZnOE081pdVn0aWnGy6+OIM=; b=GBuS7g34eA6cAFT7SyrUbX6muUeT4QS3StXfzq+u76Tf8drnt1MHEjQng0EmWSgSvs vWVfBzduZElN0BhMKq6lLmSG9SsIJWLMKVmIIpcuLba3nVjCC1yvBH7o/MtACJevn8yA BICATYUfjKn/epBGxsc2V8LaRx40RzHJ7CjLPZZnQER5FD6tJRpKeHYVfq3cOQywNv3N BJMsHfgakcuAbJZu9dAK7b41F1Eq0zMIqPB99kV4AC5YbDXXXRqeBUuEeYkJzFQEmSR5 8KmDUgMAz5wGU9+gbIY2UVfOUbnGhQ7kocWZ5XNg2x5p7VErXR+gppTaYy/KD/2nQ18f EUKQ== X-Gm-Message-State: APjAAAXOWIcGP3EWfKMjA73aZza+gWEWFHJcZs0wELGCYoUITfxZ6Uxb HvYxH5LXYcN7wiIo188m2h7Xliz5tCYuYg== X-Received: by 2002:ae9:c011:: with SMTP id u17mr4459283qkk.480.1579614197595; Tue, 21 Jan 2020 05:43:17 -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 w60sm19033651qte.39.2020.01.21.05.43.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Jan 2020 05:43:16 -0800 (PST) Subject: Re: [PATCH] Allow audit daemon to halt system To: "Sugar, David" , "selinux-refpolicy@vger.kernel.org" References: <20200113182743.3502993-1-dsugar@tresys.com> From: Chris PeBenito Message-ID: <57feca94-255a-b04f-597b-462d4eb0b6e9@ieee.org> Date: Tue, 21 Jan 2020 08:38:35 -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: <20200113182743.3502993-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/13/20 1:28 PM, 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 > > 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 73ca3042..69349af0 100644 > --- a/policy/modules/system/logging.te > +++ b/policy/modules/system/logging.te > @@ -224,6 +224,12 @@ ifdef(`distro_ubuntu',` > ') > ') > > +ifdef(`init_systemd',` I think in this case an optional would be sufficient due to the systemd_* interface use. > + init_list_unit_dirs(auditd_t) > + systemd_start_power_units(auditd_t) > + systemd_status_power_units(auditd_t) > +') > + > optional_policy(` > mta_send_mail(auditd_t) > ') > diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if > index 0fd37fe8..2e9098a2 100644 > --- a/policy/modules/system/systemd.if > +++ b/policy/modules/system/systemd.if > @@ -773,6 +773,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 > -- Chris PeBenito