public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Steve Grubb <sgrubb@redhat.com>
To: linux-audit@redhat.com
Subject: Re: file watch: separating file reads and writes
Date: Thu, 10 Jul 2014 16:24:54 -0400	[thread overview]
Message-ID: <8316343.lH8SE5fr7Q@x2> (raw)
In-Reply-To: <94943543FF1E4246B0C4B827E39988190176403A@PDXMB01.tripwire.com>

On Wednesday, July 09, 2014 04:00:18 AM Jon Smith wrote:
> I recently used auditd to setup a watch on a specific file (-w
> /path/to/my/file -p warx), but found it difficult to distinguish system
> calls that were modifying the file vs. reading from the file when using
> ausearch/aureport.
> 
> In response to that, I separated out the watches by keys:
> 
> -w /patch/to/my/file -p wa thisisawrite
> -w /path/to/my/file -p r thisisaread

This sounds like the correct way to do it.

 
> And then ran both aureport -k and aureport -f to join the keys to the system
> calls by event number.

Why not use ausearch -k? You can also give a partial key name since partial 
matching is the default. You could use: ausearch --start today -k thisisa


> Am I wholly approaching this the wrong way, or is there an easier way to
> distinguish between a syscall that reads from a file vs. writes to a file?

Well, what you are getting is the requested permissions, rather than actual 
use of the permissions. I think it can be assumed that if an app opens a file 
for write, it will eventually get around to that. But not always.

> Assuming this is the correct approach, would there then be a benefit to
> adding the key to the aureport -f output? I find it awkward to have to
> combine the two commands to get the necessary information.

No one has asked for that so far. There is one quirk about keys, you can have 
multiple keys for the same event. So, that could be a bit of text if you have 
several. The idea of aureport was to have a utility that can extract, total, 
and sort properties of the event.

-Steve

  reply	other threads:[~2014-07-10 20:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-09  4:00 file watch: separating file reads and writes Jon Smith
2014-07-10 20:24 ` Steve Grubb [this message]
2014-07-22  2:19   ` Jon Smith

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=8316343.lH8SE5fr7Q@x2 \
    --to=sgrubb@redhat.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