Linux-audit Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Grubb <sgrubb@redhat.com>
To: linux-audit@redhat.com
Cc: Leigh Purdie <intersect@gmail.com>
Subject: Re: Dispatcher - single line output (perl)
Date: Mon, 22 May 2006 10:22:41 -0400	[thread overview]
Message-ID: <200605221022.41541.sgrubb@redhat.com> (raw)
In-Reply-To: <1ba978500605220535h537ec28cp6fbddd86e2779228@mail.gmail.com>

On Monday 22 May 2006 08:35, Leigh Purdie wrote:
>From what I understand, supporting this feature in the kernel is a
> little challenging due to the potential memory/cache requirements -
> having to save off the 'pieces' of an event from initiation to exit,
> could be quite expensive when we're talking in-kernel resources.

This is pretty much what the audit system does in the kernel. It saves 
everything in the context until it decides to output an event. Then it dumps 
all records associated with the event into the netlink queue.

> Hence, we're left with an audit output that could:
> * Have an arbitrary number of lines per unique event,
> * Be chronologically distributed in some cases (event lines may be
> spread over several seconds),

Doubtful.

> * Be out of sequence (numerically - two lines from event A, might be
> followed by 1 line from event B, then another line from event A,
> followed by the rest of event B).

I haven't seen this except when we introduced a bug in the kernel.

>  * Have multiple 'items' with the same name (eg: source/dest UID's for
> a CHMOD have the same 'name/key', though they are on different lines).
> (Please let me know if these assumptions are incorrect!)

The record type has something to do with the meaning of any items.

> However, the dispatcher infrastructure offers the potential to
> implement this sort of functionality in user-space.

Yes, I'm glad to see more people use this feature. Please note that there is 
an API version number that dictates the format of the records passed through 
the event dispatcher mechanism. Right now, the version is 0. It is the 1st 32 
bit word sent in the dispatcher header. I should probably add a specification 
to my people page so that everyone knows the rules. 

Also, the audit daemon can be told not to log anything locally so that its all 
done across the network. Its in the auditd.conf man page. The dispatcher is 
responsible for adding the machine or host's name if that's needed in the 
record.

> We also getpwname/getgrname (with an internal cache to avoid recursive
> audit events), and an internal simple realpath() to turn
> /path/to/blah/../../to/somewhere into /path/to/somewhere.

Not looking at your code...but you probably are referring to munging CWD & 
PATH records to create complete path? If not, that's what you need to do.

> The raw perl is attached. Does anyone have any comments, or
> suggestions? 

Just one, at some point I'm going to pick up work again on the audispd 
program. It will have a plugin architecture that will allow multiple programs 
like yours to share the event data. Its likely to be a couple months before I 
start back into it...but I just wanted you to be aware of the long range 
plans.

But until then, its fine to grab the event dispatcher hook and use it 
exclusively.

> In particular, comments would be welcome on how to absolutely,
> programatically determine when an 'event' is complete, and it is safe
> to push out our final 'line'.

When the serial number changes is what I've been using in ausearch/aureport. 
The events should all be out within a second. When it decides to dump the 
records for a single event, it all happens quickly.

-Steve

  reply	other threads:[~2006-05-22 14:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-22 12:35 Dispatcher - single line output (perl) Leigh Purdie
2006-05-22 14:22 ` Steve Grubb [this message]
2006-05-23  0:45   ` Leigh Purdie
2006-05-23 14:22     ` Steve Grubb
2006-05-24  1:26       ` Leigh Purdie
2006-05-24 12:41         ` Steve Grubb
2006-05-25  0:22           ` Leigh Purdie
2006-05-25 12:30             ` Steve Grubb
2006-05-25 13:52             ` Steve Grubb
2006-08-08  1:32               ` Leigh Purdie
2006-05-24 15:14         ` Valdis.Kletnieks
2006-05-25  0:26           ` Leigh Purdie

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=200605221022.41541.sgrubb@redhat.com \
    --to=sgrubb@redhat.com \
    --cc=intersect@gmail.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