All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Guy Briggs <rgb@redhat.com>
To: Paul Moore <paul@paul-moore.com>
Cc: "linux-audit@redhat.com" <linux-audit@redhat.com>
Subject: Re: Linux audit performance impact
Date: Wed, 18 Feb 2015 17:32:25 -0500	[thread overview]
Message-ID: <20150218223225.GY29998@madcap2.tricolour.ca> (raw)
In-Reply-To: <CAHC9VhRo+oW29NfdvT9o5BiGSjEk=17VdFt9TmusD6xEof_ZYg@mail.gmail.com>

On 15/02/18, Paul Moore wrote:
> On Wed, Feb 18, 2015 at 4:13 PM, Richard Guy Briggs <rgb@redhat.com> wrote:
> > On 15/02/17, Viswanath, Logeswari P (MCOU OSTL) wrote:
> >> I agree that changing the formatting of the records could break the existing applications
> >> that consume them, and I didn't mean changing or eliminating of the formatting completely.
> >> We agree that formatting is required for logging the records(as buffers) into the log files.
> >> We are wondering if these records can be made available as RAW records so that the
> >> analytical programs which are capable of reading them for processing can perform better.
> >
> > There are tools that completely ignore any of the audit userspace suite
> > including libaudit, so changing the formatting in the kernel and
> > deferring to userspace to later do that formatting is not currently an
> > option.
> 
> It is if you take a versioned API approach where the kernel defaults
> to the current behavior and switches, per-socket/connection, at the
> request of userspace.  It's really the only way to have a graceful
> transition with audit.

Agreed.

> >> This option of RAW mode for the events can be an additional option
> >> where, kauditd delivers the audit buffer without formatting. Any
> >> comments on this?
> >
> > For a transition period if we were to consider it, it would mean
> > rewriting *all* places in the kernel that generate audit messages and
> > provide two paths switched on this RAW mode for each one of them, then
> > copying all that duplication to userspace libaudit.
> 
> Your comment is a little vague, so let me mention what I'm currently
> considering: we convert all of the in-kernel audit users away from
> generating strings in the context of the caller, instead having them
> record information in a native/struct/etc. format that would be later
> used by the kernel audit subsystem to generate the audit records (in
> whatever format(s) is(are) requested).  This actually has advantages
> beyond the record format work, it moves the issue of record formatting
> (always a problem) out of the caller and into audit itself which
> should hopefully prevent future audit abuses (a netlink attribute
> based record format would likely help further).

This approach seems good to me.

> > According to Linus' decree, it would need to remain that way until we
> > were certain that all tools including ones we don't know about had
> > switched over.
> 
> I would imagine a scenario where we introduced the new format in stages:
> 
> #1 - Move in-kernel audit record string generation completely into
> kernel/audit*.c.  Benefits everyone regardless of the audit format.

Ok.

> #2 - Introduce a versioned audit API.  The most difficult step for
> obvious reasons.

That infrastructure should already be in place.  We just converted over
the version field to a bitfield listing the availability of features.
An initial call can be made to find out if it is supported, then use the
feature switching bitfield to enable it.  We could alternately make a
different unicast socket available signalling its availability.

> #3 - Deprecate the old/existing audit record format, make it a Kconfig
> option that defaults to off and emit a warning when the old formatting
> is used.  This will be a year, and most likely more, after step #2.
> 
> #4 - Remove the old/existing audit record code.  Once again, this
> would happen a couple of years after step #3.

I suspect in practice stesp #3 and #4 could take a lot longer.

> However, nothing is really determined yet, this is just my current thinking.
> 
> paul moore

- RGB

--
Richard Guy Briggs <rbriggs@redhat.com>
Senior Software Engineer, Kernel Security, AMER ENG Base Operating Systems, Red Hat
Remote, Ottawa, Canada
Voice: +1.647.777.2635, Internal: (81) 32635, Alt: +1.613.693.0684x3545

  reply	other threads:[~2015-02-18 22:32 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12 16:09 Linux audit performance impact Viswanath, Logeswari P (MCOU OSTL)
2015-02-12 18:25 ` Richard Guy Briggs
2015-02-16 11:25   ` Viswanath, Logeswari P (MCOU OSTL)
2015-02-16 12:59     ` Steve Grubb
2015-02-17 13:10       ` Viswanath, Logeswari P (MCOU OSTL)
2015-02-17 13:25         ` Steve Grubb
2015-02-18 21:13         ` Richard Guy Briggs
2015-02-18 21:21           ` Satish Chandra Kilaru
2015-02-18 21:49           ` Paul Moore
2015-02-18 22:32             ` Richard Guy Briggs [this message]
2015-02-19  3:32               ` Paul Moore
2015-02-20 18:29             ` Casey Schaufler
2015-02-20 18:37               ` Ed Christiansen MS
2015-02-20 18:51                 ` Casey Schaufler
2015-02-20 21:25                 ` Paul Moore
2015-02-20 21:22               ` Paul Moore
2015-02-23 13:28                 ` Viswanath, Logeswari P (MCOU OSTL)
2015-02-16 17:32     ` Paul Moore
  -- strict thread matches above, loose matches on Subject: below --
2015-02-12 16:10 Viswanath, Logeswari P (MCOU OSTL)
2015-02-12 16:31 ` Paul Moore
2015-02-12 16:43 ` Viswanath, Logeswari P (MCOU OSTL)
2015-01-28 14:57 Viswanath, Logeswari P (MCOU OSTL)
2015-01-28 15:16 ` Steve Grubb
2015-01-28 15:52   ` Viswanath, Logeswari P (MCOU OSTL)
2015-01-29  2:59     ` Satish Chandra Kilaru
2015-01-29 13:29   ` Viswanath, Logeswari P (MCOU OSTL)
2015-01-28 15:18 ` Satish Chandra Kilaru
2015-01-28 15:53   ` Viswanath, Logeswari P (MCOU OSTL)
2015-01-29  3:39   ` Steve Grubb
2015-01-29  3:41     ` Satish Chandra Kilaru
2015-01-29  6:18       ` Viswanath, Logeswari P (MCOU OSTL)
2015-01-29  9:20       ` Viswanath, Logeswari P (MCOU OSTL)
2015-01-29 16:52         ` Richard Guy Briggs
2015-01-29 17:13           ` Satish Chandra Kilaru
2015-01-30 13:08             ` Viswanath, Logeswari P (MCOU OSTL)
2015-02-03 10:27           ` Viswanath, Logeswari P (MCOU OSTL)
2015-02-03 12:03             ` Satish Chandra Kilaru
2015-02-03 16:45               ` Richard Guy Briggs
2015-02-03 16:54                 ` Satish Chandra Kilaru
2015-02-03 17:02                   ` Richard Guy Briggs
2015-02-04  8:52                     ` Viswanath, Logeswari P (MCOU OSTL)
2015-02-04 16:15                       ` Richard Guy Briggs
2015-02-06  6:47                         ` Viswanath, Logeswari P (MCOU OSTL)
2015-02-11 16:51                           ` Richard Guy Briggs
2015-02-12 14:58                             ` Viswanath, Logeswari P (MCOU OSTL)
2015-02-13 14:15                               ` Satish Chandra Kilaru
2015-02-06 11:52                         ` Viswanath, Logeswari P (MCOU OSTL)
2015-02-11 14:16                         ` Viswanath, Logeswari P (MCOU OSTL)
2015-02-11 16:45                           ` Richard Guy Briggs

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=20150218223225.GY29998@madcap2.tricolour.ca \
    --to=rgb@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=paul@paul-moore.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.