LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-22-2005, 09:25 AM   #1
dman65
Member
 
Registered: Sep 2003
Posts: 61

Rep: Reputation: 15
Making a kernel change. Where do I begin?


I think I need to make a kernel change in order to meet some system requirements.

Basically, whenever someone accesses a file on one of my servers I need to log the user id, the file name, and the time the file was accessed. I am thinking that in order to do this I would need to update whatever part of the kernel updates the last access time associated with files. Of course, I would have to be careful and not write an entry for the actual file I am logging to since i assume that would create some sort of endless loop.

I also thought while I was at it, i might as well make a change that would write to a log file whenever a file is changed. It seems that this would make backing up a particularly large directory on that machine much easier since I wouldn't have to list every file in the directory and then get a stat() for it to see if it had been updated in the last hour. That is what I currently do and it takes 30 minutes just to query all of the files.

Can anyone tell me:

A) Whether or not something like this has already been done

B) If it hasn't, where would I begin to find the necessary information on how to do this.

Thanks for any assistance.

Darrell
 
Old 04-22-2005, 10:50 AM   #2
osvaldomarques
Member
 
Registered: Jul 2004
Location: Rio de Janeiro - Brazil
Distribution: Conectiva 10 - Conectiva 8 - Slackware 9 - starting with LFS
Posts: 519

Rep: Reputation: 34
Hi Darrell,

I think what you want is inotify. I have no experience with it, but the docs suggest it is highly configurable.

Regards,

Osvaldo.
 
Old 04-22-2005, 02:26 PM   #3
dman65
Member
 
Registered: Sep 2003
Posts: 61

Original Poster
Rep: Reputation: 15
Thanks Osvaldo,

It looks like this would definitely work for my backup requirements. Unfortunately, it doesn't really address creating a file access log since the function doesn't seem to report any information about the user who is causing the event.

I am really kind of surprised that Linux does not have a native logging function that records user's file access. I have always heard how secure Linux was, but it doesn't have this basic requirement. HIPAA regulations in the US require that any access to files containing electronic protected health information be logged so Linux would not even meet this basic requirement.
 
Old 04-22-2005, 02:26 PM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
fam the File Alteration Monitor?
 
Old 04-22-2005, 02:40 PM   #5
dman65
Member
 
Registered: Sep 2003
Posts: 61

Original Poster
Rep: Reputation: 15
I took a look at FAM, but I couldn't see in the documentation that is returns the user name or user id of who actually opened or created a file, only that the file was opened or created.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Restart after making a change with YaST ? cwolf78 Linux - General 2 05-08-2005 10:57 AM
Making MTU change permanent Firestarter75 Mandriva 2 02-16-2005 06:20 PM
Making users change passwords on first login linuxpyro Linux - Security 1 12-24-2004 01:28 PM
rmmod - making the change permanent? DiBosco Linux - General 0 06-20-2004 05:32 AM
Making a shortcut to GAIM: How do I change the icon? killswitch1968 Linux - Newbie 1 03-11-2004 03:22 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration