Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2FF9C31D63 for ; Mon, 21 Jan 2019 07:20:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B0DD820823 for ; Mon, 21 Jan 2019 07:20:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b="HQaw9WS1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727047AbfAUHUQ (ORCPT ); Mon, 21 Jan 2019 02:20:16 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:33798 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727228AbfAUHUP (ORCPT ); Mon, 21 Jan 2019 02:20:15 -0500 Received: by mail-qk1-f194.google.com with SMTP id q8so11792337qke.1 for ; Sun, 20 Jan 2019 23:20:14 -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=HSEFIGamJDz7wnsQb5nM81eG+/U4w23qWIrOcOLBjKA=; b=HQaw9WS1wDogq1/P3gQySwtnX9B0Lq+rbhbTIyetosfBN/OWahI/d2LaFhYQI1fW/r 2TMWF4rcsKIPlFe9pbDzWNUo55EEejim2PVoOZm91y5Tb729E0k+GVMfmofQtAgU2xYw 7MfKLnYGG7KREa/sE1dJDs8f0m9gSDsHkWaU8= 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=HSEFIGamJDz7wnsQb5nM81eG+/U4w23qWIrOcOLBjKA=; b=BeFoT5fVnZx67UU6s/2LLlGrkUUhbAnFsCG1GoCMhc9bjucxcbHuUmfwszze5u6QbQ Dt7i2dNmdM1fgwIJWEr4IlnFuxkHXWBJ/eX5+SUxwVPOvjxAYcVSfP3E0pFB5+0f20Fv pmhEsYPJeS44/IT4+zTR1M63fDIeGxNYDG+NKI0IBhQQ6CnBqHRrNLuWhKYi5Wwvyo7W uVlxXIKY1UQtcZgbPBozLWzdxtB69KOhZqGqRosV7QP+3d6J9VFyBX6IXmGcHMJf55QH b7y9+SfdGOAVAXP6LJCuhG8CSssCHBGIjy2k8EHWPAK2yHBPTOw5tKR3PQpolAZSmvCl rf2g== X-Gm-Message-State: AJcUukdAy8+IJ1c7E1s23VzF3EM6nuSjo9qp6T8dxrQjInaitgEPV4Cx gYYnM+tToN7fKL69B/9pjGhN4nkRykw= X-Google-Smtp-Source: ALg8bN6jdWMTM3s6794V4EgQ6d2ZBQaoyk/v0J6T5D6uXHd/JVc4UL85dFB3MPv3Dzut/CgLrHv7hA== X-Received: by 2002:ae9:e804:: with SMTP id a4mr21919497qkg.99.1548020774869; Sun, 20 Jan 2019 13:46:14 -0800 (PST) Received: from [192.168.1.190] (pool-108-15-23-247.bltmmd.fios.verizon.net. [108.15.23.247]) by smtp.gmail.com with ESMTPSA id q21sm68188295qtk.79.2019.01.20.13.46.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Jan 2019 13:46:14 -0800 (PST) Subject: Re: [PATCH] Add interface to read journal files To: "Sugar, David" , "selinux-refpolicy@vger.kernel.org" References: <20190119161905.25553-1-dsugar@tresys.com> <20190119161905.25553-2-dsugar@tresys.com> From: Chris PeBenito Message-ID: Date: Sun, 20 Jan 2019 16:34:44 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <20190119161905.25553-2-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/19/19 11:19 AM, Sugar, David wrote: > When using 'systemctl status ' it will show recent > log entries for the selected service. These recent log > entries are coming from the journal. These rules allow the > reading of the journal files. > > type=AVC msg=audit(1547760159.435:864): avc: denied { read } for pid=8823 comm="systemctl" name="journal" dev="dm-14" ino=112 scontext=staff_u:staff_r:monitor_t:s0-s0:c0.c1023 tcontext=system_u:object_r:systemd_journal_t:s0 tclass=dir permissive=1 > type=AVC msg=audit(1547760159.435:864): avc: denied { open } for pid=8823 comm="systemctl" path="/var/log/journal" dev="dm-14" ino=112 scontext=staff_u:staff_r:monitor_t:s0-s0:c0.c1023 tcontext=system_u:object_r:systemd_journal_t:s0 tclass=dir permissive=1 > type=AVC msg=audit(1547760159.435:865): avc: denied { getattr } for pid=8823 comm="systemctl" path="/var/log/journal/21cf24d493e746a9847730f8476e1dba/system.journal" dev="dm-14" ino=8388707 scontext=staff_u:staff_r:monitor_t:s0-s0:c0.c1023 tcontext=system_u:object_r:systemd_journal_t:s0 tclass=file permissive=1 > type=AVC msg=audit(1547760159.435:866): avc: denied { read } for pid=8823 comm="systemctl" name="system.journal" dev="dm-14" ino=8388707 scontext=staff_u:staff_r:monitor_t:s0-s0:c0.c1023 tcontext=system_u:object_r:systemd_journal_t:s0 tclass=file permissive=1 > type=AVC msg=audit(1547760159.435:866): avc: denied { open } for pid=8823 comm="systemctl" path="/var/log/journal/21cf24d493e746a9847730f8476e1dba/system.journal" dev="dm-14" ino=8388707 scontext=staff_u:staff_r:monitor_t:s0-s0:c0.c1023 tcontext=system_u:object_r:systemd_journal_t:s0 tclass=file permissive=1 > type=AVC msg=audit(1547760159.436:867): avc: denied { map } for pid=8823 comm="systemctl" path="/var/log/journal/21cf24d493e746a9847730f8476e1dba/system.journal" dev="dm-14" ino=8388707 scontext=staff_u:staff_r:monitor_t:s0-s0:c0.c1023 tcontext=system_u:object_r:systemd_journal_t:s0 tclass=file permissive=1 > > Signed-off-by: Dave Sugar > --- > policy/modules/system/systemd.if | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if > index 740b3a92..c6d40b10 100644 > --- a/policy/modules/system/systemd.if > +++ b/policy/modules/system/systemd.if > @@ -409,6 +409,24 @@ interface(`systemd_manage_journal_files',` > allow $1 systemd_journal_t:file map; > ') > > +######################################## > +## > +## Allow domain to read systemd_journal_t files > +## > +## > +## > +## Domain allowed access. > +## > +## > +# > +interface(`systemd_read_journal_files',` > + gen_require(` > + type systemd_journal_t; > + ') > + > + list_dirs_pattern($1, systemd_journal_t, systemd_journal_t) > + mmap_read_files_pattern($1, systemd_journal_t, systemd_journal_t) > +') > > ######################################## > ## Merged. -- Chris PeBenito