Linux-audit Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Guy Briggs <rgb@redhat.com>
To: John Petrini <jpetrini@coredial.com>
Cc: linux-audit@redhat.com
Subject: Re: Auditing file access by application
Date: Mon, 12 Jun 2017 11:05:04 -0400	[thread overview]
Message-ID: <20170612150504.GE21241@madcap2.tricolour.ca> (raw)
In-Reply-To: <CAD4AmV6KfUhM_N7fM6cHW+LF271G_TQiE5JYRmerw9JgzMMy2g@mail.gmail.com>

On 2017-06-12 10:20, John Petrini wrote:
> Hello,

Hi John,

> We have a need to monitor voicemail directories for any sort of access.
> Basically there is only one application that should be accessing the files.
> If anything else accesses the files we need to log that.
> 
> We setup the following to accomplish this but it's doesn't quite do what we
> want.
> 
> -a always,exit -S all -F dir=/path/to/voicemail -F perm=rwxa -F
> auid!=voicemail_user -F key=voicemail_watch
> 
> voicemail_user is the user that initially starts the process. The problem
> arises when someone logged in under a different account restarts the
> process. From that point forward every time the application accesses that
> directory it results in a log message.
> 
> We need other users to be able to be able to log in and restart the process
> so our method here really doesn't work. Is there a way to log only if a
> different application access the directory rather than basing the audit on
> user?
> 
> I was hoping to us something like -F exe!="/path/to/application" but it
> looks like this is not supported.

How about trying:

-a never,exit -S all -F exe="/path/to/application" -F dir=/path/to/voicemail -F perm=rwxa -F auid!=voicemail_user -F key=voicemail_watch
-a always,exit -S all -F dir=/path/to/voicemail -F perm=rwxa -F auid!=voicemail_user -F key=voicemail_watch

Meanwhile, I've filed an issue to add negation to "-F exe=".
	https://github.com/linux-audit/audit-kernel/issues/53

I hope this helps.

> John Petrini

- RGB

--
Richard Guy Briggs <rgb@redhat.com>
Sr. S/W Engineer, Kernel Security, Base Operating Systems
Remote, Ottawa, Red Hat Canada
IRC: rgb, SunRaycer
Voice: +1.647.777.2635, Internal: (81) 32635

  reply	other threads:[~2017-06-12 15:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-12 14:20 Auditing file access by application John Petrini
2017-06-12 15:05 ` Richard Guy Briggs [this message]
2017-06-12 15:31   ` John Petrini
2017-06-12 15:49     ` Richard Guy Briggs
2017-06-12 15:52 ` Steve Grubb
2017-06-12 16:34   ` John Petrini

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=20170612150504.GE21241@madcap2.tricolour.ca \
    --to=rgb@redhat.com \
    --cc=jpetrini@coredial.com \
    --cc=linux-audit@redhat.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