<?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 &#8211; Johnny Morano&#039;s Tech Articles</title>
	<atom:link href="https://jmorano.moretrix.com/category/openbsd/feed/" rel="self" type="application/rss+xml" />
	<link>https://jmorano.moretrix.com</link>
	<description>Ramblings of an old-fashioned space cowboy</description>
	<lastBuildDate>Sat, 09 Apr 2022 07:15:54 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>

<image>
	<url>https://jmorano.moretrix.com/wp-content/uploads/2022/04/cropped-jmorano_emblem-32x32.png</url>
	<title>OpenBSD &#8211; Johnny Morano&#039;s Tech Articles</title>
	<link>https://jmorano.moretrix.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Time based network access control on OpenBSD</title>
		<link>https://jmorano.moretrix.com/2022/03/time-based-network-access-control-on-openbsd/</link>
					<comments>https://jmorano.moretrix.com/2022/03/time-based-network-access-control-on-openbsd/#respond</comments>
		
		<dc:creator><![CDATA[Johnny Morano]]></dc:creator>
		<pubDate>Tue, 01 Mar 2022 13:14:17 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[PF]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[UNIX]]></category>
		<guid isPermaLink="false">https://jmorano.moretrix.com/?p=1293</guid>

					<description><![CDATA[Time based ACL (access control lists) features do not exist in BSD&#8217;s packet filter (PF). Having your network&#8230;]]></description>
										<content:encoded><![CDATA[
<p>Time based ACL (access control lists) features do not exist in BSD&#8217;s packet filter (<code>PF</code>). Having your network &#8220;shut down&#8221; at certain times (for instance, allow certain network ranges or specific IP addresses only during &#8220;business hours&#8221; or a specific time range), can be achieved with a simple <code>PF</code> table and a <code>cronjob</code>.</p>



<p>First, let&#8217;s set up the <code>PF</code> table which will control the traffic. Add the following to your <code>/etc/pf.conf</code> :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># add time block table
table &lt;time_block> { } persist
</pre>



<p>Next, create a <code>PF</code> rule which block traffic for all entries in the <code>time_block</code> table:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># block all CIDR addresses in the time block table
block in quick log from &lt;time_block> to any
</pre>



<p>Since the <code>time_block</code> table is still empty, no traffic is actually blocked.</p>



<p>The last thing to implement, is periodically manipulating the <code>time_block</code> table. This could be done by creating two <code>cronjobs</code>:</p>



<ol class="wp-block-list"><li>allow traffic at the beginning of &#8220;business hours&#8221;</li><li>block traffic at the end of &#8220;business hours&#8221;</li></ol>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">crontab -e
# Allow traffic
0 7 * * * /usr/local/scripts/allow_employees.sh > /dev/null 2>&amp;1
# Block traffic
0 17 * * * /usr/local/scripts/block_employees.sh > /dev/null 2>&amp;1
﻿</pre>



<p>The <code>allow_employees.sh</code> script will allow certain network ranges by ensuring those are removed from the <code>time_block</code> table:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#!/bin/sh

/sbin/pfctl -Td -t time_block 10.1.0.0/24
/sbin/pfctl -Td -t time_block 10.2.0.0/24
</pre>



<p>The <code>block_employees.sh</code> script will do the exact opposite: it will add ranges to the <code>time_block</code> table so that their network access will be blocked by the firewall:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#!/bin/sh

/sbin/pfctl -Ta -t time_block 10.1.0.0/24
/sbin/pfctl -Ta -t time_block 10.2.0.0/24
</pre>



<p>Finally deploy your new PF rules (first test them!)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">pfctl -nf /etc/pf.conf
pfctl -f /etc/pf.conf</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://jmorano.moretrix.com/2022/03/time-based-network-access-control-on-openbsd/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Install OpenBSD 6.0 on a Soekris net6501</title>
		<link>https://jmorano.moretrix.com/2016/12/install-openbsd-6-0-on-a-soekris-net6501/</link>
					<comments>https://jmorano.moretrix.com/2016/12/install-openbsd-6-0-on-a-soekris-net6501/#respond</comments>
		
		<dc:creator><![CDATA[Johnny Morano]]></dc:creator>
		<pubDate>Tue, 27 Dec 2016 11:38:18 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[Soekris]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=1234</guid>

					<description><![CDATA[Recently I bought a Soekris net6501 to build a home network in my new house.Things you need before&#8230;]]></description>
										<content:encoded><![CDATA[
<p>Recently I bought a Soekris net6501 to build a home network in my new house.<br />Things you need before you start:</p>



<ul class="wp-block-list"><li>USB / mSSD drive to install OpenBSD on</li><li>USB drive to boot from</li><li>Serial cable for the initial installation</li></ul>



<p>First go to a mirror and download the amd64 OpenBSD install image, which ends on the .fs extension. The one for OpenBSD 6.0 is called &#8216;install60.fs&#8217;.</p>



<p>The installation procedure will use an USB stick to boot the installation process.<br />The USB stick itself was created on a Linux Desktop system, using dd. There are many ways to get the install image on an USB stick. Google if you are not using a Linux desktop.</p>



<p>I downloaded the install image to my &#8216;Downloads&#8217; folder, and the USB stick was on /dev/sdb</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">dd if=./Downloads/install60.fs of=/dev/sdb bs=1024k</pre>



<p>Once the USB stick/ disk is ready, insert it in your Soekris net6501.</p>



<p>Now prepare your terminal console. I&#8217;ve used Minicom for this purpose, but any kind of terminal emulation program can be used.</p>



<p>Execute the following on the command line:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">minicom -D /dev/ttyUSB0 -b 19200 # no software or hardware flow control</pre>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Important to note is:<br />&#8211; The baudrate must be set to <mark style="background-color:#fcb900" class="has-inline-color">19200 baud</mark><br />&#8211; You must <mark style="background-color:#fcb900" class="has-inline-color">disable software and/ or hardware flow control</mark></p></blockquote>



<p>Once connected with the serial console cable, plug in the power cable to your Soekris so that it can be boot up.</p>



<p>At the boot prompt, configure the installation image to send its output to the serial console.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Using drive 1, partition 3.
Loading.........
probing: pc0 com0 pci mem[620K 1022M a20=on]
disk: hd0+* hd1+ hd2*
&amp;gt;&amp;gt; OpenBSD/i386 BOOT 3.29
boot&amp;gt; stty com0 19200
boot&amp;gt; set tty com0
switching console to com0
&amp;gt;&amp;gt; OpenBSD/i386 BOOT 3.29
boot&amp;gt; bsd 
</pre>



<p>There are two commands that must be executed at the boot prompt:<br />&#8211; <span class="lang:sh decode:true  crayon-inline "><code>stty com0 19200</code></span><br />&#8211; <span class="lang:sh decode:true  crayon-inline "><code>set tty com0</code></span></p>



<p>After the serial console options have been set, boot the kernel by typing <span class="lang:sh decode:true  crayon-inline "><code>bsd</code></span> and hiting <code>ENTER</code></p>



<p>The first steps are to configure the network interfaces.<br />Please also make sure you have enabled sshd, so that after the installation you can access the firewall without using the serial console cable.</p>



<p>The rest of the installation won&#8217;t be covered here.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jmorano.moretrix.com/2016/12/install-openbsd-6-0-on-a-soekris-net6501/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>OSSEC: building an OpenBSD package</title>
		<link>https://jmorano.moretrix.com/2016/03/ossec-building-an-openbsd-package/</link>
					<comments>https://jmorano.moretrix.com/2016/03/ossec-building-an-openbsd-package/#comments</comments>
		
		<dc:creator><![CDATA[Johnny Morano]]></dc:creator>
		<pubDate>Tue, 15 Mar 2016 07:28:29 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[HIDS]]></category>
		<category><![CDATA[OSSEC]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=1101</guid>

					<description><![CDATA[OSSEC is an Open Source Host-based Intrusion Detection System that performs log analysis, file integrity checking, policy monitoring,&#8230;]]></description>
										<content:encoded><![CDATA[
<p><a title="OSSEC Website" href="http://www.ossec.net/" target="_blank" rel="noopener">OSSEC</a> is an Open Source Host-based Intrusion Detection System that performs log analysis, file integrity checking, policy monitoring, rootkit detection, real-time alerting and active response.</p>



<p>It runs on most operating systems, including Linux, MacOS, Solaris, HP-UX, AIX and OpenBSD.</p>



<p>There is no OSSEC package available on the OSSEC website or in the OpenBSDs ports repositry, so I&#8217;ve decided to create an OpenBSD on my own.<br />OpenBSD packages are pretty easy to create and are very useful when installing, upgrading or deleting software on a server.</p>



<p>One of the disadvantages when creating an OpenBSD package, is that you will need to have X11 installed on your OpenBSD system.<br />In the following example I have used <a href="http://openbsd.org" target="_blank" rel="noopener">OpenBSD 5.8</a> to create a package for <a href="http://ossec.github.io/" target="_blank" rel="noopener">OSSEC 2.8.2</a> (OSSEC 2.8.3 doesn&#8217;t compile on OpenBSD 5.8)</p>



<h2 class="wp-block-heading">Step 1: Prerequisites</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cd /tmp
wget http://ftp.eu.openbsd.org/pub/OpenBSD/5.8/amd64/xbase58.tgz 
wget http://ftp.eu.openbsd.org/pub/OpenBSD/5.8/amd64/xshare58.tgz
wget http://ftp.eu.openbsd.org/pub/OpenBSD/5.8/amd64/comp58.tgz
tar -C / -xzvphf xbase58.tgz
tar -C / -xzvphf xshare58.tgz
tar -C / -xzvphf comp58.tgz

cd /tmp
ftp http://ftp.eu.openbsd.org/pub/OpenBSD/$(uname -r)/ports.tar.gz
ftp http://ftp.eu.openbsd.org/pub/OpenBSD/$(uname -r)/SHA256.sig
signify -Cp /etc/signify/openbsd-$(uname -r | cut -c 1,3)-base.pub -x SHA256.sig ports.tar.gz

cd /usr
tar xzf /tmp/ports.tar.gz</pre>



<p>You will also need a compiler:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">pkg_add gcc</pre>



<h2 class="wp-block-heading">Step 2: Download and repack the source</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">ossec_version="2.8.2"
cd /usr/src
wget https://github.com/ossec/ossec-hids/archive/${ossec_version}.tar.gz 
mv ${ossec_version}.tar.gz ossec-hids-${ossec_version}.tar.gz 
tar xfz ossec-hids-${ossec_version}.tar.gz
cd ossec-hids-${ossec_version}
</pre>



<p>Since the Makefile for OSSEC is in the <em>src/</em> sub directory, we will create a proxy Makefile in <em>/usr/src/ossec-hids-2.8.2</em></p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cd ossec-hids-2.8.2
vim Makefile</pre>



<p>I have actually taken the original Makefile from<em> src/</em> and narrowed it down to the following:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># Makefile
# http://www.ossec.net/hids/

none:
 @echo "Nothing selected ..."
 @echo "\"make all\" to compile everything."
 @echo "\"make server\" to build the server."
 @echo "\"make local\" to build the local."
 @echo "\"make agent\" to build the agent."
 @echo "\"make clean\" to clean anything built."

clean:
 cd src/ ; $(MAKE) clean

all:
 cd src/ ; $(MAKE) all
 
test:
 cd src/ ; $(MAKE) test

server:
 cd src/ ; $(MAKE) server

local:
 cd src/ ; $(MAKE) local

agent:
 cd src/ ; $(MAKE) agent

</pre>



<p>We will also edit the &#8216;<em>ossec-clients.sh</em>&#8216; script, because we will use this script as a start/stop script. We will have to set the path name in this script.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">vim src/init/ossec-client.sh
# LOCAL=/var/ossec
# cd ${LOCAL}
# PWD=`pwd`
DIR=/var/ossec
cd ${DIR}
</pre>



<p>And that&#8217;s the only thing we will need to change in the sources, we can now repackage it.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cd ..
tar czf /usr/ports/distfiles/ossec-hids-2.8.2.tar.gz ossec-hids-2.8.2/
</pre>



<h2 class="wp-block-heading">Step 3: Prepare the ports directory</h2>



<p>The following steps explain how to set up a ports directory in <em>/usr/ports</em> for OSSEC, in order to build the package.<br />Custom made packages are built in<em> /usr/ports/mystuff</em>. In there, we will have to one sub directory for the package category (we will use security) and in there the package name, which in our case will be ossec-hids.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cd /usr/ports/mystuff
mkdir -p security/ossec-hids
</pre>



<p>The configuration file for building an OpenBSD package is a Makefile. There is a template file in <em>/usr/ports/infrastructure/templates/Makefile.template</em> which can be used.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cd security/ossec-hids
cp /usr/ports/infrastructure/templates/Makefile.template Makefile
</pre>



<p>This file of course needs editing. Not everything is required in this file, so I have narrowed the Makefile down to what I need it for:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># $OpenBSD: Makefile.template,v 1.68 2013/10/02 07:34:45 ajacoutot Exp $
# $FreeBSD/NetBSD: credit FreeBSD/NetBSD if thats where the port came from $
# Original from: credit the original author here
COMMENT =               OSSEC is an Open Source HIDS
DISTNAME =              ossec-hids-2.8.2
CATEGORIES =            security
HOMEPAGE =              http://www.ossec.net/
MAINTAINER =            Johnny Morano &amp;lt;jmorano@moretrix.com&amp;gt;;
MASTER_SITES =          https://github.com/ossec/ossec-hids/

PERMIT_PACKAGE_CDROM =  Yes
PERMIT_PACKAGE_FTP =    Yes
PERMIT_DISTFILES_FTP =  Yes

PKG_ARCH =              *
PREFIX = /var/ossec

do-install:
        mkdir -p ${PREFIX}/bin
        mkdir -p ${PREFIX}/logs
        mkdir -p ${PREFIX}/var/run
        mkdir -p ${PREFIX}/queue
        mkdir -p ${PREFIX}/active-response/bin
        mkdir -p ${PREFIX}/agentless
        mkdir -p ${PREFIX}/etc/orig/shared
        mkdir -p ${PREFIX}/doc
        ${INSTALL_SCRIPT} ${WRKSRC}/active-response/firewalls/pf.sh ${PREFIX}/active-response/bin/
        ${INSTALL_SCRIPT} ${WRKSRC}/src/agentlessd/scripts/* ${PREFIX}/agentless
        ${INSTALL_SCRIPT} ${WRKSRC}/src/os_execd/ossec-execd ${PREFIX}/bin/
        ${INSTALL_SCRIPT} ${WRKSRC}/src/logcollector/ossec-logcollector ${PREFIX}/bin/
        ${INSTALL_SCRIPT} ${WRKSRC}/src/client-agent/ossec-agentd ${PREFIX}/bin/
        ${INSTALL_SCRIPT} ${WRKSRC}/src/addagent/manage_agents ${PREFIX}/bin/
        ${INSTALL_SCRIPT} ${WRKSRC}/src/syscheckd/ossec-syscheckd ${PREFIX}/bin/
        ${INSTALL_SCRIPT} ${WRKSRC}/src/os_auth/agent-auth ${PREFIX}/bin/
        ${INSTALL_SCRIPT} ${WRKSRC}/src/init/ossec-client.sh ${PREFIX}/bin/
        ${INSTALL_SCRIPT} ${WRKSRC}/doc/*.txt ${PREFIX}/doc/
        ${INSTALL_SCRIPT} ${WRKSRC}/doc/README.config ${PREFIX}/doc/
        ${INSTALL_SCRIPT} ${WRKSRC}/etc/*.conf ${PREFIX}/etc/orig/
        ${INSTALL_SCRIPT} ${WRKSRC}/etc/*.xml ${PREFIX}/etc/orig/
        ${INSTALL_SCRIPT} ${WRKSRC}/src/rootcheck/db/* ${PREFIX}/etc/orig/shared/

.include &amp;lt;bsd.port.mk&amp;gt;;
</pre>



<p>The above Makefile will install OSSEC in<em> /var/ossec</em> and will only install the agent files. It does not install the server files.</p>



<h2 class="wp-block-heading">Step 4: Test the settings</h2>



<p>First we will make a checksum and then we will start a fake compile run, to see if everything compiles nicely.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">make makesum 
===&amp;gt;  Checking files for ossec-hids-2.8.2
`/usr/ports/distfiles/ossec-hids-2.8.2.tar.gz' is up to date.

make fake
===&amp;gt;  Checking files for ossec-hids-2.8.2
`/usr/ports/distfiles/ossec-hids-2.8.2.tar.gz' is up to date.
&amp;gt;&amp;gt; (SHA256) ossec-hids-2.8.2.tar.gz: OK
===&amp;gt;  Extracting for ossec-hids-2.8.2
===&amp;gt;  Patching for ossec-hids-2.8.2
===&amp;gt;  Configuring for ossec-hids-2.8.2
===&amp;gt;  Building for ossec-hids-2.8.2
***snip***</pre>



<p>If there were no errors, then we are ready to create the actual package.</p>



<h2 class="wp-block-heading">Step 5: Create the OpenBSD package</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">mkdir pkg
echo "OSSEC is an Open Source HIDS" &amp;amp;gt; pkg/DESCR
make plist
vim pkg/PLIST
</pre>



<p>Normally we do not need to edit the PLIST file, but I wanted to create an ossec user upon installation and chown the <em>/var/ossec</em> directory to that user.<br />So I have added the following lines to the top of <em>pkg/PLIST</em>:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">@comment $OpenBSD$
@newgroup ossec:1002
@newuser ossec:1005:ossec:daemon:OSSEC User:/var/ossec:/bin/sh</pre>



<p>And these to the bottom:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">@exec-add mkdir -p /var/ossec
@exec-add chown -R ossec.ossec /var/ossec
@exec-add cp %D/bin/ossec-client.sh /etc/rc.d/ossec</pre>



<p>Afterwards you will need to run:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">make plist</pre>



<p>Now we are ready to build the package:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">make package
`/usr/ports/pobj/ossec-hids-2.8.2/fake-amd64/.fake_done' is up to date.
===&amp;gt;  Building package for ossec-hids-2.8.2
Create /usr/ports/packages/amd64/no-arch/ossec-hids-2.8.2.tgz
Link to /usr/ports/packages/amd64/all/ossec-hids-2.8.2.tgz
Link to /usr/ports/packages/amd64/ftp/ossec-hids-2.8.2.tgz
Link to /usr/ports/packages/amd64/cdrom/ossec-hids-2.8.2.tgz</pre>



<p>That&#8217;s it! This package can now be installed with the <code>pkg_add</code> command.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">pkg_add ./ossec-hids-2.8.2.tgz 
quirks-2.114 signed on 2015-08-09T11:57:52Z
UNSIGNED PACKAGE file:./ossec-hids-2.8.2.tgz: install anyway ? [y/N/a] y
ossec-hids-2.8.2: ok
UNSIGNED PACKAGES: ossec-hids-2.8.2</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://jmorano.moretrix.com/2016/03/ossec-building-an-openbsd-package/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
