NabouConfig
NAME
NAMEnabourc - description of the nabou IDS config file format CONFIGURATIONNabou uses a config file format similar to the well known apache-configuration format. Lines starting with a # and empty lines will be ignored. Additional, you can place a comment after an option, i.e.: useshadow 1 # we are using shadow support You can comment out large blocks using a C-style comment: /* passwd /etc/passwd shadow /etc/shadow shells /etc/shells */ The configuration is devided into several sections. There are some main-options and some blocks for a special purpose. Most of the options are simply switches, where a value of 1 turns it on and 0 turns it off. If you omit an option then this has the same effect as setting it to 0 (zero). You can omit an option if nabou provides a buildin default value, which described for every option. MAIN OPTIONS
DATABASE BLOCK OPTIONSThe db block starts with <db>
basedir /home/thomas/nabou/db
cipher IDEA
sign 1
</db>
The following attributes are supported:
KEY BLOCK OPTIONSThe RSA key block starts with " These two keys (the PUBLIC and the PRIVATE key) needs to be created with
nabou --genkey.
The mail block starts with The mailblock is required if you turned usemail on.
The following attributes must exist:
the receipient of the report email.
optional, one or more addresses(comma-separated) of
persons who will receive a carbon copy of
the email reports.
the sender address of the email.
the subject of the email.
optional, it contains an email-address, which
will be used for sending out alert-mails if something
weird has happened with nabou or one of it's databases.
The binary block starts with the location of the program sendmail, which
is used to mail the report and only required
if you turn on usemail.
the location of the program crontab, which
is used to check user crontabs and only
required if you turn on check_cron.
the location of the program lsof, which is used
to check for listening tcp/udp ports on your
system.
the location of the program who which is used
to get informations who is executing nabou in
case of a potentially violation, which will be
mailed to as an aler mail to the administrator.
The suidblock starts with The suid block defines what attributes should be checked for
suid sgid files. If there is no suid block configuration or
if the suid block contains no appropriate attributes, then
nabou will use defaults, which is MD5 check and file-mode
check. You can use all chk_* attributes described below in
the directory block. You can set chk_all to 1 if you want
to perform all available checks.
The suid block does not support the inherit and recursive
attributes, but exclude and include are supported. An example:
See the description on the exclude and include options in the
section DIRECTORY BLOCKS below. But please note, that includes
or excludes within a suid block are matching recursive, that
means, if you specify a directory to exclude, then all files
and directories within that directory are also ignored. Wildcards
are supported anyway.
Finaly, the directory blocks. These are the most important
things in the configuration. Each directory block defines
various options for one directory. Thus , you are able to
define different attributes to be checked for each directory.
In general, a directory block stars with:
and ends with
>
You may define as many directory blocks as you need.
Previous versions of nabou had some predefined default
checks turned on in case your directory block looked like this one:
Today it will not do any checks on a dir unless you tell it
what to check. it is also possible to define "recursive 1" and nothing
more, then it will tell you about added or removed files recursively
under that dir, but it will not do any check on any file.
These are the options you may define:
If turned on, then nabou will also check all
files in subdirectories under that directory.
The default is 0(off).
you may specify a filename which nabou shall
ignore. You may specify multiple exclude lines
one for one file. You may use shell-wildcards
for filenames. An example:
If you want to ignore files under a subdirectory,
then you are required to specify this file/dir
relative to the directoy block. An example:
In the example below, /usr/local/share/blackbox/*
will be ignored.
The exclude attribute cannot used together
with the include attriute (see above).
If you need more than a few files to be excluded
you might consider using an exclude block as the
better way of doing such. An example:
You may specify one or more include lines.
If an include attribute occurs within a directory
block (or more than one), then nabou will only
look for the file(s) specified by include. It
will ignore all other files under that directory!
You cannot use shell-wildcards with the include-
attribute! An example:
The include attribute cannot be used together
with the exclude attribute.
The include statement does not a block notation as
the exclude statement does!
A percent value, the default is 10%. This will only
be used if you turn check_diskusage on. nabou will
print a message if the diskusage of a monitored
directory decreases under the specified minimum
percentage.
Excluded files will not counted.
If you use one or more include statements, then only
the diskusage of these files will be counted.
A percent value too, like the one above. You will
get a message if the diskusage of a monitored
directory increases over the specified maximum
percentage.
This is a very special attribute. It takes a
directory name as argument, which must be defined
as a directory block somewhere in the configuration.
It causes the directory to inherit all attributes
defined from the specified directory block. Please
note, that you cannot specify additional attributes
if you are using inherit, because all attributes
are used from the inheritted block! An example:
In this example, nabou will do an md5-checksum
lookup and do a recursive lookup for the directory
/sbin.
If the inherit attribute refers to a directory,
which is not defined within the configuration, then
nabou will warn you about this and use the default
attributes chk_md5=1 and recursive=0.
You can specify one or more file attributes nabou shall look for:
this option exists for backward compatibility. See
chk_hash.
check for changes on checksums. It does hash digest checksum
testing depending on your use_algo setting.
check for changes on the file size.
check for file size shrink.
check for file size grow.
check for changes of the modification time.
check if owner of the files has changed.
check if group of the files has changed.
check if the number of links to a file has
changed.
check if the mode of files has changed.
check if the filesystem inode has changed.
The attributes above will be used, if you turn on chk_all!
The followng attributes can also be checked:
the device number of the filesystem
inode change time
the number of blocks allocated on a filesystem.
see the section CUSTOM SCRIPTLETS below!
The following file attributes cannot be checked with nabou:
access time: that's senceless, because, the accesstime changes
when nabou calls stat(2) on a file! And the attributes rdev
and blcksize. See stat? for details or look
at the file dbformat.txt shipped with the nabou tarball.
If you need to define many different files/directories in your
config you will soon find it boring to write a complete directory
block for each single directory/file.
For that reason a new feature exists, which allows you to define
check templates. Once you have defined such a template you can
apply it to many directories/files within one check block.
DEFINE BLOCKS
Sample:
This defines a new check template called chk_logfile (you can
choose any name you like). This particular template is used to check
mode/uid/gid bits and to check if a file shrinks, which is generally
not good with logfiles.
You are allowed to use any possible check statement and option which
is available for directory blocks too.
One thing is important: if you want to use the exclude or include
statement inside a define block, then you must specify the absolute
pathname, relative pathnames are not allowed (or: they will not work as
you expect!) inside define blocks.
CHECK BLOCKS
Now that we have defined our own check template, we want to apply it
to some file within one block:
That's it.
There is a very special and useful parameter which allows you
include another file:
< nabou reads its contents on this position as if is was written
overthere. An example:
If you run nabou in multiple instances, say one checks only for
suid files once a week and another one checks only for files
every day, but both instances shall to use identical mailoptions,
you can use the construction above.
Nabou does not follow symlinks (at the moment, this may change
in a future release), because of some program's tendencies to have
circular symlinks which will run you out of memory pretty fast.
And that's evil.
You can see a complete configuration example in the file nabourc
shipped with the nabou tarball.
|