store | blogs | forums | twitter | facebook | wiki | mailing lists | downloads | support portal
Atomic Secure Linux
It is currently Tue Jun 18, 2013 7:24 pm

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic Share/Bookmark  [ 5 posts ] 
Author Message
 Post subject: scan on modify
Unread postPosted: Sat Apr 21, 2012 7:22 pm 
Offline
Long Time Forum Regular
Long Time Forum Regular

Joined: Thu Dec 09, 2004 11:19 am
Posts: 1875
Not all of us can run the asl kernel on all our systems, which is a shame.

For those of us who can't, it would be nice if asl could scan files for malware "on modify", as per a certain competing product. This leverages the kernel's "inotify" support (apparently in RHEL kernels) to trigger a scan when a file has been modified.

Seems like a sensible thing at first glance, although I obviously don't know the details or performance hit, though I would assume you would limit scanning to /var/www/vhosts (on Plesk) and certain other sensitive areas.

_________________
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>


Top
 Profile  
 
 Post subject: Re: scan on modify
Unread postPosted: Mon Apr 23, 2012 9:35 am 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin

Joined: Wed Dec 31, 1969 8:00 pm
Posts: 7454
Location: earth
We started with pure inotify() early on, but found it too unreliable. Right now the most reliable solution Ive found is the dazuko module (deprecated by fanotify in newer kernels, which I havent tested yet).

The HIDS will also hook inotify for the integrity and diff checks. You could use that against the /var/www/vhosts directory now, and get the changes emailed to you in alerts.


Top
 Profile  
 
 Post subject: Re: scan on modify
Unread postPosted: Mon Apr 23, 2012 9:54 am 
Offline
Long Time Forum Regular
Long Time Forum Regular

Joined: Thu Dec 09, 2004 11:19 am
Posts: 1875
That's interesting. Thanks Scott.

What I'd like is to be able to scan using clamd whenever something changes as opposed to just being notified. Basically turn it into an on-change av scanner for non-ASL kernels, to get close to the on-access scanning that dazuko provides.

Of course a daily scan would be almost as good, and that's already available via ASL, so I guess we are almost there -- just not realtime.

_________________
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>


Top
 Profile  
 
 Post subject: Re: scan on modify
Unread postPosted: Sat Jun 30, 2012 3:56 pm 
Offline
Forum Regular
Forum Regular

Joined: Mon Oct 29, 2007 6:51 pm
Posts: 613
True, a lot of damage can be done in a day.


Top
 Profile  
 
 Post subject: Re: scan on modify
Unread postPosted: Sun Jul 01, 2012 4:35 pm 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3264
Location: Chantilly, VA
Realtime is tough to do without the kernel extensions, for example I wrote a stand along daemon to do this using inotify, but what I learned is that not only is inotify limited (you have to set the maximum number of objects to modify in the kernel, its got a default thats pretty low, so once you go over it no other objects are monitored), but that its reliability varies MASSIVELY from kernel to kernel. It was so unreliable I could just race condition it with malware, upload, block, upload, block, upload, not blocked. It was so inconsistent between the vanilla kernels that there wasnt even consistency repeating it, so sometimes it was clean, other times it wasnt. Seems dangerous to put out something that rested on such an unreliable (and unpredictably unreliable) foundation, we couldnt even say "kernel X is bad, kernel Y isnt), it was crazy inconsistent.

Which is why we instead decided we needed absolute positive control through the kernels access control system. The new fanotify stuff shows promise too, and that as well is all kernel level, so theres a compromise system in the works that may work with non-ASL kernel, but they will have to include the new mainline fanotify capabilities, but older kernels absolutely do not. So unfortunately, even though I know some people have put out inotify based clamav tools, they are totally unreliable, and thats the best tool for the job if you arent going to use something dazuko (or possibly the upcoming fanotify capabilities).

I'm wide open to ideas, but thats actually how we started, and it just didnt meet our reliability requirements (its a shame too, because I put in a LOT of work on the daemon).

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic Share/Bookmark  [ 5 posts ] 

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group