From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Grubb Subject: Re: How to make audit match only one rule? Date: Mon, 29 Jul 2013 15:45:19 -0400 Message-ID: <15281236.l4rs5po0AS@x2> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: linux-audit@redhat.com List-Id: linux-audit@redhat.com On Monday, July 29, 2013 11:38:15 AM zhu xiuming wrote: > HI > I have two rules in my audit rules > -a always,exit -F arch=b32 -S execve -k EXEC_LOG > -w /etc/passwd -p wra -k identity > > > When I enter > cat /etc/passwd on the console > > Both rules are matched and there is redundant information in the log. How > to make sure there is only one rule matched. The problem is that two different events are actually occurring. The granularity of the Linux audit system is at the syscall level rather than a higher level such as commands. The first event you get is probably the execve for /bin/cat. Then once that program starts running, it does an open syscall of /etc/passwd. So the audit system matches twice. On any single system call, the audit system only matches the first rule it finds. It will not match twice on a single syscall. -Steve