<?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>OFF TOPIC! &#187; OpenBSD</title>
	<atom:link href="http://www.luizxx.com/archives/tag/openbsd/feed" rel="self" type="application/rss+xml" />
	<link>http://www.luizxx.com</link>
	<description>Luizxx Expansion Set</description>
	<lastBuildDate>Fri, 16 Jul 2010 04:13:27 +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>Configurando OpenNTPD no OpenBSD</title>
		<link>http://www.luizxx.com/archives/191</link>
		<comments>http://www.luizxx.com/archives/191#comments</comments>
		<pubDate>Thu, 08 Jan 2009 21:43:31 +0000</pubDate>
		<dc:creator>Luiz</dc:creator>
				<category><![CDATA[Unix / Linux]]></category>
		<category><![CDATA[NTP]]></category>
		<category><![CDATA[OpenBSD]]></category>

		<guid isPermaLink="false">http://luizxx.com/?p=191</guid>
		<description><![CDATA[É muito importante manter as máquinas da rede com o horário sincronizado e para a realização desta tarefa em sistemas Unix-Like normalmente utilizamos o próprio daemon do NTP que é bem completo e funcional, porém tem sua configuração um tanto quanto trabalhosa e um código complexo para auditoria. O OpenNTPD tem como objetivo tornar a [...]]]></description>
			<content:encoded><![CDATA[<p>É muito importante manter as máquinas da rede com o horário sincronizado e para a realização desta tarefa em sistemas Unix-Like normalmente utilizamos o próprio daemon do NTP que é bem completo e funcional, porém tem sua configuração um tanto quanto trabalhosa e um código complexo para auditoria.</p>
<p>O OpenNTPD tem como objetivo tornar a administração deste serviço mais simples, segura e flexível apresentando alta-performance, baixissimo consumo de recursos e com configurações mais triviais e otimizadas.</p>
<p>Para configurar um servidor OpenNTPD rodando sobre plataforma OpenBSD é necessário inicializar o servico automaticamente durante o boot (lembre-se que isso pode ter sido feito diretamente na instalação) adicionando a seguinte entrada no arquivo /etc/rc.conf.local:</p>
<p><em>&#8220;ntpd_flags=&#8221;</em></p>
<p>Para configurar os servidores onde o daemon vai manter o sincronismo, simplesmente edite o arquivo de configuração principal (/etc/ntpd.conf) e adicione a seguinte linha para cada servidor:</p>
<p>server servidor.ntp.publico</p>
<p>Ou então adicione um pool de servidores com a diretiva <em>servers</em>:</p>
<p>servers pool.ntp.org</p>
<p>Por padrão o OpenNTPD é somente um cliente para atualização local, para utilizá-lo como servidor NTP ouvindo em todos os IPs da máquina adicione a seguinte linha no /etc/ntp.conf:</p>
<p>listen on *</p>
<p><em>Para habilitar o serviço para um IP específico substitua o &#8220;*&#8221; pelo IP utilizado.</em></p>
<p>Segue um exemplo básico de configuração do OpenNTPD sincronizando com os servidores do NTP.br trabalhando como servidor:</p>
<blockquote><p><em># $OpenBSD: ntpd.conf, 2009/01/08 19:41$<br />
</em></p>
<p><em>listen on *</em></p>
<p><em>server a.ntp.br<br />
server b.ntp.br<br />
server c.ntp.br</em></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.luizxx.com/archives/191/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blocking SSH attacks on OpenBSD</title>
		<link>http://www.luizxx.com/archives/181</link>
		<comments>http://www.luizxx.com/archives/181#comments</comments>
		<pubDate>Wed, 03 Sep 2008 19:26:58 +0000</pubDate>
		<dc:creator>Luiz</dc:creator>
				<category><![CDATA[Unix / Linux]]></category>
		<category><![CDATA[OpenBSD]]></category>

		<guid isPermaLink="false">http://luizxx.com/?p=181</guid>
		<description><![CDATA[When we have a system directly connected to the internet and with the SSHd running on port 22, brute-force and dictionary attacks are inevitable. Even with a strong password, our authlogs are filled with useless information and the authentication daemon doesn&#8217;t stop processing requests from the attacker. On Linux based servers we have very good [...]]]></description>
			<content:encoded><![CDATA[<p>When we have a system directly connected to the internet and with the <em>SSHd</em> running on port 22, <em>brute-force</em> and <em>dictionary </em>attacks are inevitable. Even with a strong password, our <em>authlogs</em> are filled with useless information and the authentication daemon doesn&#8217;t stop processing requests from the attacker.</p>
<p>On Linux based servers we have very good tools to avoid this problem, like DenyHosts and Fail2ban, but on OpenBSD we can directly use the PF (PacketFilter) to manage the SSH new connections on the server avoiding this kind of attacks coming from the internet and improving security on the server.</p>
<p>The pf rule I used to manage the connections is very simple and clean, but you can make changes according to your own environment.</p>
<pre>pass in on $ext_if proto tcp from any to ($ext_if) port 22 \
  flags S/SA keep state \
  (max-src-conn-rate 3/30, overload &lt;ssh-blacklist&gt; flush global)
block drop in quick on $ext_if from &lt;ssh-blacklist&gt;</pre>
<p>First we classify our attackers using the &#8220;<em>max-src-conn-rate&#8221; </em>, that in this example classify any hosts trying to connect 3 times in a period of 30 seconds. When the attacker is classified, his IP address is written on the ssh-bla<em>cklist</em> table, and finally we drop packages coming from the hosts classified.</p>
<p>Well, we don&#8217;t need this hosts banned forever so we can use the <em><a href="http://expiretable.fnord.se/" target="_blank">expiretable</a> </em>program (present on OpenBSD Ports) to manage the registrations on our table and remove the entries after some time blocked. To do this we can simply run expiretable as a daemon:</p>
<pre>/usr/local/sbin/expiretable -d -t 3600 ssh-blacklist</pre>
<p>Where 3600 means seconds, on the lastest versions the time can be specified using the sulfixes <em>s, h, m and d</em> like <em>&#8220;1h30m&#8221;</em>.</p>
<p>If you prefer, just add an entry on your crontab to make the checks automatically:</p>
<pre>*/5 * * * * /usr/local/sbin/expiretable -t 3600 ssh-blacklist</pre>
<p style="text-align: right;"><em>Thanks to <a href="http://johan.fredin.info/openbsd" target="_blank">Johan Fredin</a> for the tip!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.luizxx.com/archives/181/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
