<?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>kerneljack&#039;s diary &#187; openbsd operating_systems ukuug unix</title>
	<atom:link href="http://www.kerneljack.com/tag/openbsd-operating_systems-ukuug-unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kerneljack.com</link>
	<description></description>
	<lastBuildDate>Thu, 01 Jul 2010 11:25:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>OpenBSD and PF</title>
		<link>http://www.kerneljack.com/2008/04/24/openbsd-and-pf/</link>
		<comments>http://www.kerneljack.com/2008/04/24/openbsd-and-pf/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 17:32:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[operating systems]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[openbsd operating_systems ukuug unix]]></category>

		<guid isPermaLink="false">http://www.kerneljack.com/?p=144</guid>
		<description><![CDATA[On the first day of the UKUUG Spring Conference I attended the OpenBSD and PF tutorial. I was asked to write a short review of that tutorial for the UKUUG newsletter. I’m posting what I wrote below: The superiority of OpenBSD when it comes to security is legendary. The OpenBSD community continuously do security audits [...]]]></description>
			<content:encoded><![CDATA[<p>On the first day of the UKUUG Spring Conference I attended the OpenBSD and PF tutorial. I was asked to write a short review of that tutorial for the UKUUG newsletter. I’m posting what I wrote below:</p>
<blockquote><p><span style="font-family: Arial;">The superiority of <strong>OpenBSD </strong> when it comes to security is legendary. The OpenBSD community continuously  do security audits of their codebase and their website proudly boasts  of having only <strong>two </strong>remote holes in the default install, in more  than 10 years!” <strong>PF </strong>is the default packet filter used in  OpenBSD from version 3.0 onwards.</span></p>
<p><span style="font-family: Arial;"><br />
</span></p>
<p><span style="font-family: Arial;">Having setup OpenBSD firewalls using <strong> PF</strong> in the past, I was interested in expanding my knowledge and this  tutorial provided the perfect opportunity for me to do so. The tutorial  was given by <strong>Peter M. Hansteen</strong>, who is a consultant, writer and  sysadmin based in Bergen, Norway, and also the author of the excellent  “<strong>The Book of PF</strong>“, published by <strong>No Starch Press</strong>.</span></p>
<p><span style="font-family: Arial;"><br />
</span></p>
<p><span style="font-family: Arial;">Peter started off by answering some common  questions that people might have about PF such as: Can I run it on Linux  (Answer: No, but some are trying). He recommended <strong>not</strong> trusting  any GUI tools, and simply using a text editor to edit <strong><em>pf.conf </em></strong> as that is simpler and faster. In addition, some tools claim to automatically  convert “other” firewall rules to PF, but he recommended implementing  a fresh PF config yourself.</span></p>
<p><span style="font-family: Arial;"><br />
</span></p>
<p><span style="font-family: Arial;">The first firewall I ever tried to configure  for my home network used <strong>iptables</strong>; when I had to implement one  in PF, I found it to be a breath of fresh air. I have always found the  concept of “<strong>chains</strong>” that iptables uses confusing. PF  doesn’t have any concept of a chain; you simply start your rules by  first “blocking everything”, then enabling the things you  need, one line after the other. Although in principle this sounds exactly  like what you are supposed to do with iptables, in practice the rules  you generate are much simpler, and easier to understand. </span></p>
<p><span style="font-family: Arial;"><br />
</span></p>
<p><span style="font-family: Arial;">Leading on from this, he showed examples  of how PF should be set up in an environment where you need a “<strong>gateway</strong>”  between 2 networks, and how to deal with problems faced by people who  try to use FTP from behind a NAT firewall (<strong>ftp-proxy</strong>). <strong>Tables </strong> and filtering by services (http, ftp, etc) were introduced next. A table  in PF is basically a list of IP addresses; listing them in a table makes  it easier to apply a single rule to a collection of hosts.</span></p>
<p><span style="font-family: Arial;"><br />
</span></p>
<p><span style="font-family: Arial;">Peter then moved on to the subject of  dealing with the huge volume of spam that besieges us all. The two main  concepts that he focused this section of the tutorial on were “<strong>tarpitting</strong>”  and “<strong>greylisting</strong>“. In tarpitting, when a blacklisted  host connects to you, you send replies to them very very slowly, let’s  say around 1 byte at a time. When doing greylisting, you <strong>lie</strong> to <strong>unknown</strong> connecting clients using SMTP <strong>45<em>n</em></strong> errors  (temporary local error). This usually thwarts spammers, who simply want  to quickly connect, deliver their payload and leave. Many spammers don’t  attempt to reconnect after seeing this error, while legitimate clients  will automatically retry after a short period of time. These legitimate  hosts are then added to a whitelist, which means that the next time  they try to connect, they will no longer be given a 45n temporary error,  their mail will be accepted immediately.</span></p>
<p><span style="font-family: Arial;"><br />
</span></p>
<p><span style="font-family: Arial;">We then got a look at how to thwart <strong> SSH</strong> <strong>bruteforce </strong>attacks by using <strong>rate-limiting</strong>, and  a short introduction to <strong>wireless networking</strong> in OpenBSD. The next  thing that Peter talked about, <strong>authpf</strong>, was quite interesting.  Basically users need to authenticate to authpf first; once authenticated,  only then is traffic generated by these users allowed to pass through  the firewall. Special rules can be setup specifically for authpf users.</span></p>
<p><span style="font-family: Arial;"><br />
</span></p>
<p><span style="font-family: Arial;">The next topic was load balancing and  Peter showed how to configure a “<strong>web server pool</strong>” using  PF. Requests to this pool were alternated using a form of round-robin.  To solve a common round-robin problem where machines in the pool go  down, you can use “<strong>hoststated</strong>“, which monitors the  state (up/down) of the certain specified hosts and compensates accordingly.  hoststated has been renamed to <strong>relayd</strong> in OpenBSD 4.3.</span></p>
<p><span style="font-family: Arial;"><br />
</span></p>
<p><span style="font-family: Arial;">You can <strong>tag</strong> incoming packets,  so you can quickly pass/block packets marked with a certain tag. Setting  up a OpenBSD <strong>bridge</strong> was discussed next. A bridge in this context  simply refers to a <strong>transparent</strong> firewall that sits between 2 or  more networks and filters packets at the link level.</span></p>
<p><span style="font-family: Arial;"><br />
</span></p>
<p><span style="font-family: Arial;">Using <strong>ALTQ</strong>, you can do bandwidth  allocation and traffic shaping. You can used <strong>class based queues </strong> (percent, kilo, or mega bytes), <strong>priority based</strong> or <strong>hierarchical  queues</strong>. In a class based queue, you can say for example that FTP  is only allowed 20% of your bandwidth.</span></p>
<p><span style="font-family: Arial;"><br />
</span></p>
<p><span style="font-family: Arial;">The last major aspect of PF that Peter  discussed was <strong>CARP (Common Address Redundancy Protocol)</strong> and <strong> pfsync</strong>. Put simply, CARP and pfsync allow you to setup 2 redundant  firewalls instead of 1, and in case one firewall fails, everything switches  over to the other firewall automatically. pfsync is used to keep the  rules between the 2 firewalls in sync.</span></p>
<p><span style="font-family: Arial;"><br />
</span></p>
<p><span style="font-family: Arial;">Overall, I am very pleased that I attended  this tutorial. Obviously I was familiar with some of the concepts, but  things like <strong>authpf</strong>, <strong>hoststated</strong> and <strong>CARP</strong> were completely  new to me. I will definitely use the things I learned here when considering  any OpenBSD based firewalling solutions in the future.</span></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.kerneljack.com/2008/04/24/openbsd-and-pf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
