From: Steve Grubb <sgrubb@redhat.com>
To: linux-audit@redhat.com
Subject: Re: audit rule problem
Date: Wed, 15 Nov 2017 12:16:33 -0500 [thread overview]
Message-ID: <1630988.KWtGsrzIPi@x2> (raw)
In-Reply-To: <479ba29c-7b23-1d55-281d-8f1a2a9c4582@magitekltd.com>
On Wednesday, November 15, 2017 12:06:31 PM EST LC Bruzenak wrote:
> On 11/14/2017 05:38 PM, LC Bruzenak wrote:
> > System:
> > Linux audit 2.6.32-696.3.2.el6.x86_64 #1 SMP Wed Jun 7 11:51:39 EDT
> > 2017 x86_64 x86_64 x86_64 GNU/Linux
> > userspace audit-2.4.5-3
> > Red Hat Enterprise Linux Client release 6.9 (Santiago)
> >
> > I changed this line in /etc/audit/audit.rules from:
> > -a exit,always -F arch=b64 -S mount -S umount2 -k mount
> > to this:
> > -a exit,always -F arch=b64 -S mount -S umount2 -F
> > subj_type!=nothing_t -k mount
> >
> > Reloaded my rules, and now doing (as root):
> > # umount /boot; mount /boot
> >
> > no longer produces audit events. I did this because on another system
> > (mls policy, with lots of custom types) I lost the events once I
> > included some custom types installed and operational on the system, so
> > I was just trying to reduce this to a reproducible case. I can almost
> > see that a non-existent type might fail, but it maybe should fail to
> > load.?.
>
> Ugh.
> Looks like the entire problem was a non-existent subject type; I had a
> typo in the mls policy case.
> So the rules accept a type which does not exist, does not warn, and then
> fails to report all events.
> That's my story and I'm sticking to it...
OK. That's something that can be checked. And I confirm this is the case.
[root@x2 ~]# auditctl -a always,exit -F arch=b64 -S open -F subj_type=doesnt_exist_t
[root@x2 ~]# echo $?
0
[root@x2 ~]# auditctl -l | grep doesnt_exist_t
-a always,exit -F arch=b64 -S open -F subj_type=doesnt_exist_t
[root@x2 ~]# auditctl -d always,exit -F arch=b64 -S open -F subj_type=doesnt_exist_t
That said, you can also write a rule with auid=40000 which would be an invalid
user. The kernel has no concept of what uids are valid. So, I expect we have
the same issue with policy. I don't know if the kernel can check if a type is
valid. Typically policy is compiled into numbers and that's what the kernel
understands.
-Steve
next prev parent reply other threads:[~2017-11-15 17:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-15 0:38 audit rule problem LC Bruzenak
2017-11-15 17:06 ` LC Bruzenak
2017-11-15 17:16 ` Steve Grubb [this message]
2017-11-15 17:20 ` LC Bruzenak
-- strict thread matches above, loose matches on Subject: below --
2007-07-17 14:05 Audit " Roger Holm
2007-07-19 13:17 ` Steve Grubb
2007-07-19 17:59 ` Valdis.Kletnieks
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=1630988.KWtGsrzIPi@x2 \
--to=sgrubb@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