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(a)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