From: Steve Grubb <sgrubb@redhat.com>
To: linux-audit@redhat.com
Subject: Re: Best means of capturing audit changes to a certain filename under a path subtree? aka wildcard file watches
Date: Thu, 15 Sep 2011 13:21:07 -0400 [thread overview]
Message-ID: <201109151321.07714.sgrubb@redhat.com> (raw)
In-Reply-To: <robbat2-20110915T064406-803383887Z@orbis-terrarum.net>
On Thursday, September 15, 2011 03:03:06 AM Robin H. Johnson wrote:
> In the wake of the kernel.org attack, we're brushing up our security at
> Gentoo (I lead our infrastructure/IT team for Gentoo services). One of
> our self-identified weaknesses is auditing of changes to files used
> elsewhere in our automated verification processes.
>
> The audit subsystem gives a great general way to do this, but I can't
> identify how best to audit changes to a file when the entire path is not
> known ahead of time.
>
> It seems that it would best be accomplished with wildcards:
> /var/db/pkg/*/*/CONTENTS
There still is no wildcard support like that. There is auditing of a directory tree
which is like /var/* but not /var/*.log. The problem is that file access is on the
hotpath inside the kernel. Anything slowing it down will be frowned upon heavily. So,
what is done is roughly the equivalent of turning an absolute path into a hash and
then doing a hash compare. That is about all the clock cycles the kernel can spare
since we do not want a performance hit if it can be avoided.
That said, maybe selinux lables can help? If the CONTENTS files had a lable different
from other files (perhaps content_t), then you can write a rule something like:
-a always,exit -F dir=/var/db/pkg -F obj_type=content_t -k content
-Steve
prev parent reply other threads:[~2011-09-15 17:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-15 7:03 Best means of capturing audit changes to a certain filename under a path subtree? aka wildcard file watches Robin H. Johnson
2011-09-15 17:21 ` Steve Grubb [this message]
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=201109151321.07714.sgrubb@redhat.com \
--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