<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>OpenBSD and FreeBSD resources &#187; Logs</title>
	<atom:link href="http://purebsd.com/tag/logs/feed" rel="self" type="application/rss+xml" />
	<link>http://purebsd.com</link>
	<description></description>
	<lastBuildDate>Tue, 01 Jun 2010 06:01:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Logcheck explained</title>
		<link>http://purebsd.com/logcheck-explained.html</link>
		<comments>http://purebsd.com/logcheck-explained.html#comments</comments>
		<pubDate>Tue, 01 Jun 2010 05:33:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Logs]]></category>

		<guid isPermaLink="false">http://purebsd.com/?p=57</guid>
		<description><![CDATA[Intro Logcheck is a program that helps you in sorting out the relevant messages from the various (system) log files on Unix systems. It sifts through them on a regular basis (via crontab) and sends its findings to the system administrator by mail. That mail contains all the possibly important events, break-in attemts and other [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Intro</strong></p>
<p>Logcheck is a program that helps you in sorting out the relevant messages from the various (system) log files on Unix systems. It sifts through them on a regular basis (via crontab) and sends its findings to the system administrator by mail. That mail contains all the possibly important events, break-in attemts and other strange messages.</p>
<p>It was created by Psionic Software (now merged with Cisco) and is confirmed to run on many of the most popular Unix systems, including OpenBSD.</p>
<p><strong>Download</strong></p>
<p>Since www.psionic.com isn&#8217;t providing the package anymore (because of the merger with Cisco), you can <a href="http://web.archive.org/web/20060313055310/http://www.purebsd.com/files/logcheck-1.1.1.tar.gz">download Logcheck</a> from PureBSD.</p>
<p>You can also install the port (or package) called &#8220;logsentry&#8221;. LogSentry and Logcheck are the same thing, but since Psionics merger with Cisco it lives on with a different name.</p>
<p>The port is located in <code>/usr/ports/security/logsentry</code>. The binary package has a name equal or similar to &#8220;logsentry-1.1.1p1.tgz&#8221; and can be found on any FTP site carrying OpenBSD.</p>
<p><strong>Installation</strong></p>
<p>By source:<br />
<code> cd /tmp<br />
tar xvfz /location/of/logcheck-1.1.1.tar.gz<br />
cd logcheck-1.1.1<br />
make generic<br />
</code><br />
By port:<br />
<code> cd /usr/ports/security/logsentry<br />
make<br />
make install<br />
</code><br />
By binary package:<br />
<code> pkg_add logsentry-1.1.1p1.tgz<br />
</code><br />
<strong>Configuration</strong></p>
<p>Make sure that /usr/local/etc/logcheck.sh is setup the way you prefer.</p>
<p>If you do not want to have root receive mail from Logcheck, but a local user or remote user, edit the SYSADMIN variable:</p>
<p><code> SYSADMIN=alexdehaas@puur.rookgordijn.nl<br />
</code><br />
All &#8220;$LOGTAIL&#8221; lines should be <strong>commented out</strong>, except the ones for the OpenBSD log files:</p>
<p><code> # Generic and Linux Slackware 3.x<br />
#$LOGTAIL /var/log/messages &gt; $TMPDIR/check.$$</p>
<p># OpenBSD 3.4<br />
$LOGTAIL /var/cron/log &gt; $TMPDIR/check.$$<br />
$LOGTAIL /var/log/authlog &gt;&gt; $TMPDIR/check.$$<br />
$LOGTAIL /var/log/daemon &gt;&gt; $TMPDIR/check.$$<br />
$LOGTAIL /var/log/maillog &gt;&gt; $TMPDIR/check.$$<br />
$LOGTAIL /var/log/messages &gt;&gt; $TMPDIR/check.$$<br />
$LOGTAIL /var/log/secure &gt;&gt; $TMPDIR/check.$$<br />
$LOGTAIL /var/log/wlanlog &gt;&gt; $TMPDIR/check.$$<br />
</code><br />
<strong>Running Logcheck</strong></p>
<p>Edit root&#8217;s crontab:<br />
<code><br />
crontab -e<br />
</code><br />
And add the following two lines:</p>
<p><code> # Security: Check every 30 minutes logfiles<br />
*/30 * * * * /usr/local/etc/logcheck.sh<br />
</code><br />
<strong>Filtering log messages</strong></p>
<p>If you do or do not wish to see certain log messages mailed to you, you can edit the<code>logcheck.[hacking,ignore,violations,violations.ignore]</code> files located in<code>/usr/local/etc</code>. All lines in those files are patterns in the regular expression format used by<code>grep</code>.</p>
<ul>
<li><code>logcheck.hacking</code>:<br />
This file contains lines which consist of patterns indicating an active system attack. You can add your own patterns to it when deemed necessary.</li>
<li><code>logcheck.violations</code>:<br />
This file contains lines with patterns indicating some sort of negative system activity. You can add your own patterns to it when deemed necessary.</li>
<li><code>logcheck.violations.ignore</code>:<br />
Lines of patterns in this file are used to filter out log messages that<code>logcheck.violations</code> picks up as being negative system events. In other words: the more specific pattern lines in <code>logcheck.violations.ignore</code> override the more generic pattern lines in <code>logcheck.violations</code>.</p>
<p>You can add your own exceptions to it. Examples:</p>
<p><code> sendmail.*: .*: Authentication-Warning: .*: .* owned process doing -bs<br />
sm-mta.*: ruleset=check_relay, .* reject=.* .*<br />
</code></li>
<li><code>logcheck.ignore</code>:<br />
This file contains lines with keywords indicating that a message should not be reported. Normally, all log messages are reported as &#8220;unusual system activity&#8221;, so you won&#8217;t miss anything not accounted for in the other logcheck files. So this is a catch-all file.</p>
<p>You can add your own exceptions to it. Examples:</p>
<p><code> dhcpd: DHCPDISCOVER from .* via xl0<br />
dhcpd: DHCPREQUEST for 10.0.* from .* via xl0<br />
dhcpd: DHCPOFFER on 10.0.* to .* via xl0<br />
dhcpd: DHCPACK on 10.0.* to .* via xl0<br />
wlanmon: WLAN bridge connection is just fine\.<br />
syslogd: restart<br />
spamd.*: .*\..*\..*\..*: connected \(.*\)<br />
spamd.*: .*\..*\..*\..*: disconnected after .* seconds\.<br />
spamd.*: .*\..*\..*\..*: \&lt;.*\&gt; -\&gt; \&lt;.*\&gt;<br />
spamd.*: .*\..*\..*\..*: From: .* To: .*<br />
ftp-proxy.*: accepted connection from 10.0.0.*:.* to .*<br />
cvs.*: connect from .*.intranet.atomicvoid.net<br />
</code><br />
Now log messages matching any of the above lines are being ignored by Logcheck.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://purebsd.com/logcheck-explained.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

