LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-28-2008, 01:36 PM   #1
PlatinumX
Member
 
Registered: May 2008
Location: France
Distribution: Debian / Fedora / Gentoo
Posts: 178

Rep: Reputation: 15
Question Protecting my HIDS databases


Hi all,

I am experiencing a classic problem with HIDS.
I am using this tool to detect any malicious modification of my filesystem.

However, if an attacker can modify the filesystem, he can also modify my HIDS database.

I am looking for a solution to protect my database from corruption.

I thought of storing them on another PC having a read-only NFS share.
But is not it going to downgrade the performance of the HIDS ?

Other ideas ?
I precise, the server does not have any CD/DVD reader.

Thanks
 
Old 05-28-2008, 01:46 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by PlatinumX View Post
I am experiencing a classic problem with HIDS.
I am using this tool to detect any malicious modification of my filesystem.

However, if an attacker can modify the filesystem, he can also modify my HIDS database.

I am looking for a solution to protect my database from corruption.

I thought of storing them on another PC having a read-only NFS share.
But is not it going to downgrade the performance of the HIDS ?

Other ideas ?
I precise, the server does not have any CD/DVD reader.
Well, encryption and digital signatures are the most common method for protecting databases which reside on the filesystem the HIDS is monitoring. That said, you are already aware that using read-only media anyway is a really good idea. How big is your database file? Can you put it on a floppy disk? Using a read-only network share for the database shouldn't affect performance in most cases. Just make sure you get a notification from the HIDS if it can't access the share.
 
Old 05-28-2008, 01:50 PM   #3
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
You may be interested in the discussion on this recent aide thread.

Quote:
Originally Posted by PlatinumX
But is not it going to downgrade the performance of the HIDS ?
One way to find out for sure: test it. What sort of performance do you need for the HIDS anyway? How often are you running integrity checks?
 
Old 05-28-2008, 03:23 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Not a perfect solution, but could you create a cdrom image file and mount that. The iso6990 filesystem itself is read only. You could create an md5sum of the image and store that offline.

Last edited by jschiwal; 05-28-2008 at 03:29 PM.
 
Old 05-28-2008, 06:25 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by anomie View Post
You may be interested in the discussion on this recent aide thread
.
Please note that thread was based on specific requirements wrt Aide (a passive file integrity checker). Like Samhain Aide can understand the server-client paradigm (with the aid of a third party app), but the *real* difference is Samhain can be used as active file integrity checker, can test conditions Aide can't and can obscure and verify its own config and database.


Quote:
Originally Posted by jschiwal View Post
Not a perfect solution, but could you create a cdrom image file and mount that. The iso6990 filesystem itself is read only. You could create an md5sum of the image and store that offline.
If you ever did a 'mkisofs' of a directory of readable files and then 'cat -v'ed the ISO you'd seen all the plaintext is there, meaning it wouldn't need much to edit it OTF, IMHO. If you keep )a copy of) the database on the localhost I'd encrypt it instead.
 
Old 05-29-2008, 04:09 AM   #6
PlatinumX
Member
 
Registered: May 2008
Location: France
Distribution: Debian / Fedora / Gentoo
Posts: 178

Original Poster
Rep: Reputation: 15
Question

About NFS, yes I can try.
My only problem is that i have to "sell" this solution to the IT manager. I would like to have roughly an idea of ther performance, if not, this solution will be rejected straight !

About encrypting the database, I imagine that the HIDS is hosting a secret (a passphrase). This secret is used to perform symetric encryption of the database.
I have the feeling that the problem is only switched to the management of the secret.

An attacker who can corrupt a file, can corrupt the database, and so can read root read-only file hosting the secret.

Am I wrong ?

Thanks
 
Old 05-29-2008, 06:02 AM   #7
slimm609
Member
 
Registered: May 2007
Location: Chas, SC
Distribution: slackware, gentoo, fedora, LFS, sidewinder G2, solaris, FreeBSD, RHEL, SUSE, Backtrack
Posts: 430

Rep: Reputation: 67
What are you using for HIDS

if you are using something like tripwire it uses signed and encrypted databases and and time you recreate the database the is a password that must be used.

The people that write the HIDS know security pretty well.

Also you are not the first person to think of the fact that someone could modify the database so most HIDS have that protection built-in. It just depends on what type of HIDS you are running

if you really want to go crazy look at grsecurity. You can install it and create a policy to hide files at a kernel level.

Last edited by slimm609; 05-29-2008 at 06:04 AM.
 
Old 05-29-2008, 09:07 AM   #8
PlatinumX
Member
 
Registered: May 2008
Location: France
Distribution: Debian / Fedora / Gentoo
Posts: 178

Original Poster
Rep: Reputation: 15
It is not about getting crazy, it is about being coherent: if one reach the root level and can alter the filesystem, he can also read a file hosting a secret, no ?
 
Old 05-29-2008, 09:42 AM   #9
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
On the aide thread I pointed you to I was specifically referring to the chattr + lcap approach. That doesn't address your needs?
 
Old 05-29-2008, 11:25 AM   #10
slimm609
Member
 
Registered: May 2007
Location: Chas, SC
Distribution: slackware, gentoo, fedora, LFS, sidewinder G2, solaris, FreeBSD, RHEL, SUSE, Backtrack
Posts: 430

Rep: Reputation: 67
With grsecurity with the policy enforced root cannot even see the hidden files. They are locked by the kernel and the policy states what can and cannot access the files. You can hide the passwd file from bash but allow the useradd/del/mod or passwd program to see it. If the program does not need access to the file then it wont get access. You can even restrict what capabilities a program can use. If a program doesnt need network capabilites then they are restrict from using sockets. The policy is hidden and locked from the system and you can restrict what root can do. If you want you can make it so root can't even delete files from his home dir. It uses a MAC (mandatory access control) policy. Grsecurity can block about 99% of buffer overflows, return-to-c attacks, and most other vulns. The Grsecurity team are the ones who create ASLR (address space layout randonization) AKA PAX which is used by almost every major distro there is. But it is only a small portion of grsecurity.

Fedora, red hat, suse, centos, ubuntu, debian and most others all use PAX. Slackware is the only major distro that i know of that does not.

So getting root of a MAC system is alot harder than on a non-MAC system. Grsecurity is similar to SELinux but adds alot of extra kernel protections including memory protection, chroot restrictions, burst log restrictions, and tcp/udp restrictions.

On most of the systems i deploy with GRSecuity root is just a user. Grsecurity adds another admin account that is restricted only by the kernel. The new admin account is not a user account on the system like root. It is a part of grsecurity and this users cannot be logged into by any remote application. (ie. ssh, telnet, ftp, gnome, kde) you have to take the role of the admin from whichever account you set to allow role transitions.

Last edited by slimm609; 05-29-2008 at 11:29 AM.
 
  


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
protecting files andystanfordjason Linux - Security 3 12-31-2006 11:29 AM
sendmail and NIS databases (aliases, mail.aliases) - what kind of databases? cotton213 Linux - Software 0 03-14-2006 05:57 PM
Protecting M$ from viruses? z9_87 General 10 08-12-2005 08:43 AM
is slackware protecting me? shanenin Slackware 1 10-19-2003 09:28 AM
password protecting two files to two different databases on Apache? RKris Linux - Software 0 02-24-2003 06:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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