public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Steve Grubb <sgrubb@redhat.com>
To: linux-audit@redhat.com
Cc: "Simon Außerlechner" <s.ausserlechner@gmail.com>
Subject: Re: Audit filtering by parent process path
Date: Tue, 08 Jan 2019 13:30:03 -0500	[thread overview]
Message-ID: <2869682.JbjiAQzMxm@x2> (raw)
In-Reply-To: <5061c49c-2d0d-0fb1-f303-968b53637b17@gmail.com>

Hello,

On Tuesday, January 8, 2019 12:09:57 AM EST Simon Außerlechner wrote:
> Using the Linux kernel audit system I audit program executions with the
> following audit rule.
> 
> -w /usr/sbin/my-program -p x -k my-program-audit-class
> 
> In order to keep the audit log clean I want to suppress executions of
> my-program if done by a defined set of applications given their path.
> Since the PPID is available in the audit log entry (type=SYSCALL), there
> might be some means to filter out by parent program path at the time the
> audit log is generated, however, I cannot find a solution, also not by
> looking at audit_filter_rules().

There isn't a capability to have auditd or the kernel to filter based on the 
parent program's name. We only have the numeric representation.

If your program is supposed to be launched only by a specific known program or 
programs, this is possibly something selinux could help with. This way when 
someone tries it at the command line you get an AVC. This would also assume 
that you do not let people log in as unconfined_t. Another possibility is that 
perhaps you can assign a supplemental group to your programs which launch 
your other program. Have it check that its inherited the supplemental group 
and exit if not. Or restrict execution by file permissions to that group. It 
should then be possible to look for execution of that returning EPERM.

-Steve

> Introducing helper scripts to clean up
> audit.log by filtering out later on as well as distinguishing by
> user/group, security context are not my preferred options.
> 
> Thank you,
> Simon
> 
> --
> Linux-audit mailing list
> Linux-audit@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-audit

      reply	other threads:[~2019-01-08 18:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-08  5:09 Audit filtering by parent process path Simon Außerlechner
2019-01-08 18:30 ` Steve Grubb [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=2869682.JbjiAQzMxm@x2 \
    --to=sgrubb@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=s.ausserlechner@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox