"Read your log files. Internalize this!" Some were told this and some fewer do it. And how brilliant is this, to have a file /var/log/security just ready to read.
How cool is this! No security issues on mybox since I set up the box. FreeBSD is likely the most secure OS on earth.
Now getting nosy how this all works I look up /etc/syslog.conf
Again cool! Really all security events should be collected in a single file. So I start reading syslog.conf()
Exploring openlog() one can read
Hmm, ok? Just an example for programmers. Not much more can be read in syslog(). Unfortunately I do not run Ipfw, but Packet Filter. Doesn’t it contribute to Syslog?
Ok, let’s look what we find in The Book of PF (Hansteen, 2007):
So what is the purpose of the file/var/log/security?
It does show that syslogd can create logging entries from its security facility and with the creation and its first entry it documented that it is functional. Hey! This is so cool. Did you ever expect this when reading /var/log/security and realizing that its size stays relaxing unchanged?
But wait! I could be terribly wrong and there are important sensors that could actually feed /var/log/security in a tremendous helpfully way? But luckily they never were triggered?
But how do I know what they are?
Code:
# ls -l /var/log/security
-rw------- 1 root wheel 63 27 Apr 01:11 security
# cat /var/log/security
Apr 27 01:11:54 mybox newsyslog[564]: logfile first created
Now getting nosy how this all works I look up /etc/syslog.conf
Code:
# grep security /etc/syslog.conf
security.* /var/log/security
Code:
# man syslog.conf | grep -B1 -A2 security
The facility describes the part of the system generating the message, and is one of the following keywords:
auth, authpriv, console, cron, daemon, ftp, kern, lpr, mail, mark, news, ntp, security, syslog, user, uucp, and local0 through local7. These keywords (with the exception of mark) correspond to similar ``LOG_'' values specified to the openlog(3) and syslog(3) library routines.
--
# Log all security messages to a separate file.
security.* /var/log/security
Code:
# man openlog | grep SECURITY
LOG_SECURITY Security subsystems, such as ipfw(4).
Ok, let’s look what we find in The Book of PF (Hansteen, 2007):
There logging ends in a info file, not security. A matter of taste?On FreeBSD and NetBSD, you change the pflog_logfile= line in rc.conf
in a similar way, so it ends up looking like this:
pflog_logfile="/dev/null"
Setting up your syslogd to process the data is straightforward: Choose your
log facility, log level, and action2 and put the resulting line in your /etc/syslog
.conf file. Assuming you have already set up the system logger at loghost
.example.com to receive your data and chosen log facility local2 with log level
info, the correct line is
local2.info @loghost.example.com
So what is the purpose of the file/var/log/security?
It does show that syslogd can create logging entries from its security facility and with the creation and its first entry it documented that it is functional. Hey! This is so cool. Did you ever expect this when reading /var/log/security and realizing that its size stays relaxing unchanged?
But wait! I could be terribly wrong and there are important sensors that could actually feed /var/log/security in a tremendous helpfully way? But luckily they never were triggered?
But how do I know what they are?