All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ryan Sawhill <rsawhill@redhat.com>
To: "warron.french" <warron.french@gmail.com>
Cc: linux-audit@redhat.com
Subject: Re: Reboots and audit.rules
Date: Thu, 30 Mar 2017 10:36:24 -0400	[thread overview]
Message-ID: <CAEkAO+ykLjr9SEykVCJXLhQh5dNHMGCVwpdFWdyduuvkhH=CNw@mail.gmail.com> (raw)
In-Reply-To: <CAJdJdQnYiNEBhME4zK69LDjA75A57Eh4z=P8Cc6SWHGjbQ+gVA@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1609 bytes --]

On Thu, Mar 30, 2017 at 8:17 AM, warron.french <warron.french@gmail.com>
wrote:

> Steve, is there anyway that you know of both as the author of the Red Hat
> Audit software, and also an employee of Red Hat that would allow someone to
> review the audit logs and determine one of the following 2 possibilities:
>
>
>    1. If the machine was rebooted through software; such as;
>
>
>    - poweroff,
>    - shutdown,
>    - init, etc.. etc..
>
> 2. Or a person pressed the power button on the front of the machine.
>
> I ran into this problem in the workplace last year, and this feature would
> be helpful, but I don't know if it is already offered covering the
> power-button depression; versus the command execution.
>
> I understand that with a power-button depression there is no way of
> capturing the/a userid; perhaps a hidden default account of "power-button"
> would suffice?
>

I haven't made a study of this on different operating systems, but I did
recently want to run an action in RHEL7 when the power button was pressed
and my experience was that systemd-logind.service always generated a "Power
key pressed" message, e.g., the following command would complete as soon as
power button was pressed:

journalctl -fu systemd-logind | grep -q "Power key pressed"
>

I was only testing on VMs running in a cloud (outside of my control), but I
didn't see if there were different messages for reset vs power buttons.

On a related note, if you're looking to block shutdowns (including power
button & user-initiated) on systemd systems, check out reboot-guard
<https://github.com/ryran/reboot-guard/>.

[-- Attachment #1.2: Type: text/html, Size: 2265 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2017-03-30 14:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30 12:17 Reboots and audit.rules warron.french
2017-03-30 14:36 ` Ryan Sawhill [this message]
     [not found]   ` <CAJdJdQnqeRWwhHWj79FY3Wp8BabKc0xb+ue8knEmzmOjkV1oXg@mail.gmail.com>
2017-03-30 22:34     ` Ryan Sawhill
2017-03-30 15:33 ` Steve Grubb

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='CAEkAO+ykLjr9SEykVCJXLhQh5dNHMGCVwpdFWdyduuvkhH=CNw@mail.gmail.com' \
    --to=rsawhill@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=warron.french@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.