LinuxQuestions.org
Visit Jeremy's Blog.
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 10-01-2007, 02:30 PM   #1
nikhil86
LQ Newbie
 
Registered: Apr 2007
Posts: 17

Rep: Reputation: 0
modifying the kernel to perform integrity checking on files


Hi!
I'm a computer engineering student from Mumbai, India.
As part of my last year's cirriculum, I have to do a small project with 2 of my friends.
My project topic is "System Authentication and Secure Application Loading on Linux"...its a file-integrity checker system, similar to Tripwire, only ours will be a much toned-down version...

Now, we've started with the Application authentication part first, as we feel it is easier.
The main idea here is this: whenever the filesystem searches for a file to open it, we want it to perform a small check on it. We want to perform a SHA hash on the file, and compare it against an already existing hash which we have stored in a small database.

We thought of using dbm instead of a full-fledged database at this stage in our project. Also, the database is supposed to contain only a token number of files; we're not authenticating all the files on the system..

We've been programming in C, and as of now, we have done the following:
Given any file as a command-line argument, a program computes a SHA and tests it against a dbm database. It returns a boolean as to whether the file is authentic or not, and makes a suitable syslog entry.
What we would like to know is, how can we modify the kernel source, so that whenever the file-system is about to open a file, it first calls our program; this way we have a means of knowing if a file is authentic or not before it actually executes.

I'm completely overwhelmed by the kernel source, as there are so many files and directories. Still i've found some files which could possibly be the right ones to modify. Please tell me if they are correct, and if not, which one is the file to modify?
/usr/src/linux-2.4.20-8/fs/open.c
/usr/src/linux-2.4.20-8/fs/read_write.c
/usr/src/linux-2.4.20-8/fs/filesystems.c

Please help.
Thank you,
Nikhil.
 
Old 10-01-2007, 09:13 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Moved to Programming. I'm leaving a permanent redirect here, though. Good luck!
 
Old 10-01-2007, 09:59 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,691
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
I'm not going to try to offer a complete answer here. Rather, I'd like to point you to the most-basic refuge of the engineering practitioner... research of the present state-of-the-art.

"How did Microsoft do it, when they engineered 'Authenticode?'"

"How did the United States Department of Defense do it, when they explored 'SELinux?'"

When you are a student, it is very easy to imagine that you are the first group of people who have ever considered a particular problem. (It is especially easy to think that way when you've just been given an important homework assignment!) But the simple reality is that ... you aren't.

... and that's the most important lesson of all!

No matter who you are, when you are, or where you are, you are not "the first!"

"Dictum Ne Agas: Do not do a thing already done."

A great deal of "original" research actually consists of discovering, and then assimilating and somehow 'making your own,' what has already 'been done.'

Google is a marvelous thing, indeed. (And, BTW, if you suppose that I am making a joke at your expense, you are mistaken. )

Last edited by sundialsvcs; 10-01-2007 at 10:00 PM.
 
Old 10-02-2007, 12:47 PM   #4
nikhil86
LQ Newbie
 
Registered: Apr 2007
Posts: 17

Original Poster
Rep: Reputation: 0
point noted.
i've already downloaded the latest kernel i could find, namely the 2.6.22.9.....I'll go through that first....
I'll post again later.....
Thanks for your help.
Nikhil.
 
Old 10-02-2007, 12:48 PM   #5
nikhil86
LQ Newbie
 
Registered: Apr 2007
Posts: 17

Original Poster
Rep: Reputation: 0
thank you also moderator
 
  


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
How to verify downloaded kernel integrity (with *.sign files?) lowpro2k3 Linux - General 7 06-28-2011 01:49 PM
file integrity checking software??? dsids Linux - Newbie 2 08-21-2006 07:49 AM
Software for Automatic Integrity Checking MoveZig Linux - Software 0 09-23-2005 09:14 AM
Checking integrity of a system gamehack Linux - Security 1 05-27-2004 03:26 PM
Checking cable integrity Worstje Linux - Networking 1 05-22-2004 05:47 PM

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

All times are GMT -5. The time now is 11:29 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