public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Steve Grubb <sgrubb@redhat.com>
To: Tyler Hicks <tyhicks@canonical.com>
Cc: wpreston@suse.com, seth.arnold@canonical.com, linux-audit@redhat.com
Subject: Re: [PATCH] userspace: audit: ausearch doesn't return entries for AppArmor events that exist in the log
Date: Fri, 30 May 2014 17:00:04 -0400	[thread overview]
Message-ID: <9810096.ghxOlbMYMG@x2> (raw)
In-Reply-To: <20140530201644.GA22335@boyd>


[-- Attachment #1.1: Type: text/plain, Size: 2938 bytes --]

On Friday, May 30, 2014 10:16:44 PM Tyler Hicks wrote:
> On 2014-05-30 15:53:49, Steve Grubb wrote:
> > On Wednesday, May 28, 2014 03:33:06 PM Tony Jones wrote:
> > > This patch came from our L3 department.  AppArmor LSM is logging using
> > > the
> > > common_lsm_audit() call but the audit userspace parsing code expects to
> > > see
> > > an SELinux tclass field. This patch doesn't address the lack of support
> > > for
> > > AppArmor in "aureport --avc".  Talking to Seth Arnold, Canonical
> > > apparently
> > > has patches for this; if this is true perhaps they can post for
> > > inclusion.
> > > 
> > > Based-on-work-by: William Preston <wpreston@suse.com>
> > > Signed-off-by: Tony Jones <tonyj@suse.de>
> > 
> > I was looking at this patch and was wondering something. Does AppArmor
> > produce AUDIT_AVC events?
> 
> It does. Here's an odd ball that I picked out of my audit log:

Uh-oh. I gave out the 1500 - 1599 block of events to App Armor so that this 
problem would never happen.

libaudit.h:
#define AUDIT_FIRST_SELINUX     1400
#define AUDIT_LAST_SELINUX      1499
#define AUDIT_FIRST_APPARMOR            1500
#define AUDIT_LAST_APPARMOR             1599

When you have an event of the same number, it has to have the same fields in 
the same order with same value representation. As you can see the reporting 
tools is sensitive to this because they are optimized to handle huge log files. 
Hmmm....


> type=AVC msg=audit(1400295012.391:11143): apparmor="DENIED"
> operation="mount" info="failed type match" profile="lxc-container-default"
> name="/sys/fs/cgroup/systemd/" pid=15761 comm="mount" fstype="cgroup"
> srcname="systemd" flags="rw, nosuid, nodev, noexec"
> > If not, how does the code even get into parse_avc? IOW, is
> > there another part of the patch missing in the switch statement that
> > direct AUDIT_APPARMOR_*  events into parse_avc?
> 
> As you can see above, they already flow through parse_avc().

This is a big mistake, IMHO. In theory, this is what should have happened:
 An access decisionl event should have been named in the 1500 block. It would 
then be free to include the field it needs in the order it needs. The ausearch 
would get a function parse_aa_decision. That function would stuff a struct 
specially tuned for AA usage. Aureport would gain a new report.


> I spent a little time today getting a patch together to parse the
> 'apparmor="DENIED" operation="mount"' portion parsed to fill
> an.avc_result and an.avc_perm.
> 
> It worked well with ausearch and aureport during some quick manual
> testing. I'd like to do some more testing next week and, hopefully, add
> some automated tests before I send it to the list.

Well...I wished it had been clear a long time ago that the 1500 block was free 
to do anything with for AA's needs so we don't overload the usage. Not sure 
what to do about this.

-Steve

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2014-05-30 21:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-28 22:33 [PATCH] userspace: audit: ausearch doesn't return entries for AppArmor events that exist in the log Tony Jones
2014-05-29  8:31 ` Tyler Hicks
2014-05-29 15:01   ` Steve Grubb
2014-05-29 15:15     ` Tyler Hicks
2014-06-03  1:00   ` Tony Jones
2014-06-03 14:47     ` Steve Grubb
2014-06-03 16:34       ` Tony Jones
2014-05-29 15:21 ` Tyler Hicks
2014-05-30 19:53 ` Steve Grubb
2014-05-30 20:16   ` Tyler Hicks
2014-05-30 21:00     ` Steve Grubb [this message]
2014-05-31  0:01       ` Tony Jones
2014-06-06 18:46       ` Tyler Hicks
2014-06-06 21:10         ` Tyler Hicks
2014-06-24  0:06           ` Tony Jones
2014-06-24 15:34             ` Eric Paris
  -- strict thread matches above, loose matches on Subject: below --
2016-04-29  7:03 Vincas Dargis
2016-04-29 13:39 ` Steve Grubb
2016-04-29 16:07   ` Vincas Dargis
2016-04-29 16:30     ` Steve Grubb
2016-05-02 21:18       ` Paul Moore
2016-04-29 15:41 ` Richard Guy Briggs
2016-04-29 16:58   ` Vincas Dargis

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=9810096.ghxOlbMYMG@x2 \
    --to=sgrubb@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=seth.arnold@canonical.com \
    --cc=tyhicks@canonical.com \
    --cc=wpreston@suse.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