All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Grubb <sgrubb@redhat.com>
To: linux-audit@redhat.com
Subject: Re: The relationship between audit rules
Date: Wed, 21 Aug 2013 16:00:56 -0400	[thread overview]
Message-ID: <2301880.gVzkDbq6Ft@x2> (raw)
In-Reply-To: <CAP6dAmfNhq__sJUW2K2NLyG9CMAnW+mVsSqoftQmurbYNJzYKw@mail.gmail.com>

On Wednesday, August 21, 2013 12:35:01 PM zhu xiuming wrote:
> I am little confused by the relationship between audit rules.
> 
> I want to log all other users command history and read/write passwd except
> me (auid 16382)
> 
> However, it seems I have to add -F auid!=16382 on  both rules.
> 
> -a always,exit -F arch=b32 -S execve  -k EXEC_log
>  -w /etc/passwd           -p wr  -k identity_write
> 
> I tried to add following rules "before" the two rules above.
> -a never,exit -F auid=16382
> 
> However, it does not work at all.
> 
> So, the rules in audit rules seem independent from each other.  Am I right?

For each filter, the first match wins. So, you have to organize the rules from 
specific to general in case there's a possibility of triggering two or more 
rules.

You could do this:

-a always,exit -F path=/etc/passwd -F perm=wr -F auid!=16382 -F key=pwd_log
-a always,exit -F arch=b32 -S execve -F auid!=16382 -F key=EXEC_log

or

-a never,exit -F arch=b32 -S all -F auid=16382
-a always,exit -F path=/etc/passwd -F perm=wr -F key=pwd_log
-a always,exit -F arch=b32 -S execve -F key=EXEC_log

They should be equivalent. Also, the only time you need b32 is when you have 
an x86_64 system.  In that case you need another set of rules with b64 since 
64 bit systems normally have both 32 and 64 bit interfaces. If you have true 
32 bit system just delete the field.

-Steve

  reply	other threads:[~2013-08-21 20:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-21 19:35 The relationship between audit rules zhu xiuming
2013-08-21 20:00 ` Steve Grubb [this message]
2013-08-21 20:36   ` zhu xiuming
2013-08-21 21:35     ` zhu xiuming

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=2301880.gVzkDbq6Ft@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 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.