From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Grubb Subject: Re: Question about setting watches in auto-mounted directories in RHEL 5.2 Date: Sun, 30 Nov 2008 09:15:52 -0500 Message-ID: <200811300915.52390.sgrubb@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: linux-audit@redhat.com Cc: Taylor_Tad@emc.com List-Id: linux-audit@redhat.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