From: Steve Grubb <sgrubb@redhat.com>
To: "Gulland, Scott A" <scott.gulland@hpe.com>
Cc: "linux-audit@redhat.com" <linux-audit@redhat.com>
Subject: Re: Use case not covered by the audit library?
Date: Wed, 06 Jan 2016 11:28:36 -0500 [thread overview]
Message-ID: <2812121.l6i04u8maX@x2> (raw)
In-Reply-To: <B41870ED03633F4092CDF476119204DF561D06FE@G9W0758.americas.hpqcorp.net>
On Tuesday, January 05, 2016 09:59:25 PM Gulland, Scott A wrote:
> > -----Original Message-----
> > From: Steve Grubb [mailto:sgrubb@redhat.com]
> > Sent: Thursday, December 17, 2015 6:51 PM
> >
> > > > My problem is I don't know what the proper set of "keys" are and the
> > > > values they should contain. If my assumptions are correct, is there
> > > > any documentation on on the key-value pairs and how to format the
> > > > contents of the message parameter? Based on what I've seen in the
> > > > audit log file, I would add "acct=<user>" to the contents of the
> > > > message to reflect the particular authenticated user who issued the
> > > > REST
> >
> > API call.
> >
> > > Well, Steve has published these as a starting point. I'm sure he'll
> > > chime in when he sees your message.
> > >
> > > http://people.redhat.com/sgrubb/audit/audit-events.txt
> > > http://people.redhat.com/sgrubb/audit/audit-parse.txt
> >
> > Thanks for pointing these out, Richard.
> >
> > The basic guidance for AUDIT_USYS_CONFIG is to record old and new values.
> > Typically old values are prefixed with 'old-' and new values are the name
> > of the field with no prefix.
> >
> > Any field that the user could influence the value has to be handled in
> > such a way as to not allow them to trick the parser if they are
> > malicious. For the most part, we hex encode those fields and then write
> > some code to label the fields as encoded so that interpretation can be
> > done later.
> >
> > Since your field names may not be official names in the audit system, you
> > may have to filter illegal characters the user sent during event
> > construction and fill in spaces with an underscore or dash.
>
> Thanks for the feedback and information. It has been very helpful. I've
> done some testing using a "val" and "old-val" field names with data values
> encoded by audit_encode_nv_string(...). However, when I try to display the
> event with "ausearch --interpret ..." neither field's data is decoded back
> into asci text.
It has to be a field name that auparse expects to be encoded.
> So I plan on using the "op", "data" and "euid" fields.
euid would be a kernel originating field name. User space could lie about it.
The kernel is the only thing that knows the truth.
> Only the data field needs to encoded and ausearch does decode this field
> correctly. My message text would look like:
>
> "op=<op text> data=<encoded data> euid=<uid>"
>
> When I was using ausearch I expected to be able to find events by uid using
> either the "-ua" or "-ue" option that would match the euid field's value,
but no matching events were found. Is this expected behavior?
What is the record type? ausearch is optimized to expect certain record types
to have fields in a specific order.
> The "-I" option did correctly convert the euid into the user name.
Interpreting and searching are different areas of the code base and are
independent. Interpreting is done after searching. No need to interpret fields
that will never be output.
-Steve
next prev parent reply other threads:[~2016-01-06 16:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-15 5:13 Use case not covered by the audit library? Gulland, Scott A
2015-12-16 14:22 ` Steve Grubb
2015-12-16 19:55 ` Burn Alting
2015-12-17 4:53 ` Gulland, Scott A
2015-12-17 4:21 ` Gulland, Scott A
2015-12-17 6:10 ` Richard Guy Briggs
2015-12-18 2:51 ` Steve Grubb
2016-01-05 21:59 ` Gulland, Scott A
2016-01-06 16:28 ` Steve Grubb [this message]
2016-01-06 18:03 ` Gulland, Scott A
2016-01-06 20:05 ` Steve Grubb
2016-01-06 20:27 ` Gulland, Scott A
2016-01-11 21:12 ` Steve Grubb
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=2812121.l6i04u8maX@x2 \
--to=sgrubb@redhat.com \
--cc=linux-audit@redhat.com \
--cc=scott.gulland@hpe.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;
as well as URLs for NNTP newsgroup(s).