[1] | 1 | Documentation for sh_mounts, the samhain "Mounts" module.
|
---|
| 2 | ---------------------------------------------------------
|
---|
| 3 | sh_mounts implements functionality we had in a policy-checking Perl script we
|
---|
| 4 | have here at eircom; basically, all it does is ensure that certain mounts are
|
---|
| 5 | there (for example, /, /tmp, /var, /usr, /home) and that certain options are
|
---|
| 6 | specified on those mounts (for example noexec,nosuid on /tmp).
|
---|
| 7 |
|
---|
| 8 | All quite simple. It wouldn't be too hard to extend this module somewhat, to
|
---|
| 9 | report any NFS mounts found, for example, or to test that _only_ the mounts
|
---|
| 10 | specified are mounted on the machine.
|
---|
| 11 |
|
---|
| 12 | Here's a bit for the manual:
|
---|
| 13 |
|
---|
| 14 | <Begin manual entry>
|
---|
| 15 |
|
---|
| 16 | Checking mounted filesystem policies
|
---|
| 17 | ------------------------------------
|
---|
| 18 | samhain can be compiled to check if certain filesystems are mounted, and if they
|
---|
| 19 | are mounted with the appropriate options. This module currently supports Linux,
|
---|
| 20 | Solaris and FreeBSD. The configuration of the module is done in the Mounts
|
---|
| 21 | section of the configuration file:
|
---|
| 22 |
|
---|
| 23 | -------->8---------
|
---|
| 24 |
|
---|
| 25 | [Mounts]
|
---|
| 26 | #
|
---|
| 27 | # Activate (0 is off).
|
---|
| 28 | #
|
---|
| 29 | MountCheckActive=1
|
---|
| 30 |
|
---|
| 31 | #
|
---|
| 32 | # Interval between checks.
|
---|
| 33 | #
|
---|
| 34 | MountCheckInterval=7200
|
---|
| 35 |
|
---|
| 36 | #
|
---|
| 37 | # Logging severities. We have two checks: to see if a mount is there, and to
|
---|
| 38 | # see if it is mounted with the correct options.
|
---|
| 39 | #
|
---|
| 40 | SeverityMountMissing=warn
|
---|
| 41 | SeverityOptionMissing=warn
|
---|
| 42 |
|
---|
| 43 | #
|
---|
| 44 | # Mounts to check for, followed by lists of options to check on them.
|
---|
| 45 | #
|
---|
| 46 | checkmount=/
|
---|
| 47 | checkmount=/var
|
---|
| 48 | checkmount=/usr
|
---|
| 49 | checkmount=/tmp noexec,nosuid,nodev
|
---|
| 50 | checkmount=/home noexec,nosuid,nodev
|
---|
| 51 |
|
---|
| 52 | -------->8---------
|
---|
| 53 |
|
---|
| 54 | <End manual entry>
|
---|
| 55 |
|
---|
| 56 | The module is enabled as part of the compilation of samhain by specifying
|
---|
| 57 | --enable-mounts-check
|
---|
| 58 |
|
---|
| 59 | This module by the eircom.net Computer Incident Response Team
|
---|