From: Chris PeBenito <pebenito@ieee.org>
To: "Sugar, David" <dsugar@tresys.com>,
"selinux-refpolicy@vger.kernel.org"
<selinux-refpolicy@vger.kernel.org>
Subject: Re: [PATCH] Allow audit daemon to halt system
Date: Tue, 21 Jan 2020 08:38:35 -0500 [thread overview]
Message-ID: <57feca94-255a-b04f-597b-462d4eb0b6e9@ieee.org> (raw)
In-Reply-To: <20200113182743.3502993-1-dsugar@tresys.com>
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 <dsugar@tresys.com>
> ---
> 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;
> ')
>
> +########################################
> +## <summary>
> +## Get the system status information about power units
> +## </summary>
> +## <param name="domain">
> +## <summary>
> +## Domain allowed access.
> +## </summary>
> +## </param>
> +#
> +interface(`systemd_status_power_units',`
> + gen_require(`
> + type power_unit_t;
> + class service status;
> + ')
> +
> + allow $1 power_unit_t:service status;
> +')
> +
> +
> ########################################
> ## <summary>
> ## Make the specified type usable for
>
--
Chris PeBenito
prev parent reply other threads:[~2020-01-21 13:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-13 18:28 [PATCH] Allow audit daemon to halt system Sugar, David
2020-01-21 13:38 ` Chris PeBenito [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57feca94-255a-b04f-597b-462d4eb0b6e9@ieee.org \
--to=pebenito@ieee.org \
--cc=dsugar@tresys.com \
--cc=selinux-refpolicy@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).