Log message authentication means verifying that a log message comes from an authoritative process and not from a fake.
With the syslog logging system, every process can inject log messages with an arbitrary name. Thus, malicious local users might craft log lines with arbitrary addresses to block, and inject them with the "sshd" identificator, simulating attacking activity from that address.
Log-based DoS protecting tools implicitly assume local users to be trusted. With log message authentication, you can safely use sshguard even on hosts where this assumption does not hold. This is possible because of sshguard's powerful yacc parser.
Log message authentication makes sense when sshguard is fed log messages from syslog or from syslog-ng. When sshguard works by polling logs directly from a raw file, you only need to adjust the log file permissions so that only root can write on it.
Log message authentication works this way:
You must give sshguard a pidfile for each service it is protecting. By default,
sshguard protects service ssh
(code 10). A table with known service codes may help you.
Associating a service with its process' pidfile is pretty easy (all pidfiles are typically located in the /var/run directory in UNIX):
# check service 10 (sshd) against pidfile /var/run/sshd.pid
sshguard -f 10:/var/run/sshd.pid
The -f
option can be used multiple times to configure different
services for authentication, e.g.:
# authenticate service 10 (sshd) and service 123 (mydaemon)
sshguard -f 10:/var/run/sshd.pid -f 123:/var/run/mydaemon.pid
Services that are not associated to a pidfile use a
default-allow
policy (all of their log messages are accepted by
default).
When a daemon restarts, its pid changes. Sshguard handles this events transparently without the admin intervention.