Dazuko is a kernel module for FreeBSD and Linux letting an userspace
program monitor accesses to files and optionally deny access, for
implementing on-access virus scanning and other tasks. You can read more
at http://www.dazuko.org/
ruby-dazuko is a binding to the library that comes with Dazuko. A piece
of code like
Dazuko.register("MyApp", "r+") do |session|
session.include("/directory")
session.access_mask = Dazuko::ON_OPEN
session.run do |event|
if event.filename =~ /bad/ then false else true end
end
end
will deny all attempts to open files in /directory that contain "bad"
in their filename.
You can download the extension at
http://theinternetco.net/projects/ruby/dazuko-ruby
Have fun!
Ari
great stuff !
Also, for the uninitiated, could you please explain how does this
dazuko extension compare to the FAM one ?
FAM has ugly limits, and requires a daemon to do monitoring: You can't
monitor a deep structure of 100,000 files, for example, with FAM.
With Dazuko, your ruby program -is- the daemon, so things are pretty
tight.
Ari