<?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>Zen Dzign &#187; HIPPA</title>
	<atom:link href="http://www.zendzign.com/category/security/hippa/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zendzign.com</link>
	<description>The official ZZ Servers Blog - Visit http://www.zzservers.com for your business hosting needs.</description>
	<lastBuildDate>Tue, 03 Aug 2010 13:15:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Zabbix &amp; OSSEC: Open-Source compliance and security monitoring</title>
		<link>http://www.zendzign.com/2010/04/zabbix-ossec-open-source-compliance-and-security-monitoring/</link>
		<comments>http://www.zendzign.com/2010/04/zabbix-ossec-open-source-compliance-and-security-monitoring/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 14:11:53 +0000</pubDate>
		<dc:creator>David M. Zendzian</dc:creator>
				<category><![CDATA[HIPPA]]></category>
		<category><![CDATA[PCI]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://www.zendzign.com/?p=96</guid>
		<description><![CDATA[Good security, not just compliance requirements, encourages IT &#38; Security staff to spend time reviewing security events.  There are many tools available for many security components of your network; this article will focus on host security and host log monitoring using OSSEC and Zabbix. After having used many open and commercial  monitoring systems, we have [...]]]></description>
			<content:encoded><![CDATA[<p>Good security, not just compliance requirements, encourages IT &amp; Security staff to spend time reviewing security events.  There are many tools available for many security components of your network; this article will focus on host security and host log monitoring using <a title="OSSEC" href="http://www.ossec.net" target="_self">OSSEC</a> and <a title="Zabbix" href="http://www.zabbix.com" target="_self">Zabbix</a>.</p>
<p><span id="more-96"></span>After having used many open and commercial  monitoring systems, we have settled on <a title="Zabbix" href="http://www.zabbix.com" target="_self">Zabbix</a> because of it&#8217;s extensive features and expandability (especially with the new integrated <a title="API" href="http://www.zabbix.com/documentation/1.8/api" target="_self">API</a>).  That and it doesn&#8217;t hurt that it is well designed for expanded enterprises and is <a title="OpenSource" href="http://www.zabbix.com/licence.php" target="_self">OpenSource</a>.</p>
<p>This article was originally posted with details for Zabbix 1.6 and was updated on April 10 to reflect how to set it up under Zabbix 1.8.</p>
<p>OSSEC is a great tool provided by Trend Micro and is also an <a title="OpenSource" href="http://www.ossec.net/main/license/" target="_self">OpenSource</a> application. OSSEC provides a variety of tools for host based intrusion detection including:  log analysis, file integrity checking, policy monitoring, rootkit detection, real-time alerting and active response.  All of which support several <a title="compliance" href="http://www.ossec.net/ossec-docs/ossec-PCI-Solution.pdf" target="_self">compliance</a> and basic security requirements. OSSEC is deployed in a client-server model with all alerting and active response features being controlled and sent through the central server.</p>
<p>To integrate OSSEC and Zabbix we will be using the active-response feature of OSSEC integrated with zabbix_sender to send the active response alert to the zabbix server.   Configuring for this integration requires a simple script, a quick change to the ossec.conf and the creation of an OSSEC template in the zabbix system.</p>
<p>We will start with the OSSEC changes.  First, we will edit the OSSEC/etc/ossec.conf file, where OSSEC is the path to your OSSEC installation.  In this file you will need to add the following items:</p>
<blockquote><p>&lt;command&gt;<br />
&lt;name&gt;zabbix-alert&lt;/name&gt;<br />
&lt;executable&gt;zabbix-alert.sh&lt;/executable&gt;<br />
&lt;timeout_allowed&gt;no&lt;/timeout_allowed&gt;<br />
&lt;expect&gt;&lt;/expect&gt;<br />
&lt;/command&gt;</p>
<p>&lt;active-response&gt;<br />
&lt;disabled&gt;no&lt;/disabled&gt;<br />
&lt;command&gt;zabbix-alert&lt;/command&gt;<br />
&lt;location&gt;server&lt;/location&gt;<br />
&lt;level&gt;1&lt;/level&gt;<br />
&lt;/active-response&gt;<strong><br />
</strong></p></blockquote>
<p>The first &lt;command&gt; item defines the script we will be using for the zabbix-alert.  The &lt;active-response&gt; item defines when the system will use this script.  The defined configuration above has all alerts at and above level &#8220;1&#8243; sent to the zabbix-alert command.  This can be modified for higher levels or specific rules or rule groups.  More information on this configuration can be found in the OSSEC <a title="manual" href="http://www.ossec.net/main/manual/manual-active-responses/" target="_self">manual</a>.</p>
<p>Now the zabbix-alert.sh script needs to be put into the OSSEC/active-response/bin directory (be sure to watch for lines that are wrapped around but shouldn&#8217;t be).  You can download the script here: <a href="http://www.zendzign.com/wp-content/uploads/2010/04/ossec-zabbix-alert.zip">zabbix-alert.sh</a>.</p>
<blockquote><p>#!/bin/sh<br />
#<br />
# Submits an OSSEC alert as a passive service check result to zabbix.<br />
#<br />
# Author: David M. Zendzian<br />
# ZZ Servers, LLC 2010<br />
#<br />
# Idea from Dave Stycos post: http://groups.google.com/group/ossec-dev/browse_thread/thread/e29c5d71926b8af5<br />
#<br />
# This script is Public Domain, and is provided AS-IS.  There is no<br />
# warranty, and no support given for its contents.<br />
#<br />
# Version 1.0: Apr. 6, 2010<br />
#</p>
<p>DEBUG=&#8221;false&#8221;<br />
ACTION=$1<br />
USER=$2<br />
IP=$3<br />
ALERTID=$4<br />
RULEID=$5</p>
<p>LOCAL=`dirname $0`;<br />
cd $LOCAL<br />
cd ../<br />
PWD=`pwd`<br />
UNAME=`uname`</p>
<p># Zabbix Sender<br />
ZabbixSender=&#8221;/usr/bin/zabbix_sender&#8221;<br />
#ZabbixSender=&#8221;/usr/sbin/zabbix_sender&#8221;</p>
<p># Zabbix Server<br />
ZabbixServer=&lt;your zabbix server ip&gt;</p>
<p># Zabbix Port<br />
ZabbixPort=10051</p>
<p># All alerts will be processed by Zabbix under this key.<br />
ZabbixKeyName=OSSEC</p>
<p># Check that zabbix_sender file exists.<br />
if [ ! -w $ZabbixSender ]; then<br />
logger -p local0.err &#8220;$0: File $ZabbixSender not found.  Exiting.&#8221;<br />
exit 1<br />
fi</p>
<p># Getting alert time<br />
ALERTTIME=`echo &#8220;$ALERTID&#8221; | cut -d  &#8220;.&#8221; -f 1`</p>
<p># Getting end of alert<br />
ALERTLAST=`echo &#8220;$ALERTID&#8221; | cut -d  &#8220;.&#8221; -f 2`</p>
<p># Getting full alert<br />
ALERTTEXT=`grep -A 10 &#8220;$ALERTTIME&#8221; $PWD/../logs/alerts/alerts.log | grep -v &#8220;.$ALERTLAST: &#8221; -A 10 `</p>
<p># Extract host (agent) name from alert.<br />
HOSTNAME=`echo &#8220;$ALERTTEXT&#8221; | sed -n &#8217;1,1s/^.*\:[0-9][0-9]\:[0-9][0-9][^A-Za-z0-9_]*\([-A-Za-z0-9_]*\)\-&gt;.*$/\1/p&#8217;`</p>
<p># if hostname alert wasn&#8217;t from local host, the host value is &#8220;(hostname) ip&#8221;, which extracts differently<br />
if [ "$HOSTNAME" = "" ]<br />
then<br />
HOSTNAME=`echo &#8220;$ALERTTEXT&#8221; | sed -n &#8217;1,1s/^.*\:[0-9][0-9]\:[0-9][0-9] (\([-A-Za-z0-9_]*\)) .*\-&gt;.*$/\1/p&#8217;`<br />
fi<br />
if [ "$HOSTNAME" = "" ]<br />
then<br />
exit 0<br />
fi</p>
<p># Extract alert level from alert.<br />
ALERTLVL=`echo &#8220;$ALERTTEXT&#8221; | sed -n &#8217;2,2s/^.*(level \([0-9]*\).*$/\1/p&#8217;`</p>
<p># Extract description from alert.<br />
ALERTMSG=`echo &#8220;$ALERTTEXT&#8221; | sed -n &#8217;5,5p&#8217;`</p>
<p># Create Alert message<br />
# Short MSG version<br />
#ZMSG=&#8221;$ALERTID | $ALERTLVL | $RULEID &#8211; $ALERTMSG&#8221;<br />
# Full MSG Version<br />
ZMSG=&#8221;AlertID: $ALERTID | User: $USER | IP: $IP | Level: $ALERTLVL | RuleID: $RULEID &#8211; $ALERTMSG&#8221;</p>
<p># Send result to zabbix for logging and notification alerts.<br />
$ZabbixSender &#8211;zabbix-server $ZabbixServer &#8211;port $ZabbixPort &#8211;host $HOSTNAME &#8211;key $ZabbixKeyName &#8211;value &#8220;$ZMSG&#8221;</p>
<p>if [ "$DEBUG" = "true" ]<br />
then<br />
echo &#8220;$ZabbixSender &#8211;zabbix-server $ZabbixServer &#8211;port $ZabbixPort &#8211;host $HOSTNAME &#8211;key $ZabbixKeyName &#8211;value &#8216;$ZMSG&#8217;&#8221; &gt;&gt; /tmp/zabbix-test.log<br />
echo &#8220;ACTION: $ACTION&#8221; &gt;&gt; /tmp/zabbix-test.log<br />
echo &#8220;USER: $USER&#8221;<br />
echo &#8220;IP: $IP&#8221; &gt;&gt; /tmp/zabbix-test.log<br />
echo &#8220;ALERTID: $ALERTID&#8221; &gt;&gt; /tmp/zabbix-test.log<br />
echo &#8220;ALERTLVL: $ALERTLVL&#8221; &gt;&gt; /tmp/zabbix-test.log<br />
echo &#8220;RULEID: $RULEID&#8221; &gt;&gt; /tmp/zabbix-test.log<br />
echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8221; &gt;&gt; /tmp/zabbix-test.log<br />
fi<strong><br />
</strong></p></blockquote>
<p>With the script saved, you can restart OSSEC (OSSEC/bin/ossec-control restart) or wait until zabbix is setup then restart.</p>
<p>UPDATE 07-16-2010 &#8211; If you are using zabbix-proxies then you need to have the OSSEC alerts for proxy monitored hosts submitted through the proxy server.  This isn&#8217;t a problem with the existing script if the proxy server is also monitored through the proxy; just update the server IP to be the proxy not the central zabbix server.  If you monitor your proxy directly from the central zabbix server then the script needs to be updated to support sending proxy hosts though proxy and the host itself directly to zabbix.  The script can be found <a title="zabbix-alert.zip" href="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix-alert.zip">here</a>; or below.  Again be sure to watch for broken wrapped lines:</p>
<blockquote><p>#!/bin/sh<br />
#<br />
# Submits an OSSEC alert as a passive service check result to zabbix.<br />
#<br />
# Author: David M. Zendzian<br />
#<br />
# Idea from Dave Stycos post: http://groups.google.com/group/ossec-dev/browse_thread/thread/e29c5d71926b8af5<br />
#<br />
# Updated 7/15/10 &#8211; using 2 server hosts in case using proxies and local host is monitored directly by central server and not proxy.<br />
#<br />
# This script is Public Domain, and is provided AS-IS.  There is no<br />
# warranty, and no support given for its contents.<br />
#<br />
# Version 1.1: Jul. 15, 2010<br />
#</p>
<p>DEBUG=&#8221;true&#8221;<br />
ACTION=$1<br />
USER=$2<br />
IP=$3<br />
ALERTID=$4<br />
RULEID=$5</p>
<p>if [ "$DEBUG" = "true" ]<br />
then<br />
echo &#8220;NOTICE: Starting Zabbix sender&#8221; &gt;&gt; /tmp/zabbix-test.log<br />
fi</p>
<p>LOCAL=`dirname $0`;<br />
cd $LOCAL<br />
cd ../<br />
PWD=`pwd`<br />
UNAME=`uname`</p>
<p># Zabbix Sender<br />
ZabbixSender=&#8221;/usr/bin/zabbix_sender&#8221;<br />
#ZabbixSender=&#8221;/usr/sbin/zabbix_sender&#8221;</p>
<p># Zabbix Server<br />
# Set server2 to be the same if all hosts monitored through proxy or the same server; otherwise<br />
# set ZabbixServer to the proxy for non-localhost and then ZabbixServer2 to the host that the<br />
# local proxy uses<br />
ZabbixServer=&lt;Server/Proxy&gt;<br />
ZabbixServer2=&lt;Server for &#8220;Localhost&#8221;&gt;</p>
<p># Zabbix Port<br />
ZabbixPort=10051</p>
<p># All alerts will be processed by Zabbix under this key.<br />
ZabbixKeyName=OSSEC</p>
<p># Check that zabbix_sender file exists.<br />
if [ ! -w $ZabbixSender ]; then<br />
logger -p local0.err &#8220;$0: File $ZabbixSender not found.  Exiting.&#8221;<br />
if [ "$DEBUG" = "true" ]<br />
then<br />
echo &#8220;ERROR: No Zabbix Sender&#8221; &gt;&gt; /tmp/zabbix-test.log<br />
fi<br />
exit 1<br />
fi</p>
<p># Getting alert time<br />
ALERTTIME=`echo &#8220;$ALERTID&#8221; | cut -d  &#8220;.&#8221; -f 1`</p>
<p># Getting end of alert<br />
ALERTLAST=`echo &#8220;$ALERTID&#8221; | cut -d  &#8220;.&#8221; -f 2`</p>
<p># Getting full alert<br />
ALERTTEXT=`grep -A 10 &#8220;$ALERTTIME&#8221; $PWD/../logs/alerts/alerts.log | grep -v &#8220;.$ALERTLAST: &#8221; -A 10 `</p>
<p># Extract host (agent) name from alert.<br />
HOSTNAME=`echo &#8220;$ALERTTEXT&#8221; | sed -n &#8217;1,1s/^.*\:[0-9][0-9]\:[0-9][0-9][^A-Za-z0-9_]*\([-A-Za-z0-9_]*\)\-&gt;.*$/\1/p&#8217;`</p>
<p># if hostname alert wasn&#8217;t from local host, the host value is &#8220;(hostname) ip&#8221;, which extracts differently<br />
if [ "$HOSTNAME" = "" ]<br />
then<br />
HOSTNAME=`echo &#8220;$ALERTTEXT&#8221; | sed -n &#8217;1,1s/^.*\:[0-9][0-9]\:[0-9][0-9] (\([-A-Za-z0-9_]*\)) .*\-&gt;.*$/\1/p&#8217;`<br />
fi<br />
if [ "$HOSTNAME" = "" ]<br />
then<br />
if [ "$DEBUG" = "true" ]<br />
then<br />
echo &#8220;ERROR: No Hostname&#8221; &gt;&gt; /tmp/zabbix-test.log<br />
fi<br />
exit 0<br />
fi</p>
<p># if the local host is a proxy then monitored items submitted through proxy, localhost probably monitored directly from central server (if not change comment this out)<br />
LOCALHOSTNAME=`hostname -s`<br />
if [ "$HOSTNAME" = "$LOCALHOSTNAME" ]<br />
then<br />
ZabbixServer=$ZabbixServer2<br />
fi</p>
<p>if [ "$DEBUG" = "true" ]<br />
then<br />
echo &#8220;ZabbixServer: $ZabbixServer&#8221; &gt;&gt; /tmp/zabbix-test.log<br />
fi</p>
<p># Extract alert level from alert.<br />
ALERTLVL=`echo &#8220;$ALERTTEXT&#8221; | sed -n &#8217;2,2s/^.*(level \([0-9]*\).*$/\1/p&#8217;`</p>
<p># Extract description from alert.<br />
ALERTMSG=`echo &#8220;$ALERTTEXT&#8221; | sed -n &#8217;5,5p&#8217;`</p>
<p># Create Alert message<br />
ZMSG=&#8221;$ALERTID | $ALERTLVL | $RULEID &#8211; $ALERTMSG&#8221;</p>
<p># Send result to zabbix for logging and notification alerts.<br />
$ZabbixSender &#8211;zabbix-server $ZabbixServer &#8211;port $ZabbixPort &#8211;host $HOSTNAME &#8211;key $ZabbixKeyName &#8211;value &#8220;$ZMSG&#8221;</p>
<p>if [ "$DEBUG" = "true" ]<br />
then<br />
echo &#8220;$ZabbixSender &#8211;zabbix-server $ZabbixServer &#8211;port $ZabbixPort &#8211;host $HOSTNAME &#8211;key $ZabbixKeyName &#8211;value &#8216;$ZMSG&#8217;&#8221; &gt;&gt; /tmp/zabbix-test.log<br />
echo &#8220;ACTION: $ACTION&#8221; &gt;&gt; /tmp/zabbix-test.log<br />
echo &#8220;USER: $USER&#8221; &gt;&gt; /tmp/zabbix-test.log<br />
echo &#8220;IP: $IP&#8221; &gt;&gt; /tmp/zabbix-test.log<br />
echo &#8220;ALERTID: $ALERTID&#8221; &gt;&gt; /tmp/zabbix-test.log<br />
echo &#8220;ALERTLVL: $ALERTLVL&#8221; &gt;&gt; /tmp/zabbix-test.log<br />
echo &#8220;RULEID: $RULEID&#8221; &gt;&gt; /tmp/zabbix-test.log<br />
echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8221; &gt;&gt; /tmp/zabbix-test.log<br />
fi</p>
<p>exit 0</p></blockquote>
<p>For this integration to work, <strong>the host names used in OSSEC need to match the host names defined in Zabbix</strong>.  If they do not match, then zabbix_sender results will not make it into the hosts items correctly.</p>
<p>The easiest way to setup zabbix is to setup a <a title="template" href="http://www.zabbix.com/wiki/templates/start" target="_self">template</a>.  This template will define the application, item and triggers for OSSEC and can easily be linked to the hosts you are monitoring.</p>
<p>In zabbix goto Configure/Hosts and select &#8216;templates&#8217;.</p>
<p>Create a new template called OSSEC and be sure to add it to the Templates group.</p>
<div id="attachment_98" class="wp-caption alignnone" style="width: 535px"><a href="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix-add-template.png"><img class="size-large wp-image-98" title="Zabbix: Add OSSEC Template" src="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix-add-template-1024x570.png" alt="Add OSSEC Template" width="525" height="292" /></a><p class="wp-caption-text">Zabbix 1.6: Add OSSEC Template </p></div>
<div id="attachment_144" class="wp-caption alignnone" style="width: 535px"><a href="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix1.8-create-ossec-template.png"><img class="size-large wp-image-144" title="Zabbix 1.8: Add OSSEC Template" src="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix1.8-create-ossec-template-1024x759.png" alt="Zabbix 1.8: Add OSSEC Template" width="525" height="389" /></a><p class="wp-caption-text">Zabbix 1.8: Add OSSEC Template</p></div>
<p>With the template created, a new application needs to be created so the OSSEC items have a place to be organized.  Staying in Configuration / Hosts (for Zabbix 1.6 &amp; 1.8), in the drop down on the upper right, select &#8220;Applications&#8221; and then from the group and host dropdown, select Templates / Template_OSSEC that was just created.  There should be no Applications in the list. If you do not see Template_OSSEC that was just created, go back to templates and edit the OSSEC item and be sure that it is in the &#8220;Templates&#8221; group.</p>
<p>Click on &#8220;Create application&#8221; and create &#8220;OSSEC Monitor&#8221; or whatever you want to call it.</p>
<div id="attachment_99" class="wp-caption alignnone" style="width: 535px"><a href="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix-create-application.png"><img class="size-full wp-image-99" title="Zabbix 1.6: Create OSSEC Template Application" src="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix-create-application.png" alt="Create OSSEC Template Application" width="525" height="191" /></a><p class="wp-caption-text">Zabbix 1.6: Create OSSEC Template Application</p></div>
<div id="attachment_145" class="wp-caption alignnone" style="width: 535px"><a href="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix1.8-create-ossec-application.png"><img class="size-full wp-image-145" title="Zabbix 1.8: Create OSSEC Application" src="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix1.8-create-ossec-application.png" alt="Zabbix 1.8: Create OSSEC Application" width="525" height="220" /></a><p class="wp-caption-text">Zabbix 1.8: Create OSSEC Application</p></div>
<p>Now we are ready to create the Item &amp; Trigger for the OSSEC data.  In Zabbix 1.6, select &#8220;Configuration / Items&#8221; and select &#8220;Templates / Template_OSSEC&#8221; from the group and host selections and then click on &#8220;Create Item.&#8221;  The important item here is the Key which we will setup as OSSEC and is required to match the ZabbixKeyName in the zabbix-alert.sh script on the OSSEC server.</p>
<div id="attachment_100" class="wp-caption alignnone" style="width: 535px"><a href="http://www.zendzign.com/wp-content/uploads/2010/04/create-item.png"><img class="size-full wp-image-100" title="Zabbix 1.6: Create OSSEC Item" src="http://www.zendzign.com/wp-content/uploads/2010/04/create-item.png" alt="Zabbix Create OSSEC Item" width="525" height="355" /></a><p class="wp-caption-text">Zabbix 1.6: Create OSSEC Item</p></div>
<p>In Zabbix 1.8, remain in the &#8220;Configuration / Hosts&#8221; menu and in the upper right drop down select &#8220;Items&#8221;.  Click on &#8220;Create Item.&#8221;  When the new form is up, click on &#8220;Select&#8221; for the Host and select Template_OSSEC that we created above.  The same values will be set as with Zabbix 1.6.</p>
<div id="attachment_146" class="wp-caption alignnone" style="width: 535px"><a href="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix1.8-create-ossec-item.png"><img class="size-full wp-image-146" title="Zabbix 1.8: Create OSSEC Item" src="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix1.8-create-ossec-item.png" alt="Zabbix 1.8: Create OSSEC Item" width="525" height="365" /></a><p class="wp-caption-text">Zabbix 1.8: Create OSSEC Item</p></div>
<p>As you can see, the item is a &#8220;Text&#8221; type getting data from a Zabbix Trapper event.  The things to not forget here are to enter your OSSEC server(s) in the Allowed Host line and to select the OSSEC Monitor application.</p>
<p>The next step is to create a trigger which will let us know when new data has arrived from OSSEC. Select &#8220;Configuration / Triggers&#8221; in Zabbix 1.6.</p>
<p>If you are using 1.8 then remain on the &#8220;Configuration / Hosts&#8221; page and select &#8220;Triggers&#8221; from the dropdown box on the upper right.</p>
<p>It should default to the Template_OSSEC host, but if it doesn&#8217;t then select Templates from groups and the Template_OSSEC host.</p>
<p>There are several ways to monitor the OSSEC text data, but I have selected to alert if there is new data in the last 10 minutes.  As you can see from the screenshot, the expression I used is {Template_OSSEC:OSSEC.nodata(600)}#1.  This works because the nodata(600) will return a 1 if no data is received in the time period specified (600 sec or 10 min).  So if it ever returns anything other than 1, we have new data.  For more information on trigger functions, consult the zabbix <a title="manual" href="http://www.zabbix.com/documentation/1.8/manual/config/triggers" target="_self">manual</a>.</p>
<p>Now click on &#8220;Create Trigger&#8221; go create the trigger.</p>
<div id="attachment_101" class="wp-caption alignnone" style="width: 535px"><a href="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix-create-trigger.png"><img class="size-full wp-image-101" title="Zabbix 1.6: Create OSSEC Zabbix Trigger" src="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix-create-trigger.png" alt="Create OSSEC Zabbix Trigger" width="525" height="355" /></a><p class="wp-caption-text">Zabbix 1.6: Create OSSEC Zabbix Trigger</p></div>
<div id="attachment_147" class="wp-caption alignnone" style="width: 535px"><a href="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix1.8-create-ossec-trigger.png"><img class="size-full wp-image-147" title="Zabbix 1.8: Create OSSEC Zabbix Trigger" src="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix1.8-create-ossec-trigger.png" alt="Zabbix 1.8: Create OSSEC Zabbix Trigger" width="525" height="365" /></a><p class="wp-caption-text">Zabbix 1.8: Create OSSEC Zabbix Trigger</p></div>
<p>I have set the alert severity to &#8220;average&#8221; but you may want to change that depending on your needs.  The zabbix actions we will define will send all OSSEC alerts so the severity will not really matter.  One thing that is worth examining is to change the OSSEC item value to log instead of text which could allow for log severity and other values that could be used with the OSSEC alert levels; but that project is for another time.</p>
<p><strong>Updated: 4/16/10 &#8211; </strong>What I have done for alerting based on level is to use the &#8220;short&#8221; ZMSG message type in the zabbix-alert.sh script and define a trigger such as:</p>
<p style="padding-left: 30px;">({Template_OSSEC:OSSEC.<strong>nodata(</strong>600<strong>)</strong>}#1)&amp;({Template_OSSEC:OSSEC.<strong>str(</strong> | 1 | <strong>)</strong>}#1)&amp;({Template_OSSEC:OSSEC.<strong>str(</strong> | 2 | <strong>)</strong>}#1)&amp;({Template_OSSEC:OSSEC.<strong>str(</strong> | 3 | <strong>)</strong>}#1)</p>
<p>What this trigger does is requires all 4 conditions to be met (&amp;=&#8221;AND&#8221; between each item test).  The first is that there is new data within the last 10 minutes, the other 3 are requirements that the new data does not contain | 1 | or | 2 | or | 3 |, which would be OSSEC alert levels 1, 2 and 3.  If you use the longer ZMSG then the str values would be like: {Template_OSSEC:OSSEC.<strong>str(</strong> | Level: 3 | <strong>)</strong>}#1</p>
<p>Only 2 things left to do and the OSSEC/Zabbix integration is done.  These are to create actions for OSSEC events and to link the OSSEC template to the hosts you are monitoring with OSSEC.</p>
<p>In our local zabbix configuration I have created a &#8220;Security Administrator&#8221; group that receives IDS and other security events and will be using that to specify who receives the alerts.  You can modify these settings based on your local policy and zabbix configuration.</p>
<p>As you will also see in the following screenshot, I have modified the default message.  This allows me to receive the full data from the OSSEC event through {ITEM.LASTVALUE}.  I have also shortened the message so I can receive the details I want on my SMS alerts which have a smaller size than full emails.</p>
<p>I have tried to enable escalations for OSSEC alerts, however the way that zabbix handles items is that it will only look at the &#8220;active&#8221; triggers &amp; items, what this means is that when a new OSSEC alert comes in and is added to the items database, the trigger is alerted but after 10 minutes it will &#8220;go away&#8221;.  There is no way, currently, to have a trigger depend on it&#8217;s being &#8220;Ack&#8217;d&#8221; which would be preferred for security, log and other events that just shouldn&#8217;t go away until an admin acks what happened.  There is a currently active zabbix <a title="feature request" href="https://support.zabbix.com/browse/ZBXNEXT-104" target="_self">feature request</a> requesting this, so please go vote it up so we can see it added in the near future!</p>
<div id="attachment_103" class="wp-caption alignnone" style="width: 535px"><a href="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix-create-action.png"><img class="size-full wp-image-103" title="Zabbix 1.6: Create OSSEC Action" src="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix-create-action.png" alt="Zabbix Create OSSEC Action" width="525" height="355" /></a><p class="wp-caption-text">Zabbix 1.6: Create OSSEC Action</p></div>
<div id="attachment_148" class="wp-caption alignnone" style="width: 535px"><a href="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix1.8-create-action.png"><img class="size-full wp-image-148" title="Zabbix 1.8: Create OSSEC Action" src="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix1.8-create-action.png" alt="Zabbix 1.8: Create OSSEC Action" width="525" height="365" /></a><p class="wp-caption-text">Zabbix 1.8: Create OSSEC Action</p></div>
<p>All that is left is to link your hosts to the OSSEC template.  The OSSEC alert submits data to zabbix based on the host names defined in OSSEC.  So once again, please be sure the names used match in both systems.</p>
<p>If you do not know how to link the OSSEC template, simply go to &#8220;Configuration / Hosts&#8221; and edit the hosts that are monitored by OSSEC.  You need to link every host as the alerts will be coming in directly to each unique host.  The example below is for one of our ossec servers, but the configuration should be the same for all OSSEC monitored hosts.</p>
<div id="attachment_104" class="wp-caption alignnone" style="width: 535px"><a href="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix-host-templatelink.png"><img class="size-full wp-image-104" title="Zabbix 1.6: Host OSSEC Template Link" src="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix-host-templatelink.png" alt="Zabbix Host OSSEC Template Link" width="525" height="462" /></a><p class="wp-caption-text">Zabbix 1.6: Host OSSEC Template Link</p></div>
<div id="attachment_149" class="wp-caption alignnone" style="width: 535px"><a href="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix1.8-ossec-template-link.png"><img class="size-large wp-image-149" title="Zabbix 1.8: Host OSSEC Template Link" src="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix1.8-ossec-template-link-1024x637.png" alt="Zabbix 1.8: Host OSSEC Template Link" width="525" height="326" /></a><p class="wp-caption-text">Zabbix 1.8: Host OSSEC Template Link</p></div>
<p>This should be it.  If you have already restarted OSSEC then you just need to create an event it will alert on (logging onto monitored host, creating &#8220;segfault&#8221; log messages: logger &#8220;segfault&#8221;, etc).  In my quick test, seen below, I did a failed logon (bad pw) and within a few seconds I had my jabber alert pop up and a sms message arrive on my phone!</p>
<p><a href="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix-ossec-alert.png"><img class="alignnone size-full wp-image-122" title="Zabbix OSSEC Jabber Alert" src="http://www.zendzign.com/wp-content/uploads/2010/04/zabbix-ossec-alert.png" alt="Zabbix OSSEC Jabber Alert" width="332" height="340" /></a></p>
<p>If you have any problems, you can set DEBUG=true in the zabbix-alert.sh and it will log out what is being sent to zabbix into /tmp/zabbix-test.log.</p>
<p>If OSSEC is not running active-alerts, you may want to jump on #ossec on the openprojects IRC and get some assistance or search google.</p>
<p>Good luck!</p>
<p>David M. Zendzian | Managing Partner | <a title="ZZ Servers, LLC" href="http://www.zzservers.com" target="_self">ZZ Servers</a><br />
268 Bush St. #4127 | San Francisco, CA 94104</p>
<p>Business Hosting Solutions | PCI | HIPAA<br />
Managed Hosting Specialists</p>
<p><em> </em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zendzign.com/2010/04/zabbix-ossec-open-source-compliance-and-security-monitoring/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Health Insurance Portability &amp; Accountability Act (HIPPA), PCI, SOX and Web Hosting</title>
		<link>http://www.zendzign.com/2008/05/health-insurance-portability-accountability-act-hippa-and-web-hosting/</link>
		<comments>http://www.zendzign.com/2008/05/health-insurance-portability-accountability-act-hippa-and-web-hosting/#comments</comments>
		<pubDate>Fri, 09 May 2008 17:37:12 +0000</pubDate>
		<dc:creator>David M. Zendzian</dc:creator>
				<category><![CDATA[HIPPA]]></category>
		<category><![CDATA[PCI]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://zendzign.com/?p=4</guid>
		<description><![CDATA[&#8220;HIPAA&#8221; is an acronym for the Health Insurance Portability &#38; Accountability Act of 1996 (August 21), Public Law 104-191, which amended the Internal Revenue Service Code of 1986. Also known as the Kennedy-Kassebaum Act, the Act includes a section, Title II, entitled Administrative Simplification, requiring: Improved efficiency in health care delivery by standardizing electronic data [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;HIPAA&#8221; is an acronym for the Health Insurance Portability &amp; Accountability Act of 1996 (August 21), Public Law 104-191, which amended the Internal Revenue Service Code of 1986. Also known as the Kennedy-Kassebaum Act, the Act includes a section, Title II, entitled Administrative Simplification, requiring:</p>
<ol>
<li>Improved efficiency in health care delivery by standardizing electronic data interchange, and</li>
<li>Protection of confidentiality and security of health data through setting and enforcing standards.</li>
</ol>
<p><span id="more-4"></span>More specifically, HIPAA called upon the Department of Health and Human Services (HHS) to publish new rules that will ensure:</p>
<ol>
<li>Standardization of electronic patient health, administrative and financial data</li>
<li>Unique health identifiers for individuals, employers, health plans and health care providers</li>
<li>Security standards protecting the confidentiality and integrity of &#8220;individually identifiable health information,&#8221; past, present or future.</li>
</ol>
<p>Compliance requirements include:</p>
<ul>
<li>Building initial organizational awareness of HIPAA</li>
<li>Comprehensive assessment of the organization&#8217;s privacy practices, information security systems and procedures, and use of electronic transactions</li>
<li>Developing an action plan for compliance with each rule</li>
<li>Developing a technical and management infrastructure to implement the plans</li>
<li>Implementing a comprehensive implementation action plan, including</li>
<li>Developing new policies, processes, and procedures to ensure privacy, security and patients&#8217; rights</li>
<li>Building business associate agreements with business partners to support HIPAA objectives</li>
<li>Developing a secure technical and physical information infrastructure</li>
<li>Updating information systems to safeguard protected health information (PHI) and enable use of standard claims and related transactions</li>
<li>Training of all workforce members</li>
<li>Developing and maintaining an internal privacy and security management and enforcement infrastructure, including providing a Privacy Officer and a Security Officer</li>
</ul>
<p>All of these requirements apply to not only the company which owns the PHI, but also any company or contractor they work with who has access to this information. The details on how to meet the HIPAA requirements is up to the individual company, allowing the &#8220;market to dictate&#8221; the terms and conditions.</p>
<p>Most companies I have worked with spend a considerable amount of time generating the paper documentation they feel will meet the above requirements. That is the most important part of any security policy or plan, knowing what is important (PHI/Card Data/Financial/etc) and defining how the business will properly control that information.</p>
<p>Data-centers, managed service providers and other contracted service providers come into this picture when companies outsource their data-center operations or when you are partnering with a company for data-center services. If you look at the HIPAA requirements, they all can be applied in some form or another to the outsourced provider, but the validation is left up to the contracting business and there is no guidance other than &#8220;best practices&#8221;.</p>
<p>So what should you look for in a business partner to have that can meet these HIPAA requirements? Before I answer that, I would like to discuss a similar security standard. As you may know from regular occurrence in the news, credit card data is lost and stolen on an increasingly regular basis. To help fight this, the Payment Card Industry has created the PCI Security Standards Council whose charter is to create and maintain specific industry standards and to train qualified assessors on how to validate against those standards. Any business that stores, transmits or processes credit card data is required to abide by these standards. This means even the person with a cellular card swipe machine at the flea market has to meet the same standards as Walmart, Amazon.com, PayPal or other multi-national merchants and banks. Below is a list of 12 sections in the PCI Security Audit Procedure which which you should look for from any service provider or partner you are considering. These sections break down in detail the steps which must be taken to comply with the PCI standard. To get more information, you can download the PCI details here <a href="https://www.pcisecuritystandards.org/pdfs/pci_qsa_list.pdf">https://www.pcisecuritystandards.org/pdfs/pci_qsa_list.pdf</a> and here <a href="https://www.pcisecuritystandards.org/pdfs/pci_audit_procedures_v1-1.pdf">https://www.pcisecuritystandards.org/pdfs/pci_audit_procedures_v1-1.pdf</a></p>
<ol>
<li>Firewalls &amp; Routers</li>
<li>Service configuration (note service includes servers/applications/databases/firewalls/etc)</li>
<li>Storage of Card data (what is/is not allowed, encryption, secure deletion), Data retention policy</li>
<li>Transmission of card data (SSL, VPN, 802.11, etc)</li>
<li>Anti-virus</li>
<li>Secure Development &#8212; ** Change Management **</li>
<li>Need-to-know</li>
<li>Unique ID for _everyone_ &#8211; no shared root, enable, administrator &amp; password requirements</li>
<li>Physical Security</li>
<li>Logging &amp; Time sync</li>
<li>Security Testing (security scanning, pen testing)</li>
<li>Policies, Contracts, Security Training, Risk Assessment, Incident Response Policies, Connected Entities (partner connection) management</li>
</ol>
<p>Additionally, depending on which services you plan on using from a contracted provider or partner, different sections will apply for example:</p>
<ul>
<li>If they are going to provide router or firewall services, section 1</li>
<li>If they are going to provide any servers (virtual or real) then sections 2, 5, 7, 8, 9, 10, 11 &amp; 12 (yes most of it:)</li>
<li>If they are going to provide development support sections 3, 4 &amp; 6</li>
<li>If they are going to provide system management support, 2, 3, 4, 5, 7, 8, 10</li>
</ul>
<p>I mention PCI because unlike the HIPAA requirements, the PCI Standards and process is very clearly defined. While PCI is not perfect, since it was based on ISO17799 it covers a wide range of security issues. If you take the PCI standards and replace PCI with HIPAA or Financial (SOX), then you have a great guideline and audit procedure to work with for your own and your partners security.</p>
<p>So back to the question for this thread. How can you determine if a data-center/service provider meets your needs for the various compliance requirements. To answer this, you need to determine the role the service provider has with relation to your business and your specific data-set requirements.</p>
<p>If you are looking for somewhere to host your entire &#8220;business&#8221; and then VPN back into your company network, then you have physical, network, policy, procedure and contractual security needs.</p>
<p>If you are looking to have someone provide a more hands-on role then the same requirements are met, but then the providers mechanisms for providing support will then need to be evaluated. This would bring the assessment into the way they store passwords, monitor systems, provide support, troubleshoot, maintain change management, key-management, security monitoring, image management, upgrades, etc.</p>
<p>Giving all of these considerations, as a business you need to determine how you wish to handle the requirements. If you are a large merchant or service provider, you typically get ISO or SAS70 audits. Any data-center should be able to provide that assessment as you are trying to determine who you wish to work with. Keep in mind that with these assessments, the company has hired the auditor to validate a &#8220;specific&#8221; item, so the audit report will be focused only on that and may not take into consideration other processes or areas within the facility.</p>
<p>If the company has been through a PCI or other audit they should be able to provide some documentation regarding the audit and the controls they have in place that they used to go through the audit.</p>
<p>If they are a service provider (providing services to PCI organizations) and have been through a level 1 audit then they will be listed here: <a href="http://usa.visa.com/download/merchants/cisp_list_of_cisp_compliant_service_providers.pdf">http://usa.visa.com/download/merchants/cisp_list_of_cisp_compliant_service_providers.pdf</a></p>
<p>Not many ISPs or Data-Centers have been through a level 1 PCI audit as they are usually very costly and if you read through the SAP you will find time consuming in the details that need to be met.</p>
<p>So what can you hope to find in a service partner you are looking to host with:</p>
<ul>
<li>A physical location that has good security controls</li>
<li>24&#215;7 guard &amp; locked doors</li>
<li>Sign-in required and only authorized visitors</li>
<li>at least 3 months camera data (90 days) on all entrances &amp; exits to data-center facility</li>
<li>Security for the physical servers (do not use shared cages)</li>
<li>Policies</li>
<li>Standard configuration documentation for all services you are getting services for (servers, firewalls, load balancers, certificates, etc)</li>
<li>Network &amp; server security &#8211; IDS / IPS / Host IDS / Log Monitoring / Internal &amp; External Scanning / ASV Scanning</li>
<li>Change Management that includes</li>
<li>Documentation of impact</li>
<li>Management sign off &#8211; colo should notify of customers of changes (good communication, as it was mentioned in a previous post, most providers that provide HIPAA or other services tend to have more communication with their customers)</li>
<li>Back out plan / procedure</li>
<li>Functional testing</li>
</ul>
<p>If you are looking for more advanced services to ensure that not only is the machine physically secure, but also have you deployed your application architecture properly, then you may want to also be sure the service provider can also provide:</p>
<ul>
<li>Firewalls</li>
<li>Private Networks</li>
<li>VPN</li>
<li>Load balancers</li>
<li>2 factor authentication</li>
<li>IDS</li>
<li>Log Monitoring</li>
<li>Centralized logging</li>
<li>Monitoring (Security &amp; Availability)</li>
<li>Development services</li>
<li>Code review</li>
<li>Time services (NTP)</li>
<li>Senior Security &amp; Architectural staff as well as Sr systems staff</li>
</ul>
<p>Many of the people I have worked with have needed just about all of the above services when they are either building, expanding or migrating their applications into data-center facilities.</p>
<p>I know I did not stick specifically with the HIPAA question, but hopefully this information will help those are looking for new hosting facilities.</p>
<p>Now for those who are wondering, well do you provide those services? The short answer is yes. However not all are immediately activated &#8220;web dashboard&#8221; ready services and require a direct relationship with our senior architects and systems folks.</p>
<p>Our San Francisco data-center is through a partnership with ColoServe who provides the physical security and raw bandwidth to our secure cabinets. While the physical center has not been through any Level 1 PCI audits, ZZ servers has been through 2 bi-annual security audits by American Express for one of our customers and the facility has a SAS70 certificate and has the added security of also hosting the 911 systems for the city of San Francisco so our structural, power and data systems are a step above par.</p>
<p>I myself consult with a QSA out of San Meto (<a href="http://www.drgsf.com/">http://www.drgsf.com</a>) and perform Level 1 audits and Security Assessment for payment applications as specified by the Payment Applications Best Practices following the PA-DSS (<a href="https://www.pcisecuritystandards.org/tech/pa-dss.htm">https://www.pcisecuritystandards.org/tech/pa-dss.htm</a></p>
<p>After spending 20 years building and working with small to large companies and founding 3 previous ISP services I wanted to bring a level of business service to the hosting community. So in founding ZZ Servers with my brother, Peter &#8211; a 20 year Navy vet currently spending his last year in the service stationed in Bagdad), we specifically created the infrastructure to be able to provide many if not all of the requirements mentioned above.</p>
<p>We are focused on providing services that are priced to compete with the largest players (rack-space, one and one, etc) but to also have the value added services I discussed in the requirements listings above.</p>
<p>We currently have customers utilizing the following services:</p>
<ul>
<li>Co-located servers</li>
<li>Leased Servers</li>
<li>Virtual Private Servers</li>
<li>Private Networks</li>
<li>Multiple firewalls (internal &amp; external)</li>
<li>Load Balancers</li>
<li>Managed monitoring &amp; support</li>
<li>Centralized Logging &amp; monitoring</li>
<li>IDS</li>
<li>VPN</li>
<li>2 Factor Authentication with CryptoCard</li>
<li>Time services (NTP)</li>
<li>Senior Security &amp; Architectural staff as well as senior systems staff</li>
</ul>
<p>And we are in the midst of deploying a full change-management system that will be available to any customer using any service which will fully integrated into all hosted services (schedule changes for firewalls or clusters of servers, and track status of each individual change).</p>
<p>We have also just signed an agreement with DRG to provide integrated ASV scanning which will be integrated into our order wizard allowing customers to sign-up and manage their PCI compliant scans and automatically send results to your merchant bank. This service will also include an on line form for creating and submitting the Self Assessment Questionnaire.</p>
<p>We are a small family-run business focused on slow growth and providing tools for both the smaller &amp; larger customers to grow into whatever their business has potential for.</p>
<p>For more details about HIPPA, please visit  <span style="color: #000000;"><span style="font-size: small;">(</span></span><a href="http://www.hipaadvisory.com/regs/HIPAAprimer.htm">http://www.hipaadvisory.com/regs/HIPAAprimer.htm</a><span style="color: #000000;"><span style="font-size: small;">)</span></span></p>
<p>Regards,</p>
<p>David</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zendzign.com/2008/05/health-insurance-portability-accountability-act-hippa-and-web-hosting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
