public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Steve Grubb <sgrubb@redhat.com>
To: linux-audit@redhat.com
Cc: Taylor_Tad@emc.com
Subject: Re: Question about setting watches in auto-mounted directories in RHEL 5.2
Date: Sun, 30 Nov 2008 09:15:52 -0500	[thread overview]
Message-ID: <200811300915.52390.sgrubb@redhat.com> (raw)
In-Reply-To: <CEF7DE8455A91D42A0435A42956403290BBB17D7@CORPUSMX40B.corp.emc.com>

Hi,

I was hoping one of the kernel people would have answered this or taken note 
on something that may need fixing...but they didn't.


On Friday 21 November 2008 11:59:46 Taylor_Tad@emc.com wrote:
> I'd like to set a file system watch so that any activity in an
> auto-mounted directory is audited.

You can't at this point in time. When the rule is loaded, it needs to resolve 
the path down to a device and inode. If the file system is not mounted, it 
cannot do this and the rule is rejected.


> It looks like just setting a watchon a parent directory isn't sufficient.  For
> example, if I have directory path  /dir1/dir2 and auto-mount something at
> /dir1/dir2/mount-dir, setting a file system watch on /dir1/dir2 doesn't
> detect activity in the auto-mounted subtree.

True.

> Looking at the auditctl man page, it looks like I'd have to issue a command
> like "/sbin/auditctl -q /dir1/dir2/mount-dir,/dir1/dir2" to tell the kernel
> to watch the newly mounted file system as well. 

Yes.


> Unfortunately, auto-mounts are, well, automatic, so there's no one to issue
> that command.

I haven't looked into hal scripting deeply, but there may be some chances 
there, but it might not be easy to figure out where to add the command.


> Am I missing a better way to accomplish this goal?  Is my understanding
> wrong?

Not that I know of. We talked about needing to do this 2 years ago when the 
file system audit code was being written, but they never addressed the problem. 
I'd really like to see this fixed somehow.

-Steve

  reply	other threads:[~2008-11-30 14:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-21 16:59 Question about setting watches in auto-mounted directories in RHEL 5.2 Taylor_Tad
2008-11-30 14:15 ` Steve Grubb [this message]
2008-11-30 15:11   ` Alexander Viro
2008-11-30 15:47     ` Steve Grubb
2008-11-30 17:17       ` Alexander Viro

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=200811300915.52390.sgrubb@redhat.com \
    --to=sgrubb@redhat.com \
    --cc=Taylor_Tad@emc.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