public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Steve Grubb <sgrubb@redhat.com>
To: linux-audit@redhat.com, burn@swtf.dyndns.org
Subject: Re: Are the writing of an events records to audit.log atomic should a log rotation occur
Date: Mon, 04 Feb 2013 14:32:18 -0500	[thread overview]
Message-ID: <23054651.VinVpYuuhG@x2> (raw)
In-Reply-To: <1359762689.3612.11.camel@swtf>

On Saturday, February 02, 2013 10:51:29 AM Burn Alting wrote:
> All,
> 
> When rotating log files due a USR1 signal being sent, or for any other
> reason, does auditd finish writing all the
> records that belong to the current event being written before starting
> the new log file?

When it catches SIGUSR1, it sets a flag that is read by the event loop. So, 
this serializes it with other events. It does write the record out before 
rotating.

> That is, will I find records belonging to a single event in two log
> files?

That is a different question and a different answer. Events can be composed of 
multiple records. It is possible for a record to be emitted and at that time a 
check of the disk space used or file size may cause a rotation or some other 
action.

> If this is the case, would there be problems if auditd was changed to
> wait and 'flush' all an event's records before
> rotating? 

Auditd just writes to disk. It does not try to determine if anything is 
pending because its in a race to dequeue as fast as possible before buffers fill 
up. Any re-assembly of records into an event is done by aureport and ausearch.

> One assumes auditd-event.c would need to be modified to be
> more event aware. Perhaps make use of AUDIT_EOE or
> other means of identifying the end of an event or a single event.

It might be helpful to describe the problem this is solving.

Thanks,
-Steve

  reply	other threads:[~2013-02-04 19:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-01 23:51 Are the writing of an events records to audit.log atomic should a log rotation occur Burn Alting
2013-02-04 19:32 ` Steve Grubb [this message]
2013-02-04 20:51   ` Burn Alting

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=23054651.VinVpYuuhG@x2 \
    --to=sgrubb@redhat.com \
    --cc=burn@swtf.dyndns.org \
    --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