From: John Dennis <jdennis@redhat.com>
To: Eric Paris <eparis@redhat.com>
Cc: linux-audit@redhat.com
Subject: Re: Kernel audit output is inconsistent, hard to parse
Date: Wed, 30 Jan 2008 12:43:51 -0500 [thread overview]
Message-ID: <47A0B757.3020606@redhat.com> (raw)
In-Reply-To: <1201710633.2801.21.camel@localhost.localdomain>
Eric Paris wrote:
> On Tue, 2008-01-29 at 17:56 -0500, John Dennis wrote:
> I'm certainly not going to argue this isn't problomatic. I believe that
> case #1 should go away. Maybe when I get back from Chile I'll get a
> chance to look at that. Some fields just aren't ever strings, so I
> don't see a need to waste time/space writing " around something I know
> is always an int. But if the field can be a string it should ALWAYS be
> either case 2 or 3.
I'm cool with not using quotes around everything, I very much see the
appeal in that. But if you do that then *all* strings have to be quoted
*and* you can't continue to use the current unquoted hexadecimal string
encoding (case 3), it's ambiguous, you can't determine if its a string
because the quotes would be missing. That means case 3 also must be
eliminated. All strings have to be enclosed in quotes and what appears
inside the quotes has to support encoding arbitrary bytes. FWIW
backslash quoting meets this requirement, as does many other encodings
in popular use.
> It "shouldn't" depend on the kernel version, but I'm sure it does. I'm
> going to work on eliminating case 1, which makes a lot of this mute.
Eliminating both case 1 and case 3 would be necessary to make it moot.
It would be a superb step forward and greatly appreciated.
> What approach would you like when I try to audit binary data? You want
> me to start adding \x before every byte? Forget it, waste of space.
Encoding binary data is solved problem. Some encodings are more
efficient than others, pick a standard encoding which satisfies your
requirements. The only key is that when the input stream shifts into and
out of encoded format it must be determinable only from the input
stream. It cannot rely on private version specific knowledge that
certain fields have this encoding.
> I don't want to waste time/effort having to write res="1" when I can
> just say res=1. I know you are complaining that you have to look at
> message type, field name, and kernel version. My opinion, you should
> just have to look at field name.
I shouldn't have to look at the field name, this violates basic parsing
rules and is tied to specific kernel versions, see first comment, there
is an easy solution.
> I've got no problems eliminating all of the %s in the code and making
> everything go through audit_log_string()
That would be a big step forward and would solve many of the problems,
thanks. Just be aware audit_log_string has to use a different encoding
other than bare hexadecimal.
> My take, if the field name is something that can be a string you either
> get field="string" or you get field=737472696e67. Either way its easy
> to recognize. Quotes means string, no quotes means hex.
How does the parser know the field can be a string? See above.
--
John Dennis <jdennis@redhat.com>
next prev parent reply other threads:[~2008-01-30 17:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-29 22:56 Kernel audit output is inconsistent, hard to parse John Dennis
2008-01-29 23:37 ` Miloslav Trmac
2008-01-30 1:15 ` John Dennis
2008-01-30 14:21 ` Steve Grubb
2008-01-30 15:34 ` Paul Moore
2008-01-30 16:01 ` Steve Grubb
2008-01-30 16:35 ` Paul Moore
2008-01-30 16:39 ` Eric Paris
2008-01-30 16:41 ` Eric Paris
2008-01-30 16:19 ` John Dennis
2008-01-30 14:26 ` Paul Moore
2008-01-30 16:30 ` Eric Paris
2008-01-30 17:43 ` John Dennis [this message]
2008-01-31 21:11 ` Linda Knippers
2008-01-31 21:21 ` Steve Grubb
2008-01-31 21:59 ` Paul Moore
2008-01-31 22:43 ` Casey Schaufler
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=47A0B757.3020606@redhat.com \
--to=jdennis@redhat.com \
--cc=eparis@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox