Files and directory layout

WarningWARNING
 

samhain has its own set of trusted users. Paths to critical files (e.g. the configuration file) must be writeable by trusted users only. Failure to ensure this (e.g. by compiling in an appropriate set of trusted users) is one of the most frequent reasons for problems. See below for details.

Trusted users and trusted paths

If a path element is group writeable, all group members must be trusted. If the path to the configuration file itself is writeable by other users than root and the effective user these must be defined as trusted already at compile time.

NoteNOTE
 

The list of group members in /etc/group may be incomplete or even empty. samhain will check /etc/passwd (where each user has a GID field) in addition to /etc/group to find all members of a group.

Directory layout

samhain conforms to the FHS, which mandates a directory layout that is different from the default GNU layout (everything in subdirectories under /etc/local).

TipTIP
 

There is an option ./configure --enable-install-name=NAME. When this option is used, not only the executable is installed as NAME, but also in all the paths, samhain is replaced with NAME.

TipTIP
 

For the yule server, replace samhain with yule in the paths explained below.

The following table explains which directory layout results from ./configure --prefix=PREFIX

PREFIXsbindirmandirsysconfdirlocalstatedir
(none)/usr/local/sbin/usr/local/share/man/etc/var
USR/usr/sbin/usr/share/man/etc/var
OPT/opt/samhain/bin/opt/samhain/man/etc/opt/var/opt/samhain
other/other/sbin/other/share/man/other/etc/other/var

The file signature database will be written to localstatedir/lib/samhain/samhain_file, the pid file to localstatedir/run/samhain.pid, and the log file to localstatedir/log/samhain_log. In addition, yule writes an HTML status file to localstatedir/lib/yule/yule.html

To get a more fine-grained control on the layout, the following configure options are provided

Installed files

FileInstalled toPurposeMode
samhain.8mandir/man8/samhain.8Documentation600
samhainrc.5mandir/man5/samhainrc.5Documentation600
samhainrcsysconfdir/samhainrcConfiguration600
samhainsbindir/samhainExecutable700
yulercsysconfdir/yulercConfiguration600
(yule)sbindir/yuleExecutable700
(samhain_setpwd)sbindir/samhain_setpwdExecutable700
(samhain_stealth)sbindir/samhain_stealthExecutable700