<?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/"
	>

<channel>
	<title>The previous statement is false.</title>
	<atom:link href="http://blog.synlapse.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.synlapse.com</link>
	<description>Technical blog and rantwagon.</description>
	<pubDate>Thu, 14 Jun 2007 08:12:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Pics from my new camera</title>
		<link>http://blog.synlapse.com/?p=10</link>
		<comments>http://blog.synlapse.com/?p=10#comments</comments>
		<pubDate>Sat, 09 Jun 2007 09:25:20 +0000</pubDate>
		<dc:creator>tom</dc:creator>
		
		<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://blog.synlapse.com/?p=10</guid>
		<description><![CDATA[I recently got a Canon Rebel XTi, just wanted to share some pics.  After having only a point and shoot for so long, I am enamored with depth of field.
My pajamas:

Some pictures from Julian:




]]></description>
			<content:encoded><![CDATA[<p>I recently got a Canon Rebel XTi, just wanted to share some pics.  After having only a point and shoot for so long, I am enamored with depth of field.</p>
<p>My pajamas:<br />
<img src="http://www.synlapse.com/pictures/Picture-001.jpg" alt="" /></p>
<p>Some pictures from Julian:<br />
<img src="http://www.synlapse.com/pictures/Picture-036.jpg" alt="" /></p>
<p><img src="http://www.synlapse.com/pictures/Picture-054.jpg" alt="" /></p>
<p><img src="http://www.synlapse.com/pictures/Picture-071.jpg" alt="" /></p>
<p><img src="http://www.synlapse.com/pictures/Picture-090.jpg" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.synlapse.com/?feed=rss2&amp;p=10</wfw:commentRss>
		</item>
		<item>
		<title>VPNs and You: 2 - Configuring the OpenVPN client</title>
		<link>http://blog.synlapse.com/?p=9</link>
		<comments>http://blog.synlapse.com/?p=9#comments</comments>
		<pubDate>Sun, 01 Oct 2006 09:50:03 +0000</pubDate>
		<dc:creator>tom</dc:creator>
		
		<category><![CDATA[Networking]]></category>

		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.synlapse.com/?p=9</guid>
		<description><![CDATA[If you followed part one of this series, VPNs and You: 1 - Providing secure remote access with OpenVPN, then you should have a ready-to-use OpenVPN server, so all we need now is the client.  Fortunately for us the client configuration is even easier than the server configuration, so before you know it you&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>If you followed part one of this series, <i><a href="http://blog.synlapse.com/?p=4#more-4">VPNs and You: 1 - Providing secure remote access with OpenVPN</a></i>, then you should have a ready-to-use OpenVPN server, so all we need now is the client.  Fortunately for us the client configuration is even easier than the server configuration, so before you know it you&#8217;ll have a fully functioning VPN setup&#8230;</p>
<p><span id="more-9"></span></p>
<p>As stated before, I am going to assume a windows client as this is the most common scenario, if you are using another OS please adjust instructions as necessary.  For windows we need the client itself, and for convenience a nice GUI to go on top of it.  The most common package (and the best I&#8217;ve seen) is Mathias Sundman&#8217;s combined <a href="http://www.openvpn.se/" target="_blank">OpenVPN/GUI install</a>, be sure to get the combined package and not the GUI only download.  Install it, reboot if necessary.</p>
<p>Once OpenVPN is installed we need to add the SSL certs we created in the first section of this guide.  These must be transported securely from the server to the client, if not your VPN&#8217;s security is compromised.  Assuming the default install directory, copy <i>ca.crt</i>, <i>ta.key</i>, and your client-specific certs (say <i>client.crt</i> and <i>client.key</i>) to the<br />
<code>c:\Program Files\OpenVPN\config</code> directory.</p>
<p>Next, we need to create a config file (client.ovpn) in the same directory with the following contents:</p>
<pre><code>client
dev tun
proto udp
remote vpn.example.com 1194
nobind
persist-key
persist-tun
ca   ca.crt
cert client.crt
key  client.key
ns-cert-type server
tls-auth ta.key 1
cipher BF-CBC
comp-lzo
verb 6
mute 20

replay-window 256
mssfix 1260
;fragment 1260

;Uncomment below if you are using openvpn-auth for two-factor authentication
;auth-user-pass</code></pre>
<p>If you&#8217;ve followed the guide carefully, you should now be ready to connect to your VPN server.</p>
<p>Double-clicking the OpenVPN icon in the system tray should automatically launch OpenVPN with the client.ovpn configuration, and before you know it you should be securely connected to the server.  If you have been successfully connected you will have a virtual tunnel set up between you and the server.  Running <code>ipconfig</code> should show that your virtual tunnel device is connected and has an IP assigned.  Try pinging the server on the other end of the tunnel (the default gateway shown from ipconfig) - if you get a response you&#8217;re in business.</p>
<p>At this point we have a secure VPN connection, but it can be improved upon, which I will cover in part three of this series, <i><a href="http://blog.synlapse.com/?p=10#more-10">VPNs and You: 3 - Hardening your OpenVPN solution</a></i>.</p>
<p>Trouble-shooting:</p>
<p>If OpenVPN is having trouble contacting the server, make sure the server name is right in the config file, and that the server is running.  If both of these are fine then you probably have a firewall issue (either on the local client, the server, or both).  Also, if you are connecting to the server fine, but cannot connect to the machines behind the openvpn server, you may have other firewall  issues or routing problems.  For any of these (or other similar) issues, please see part four of this series, <i><a href="http://blog.synlapse.com/?p=11#more-11">VPNs and You: 4 - Tweaking firewall and network settings</a></i> for solutions.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.synlapse.com/?feed=rss2&amp;p=9</wfw:commentRss>
		</item>
		<item>
		<title>Started using Notable - Ended up Creating New Version</title>
		<link>http://blog.synlapse.com/?p=7</link>
		<comments>http://blog.synlapse.com/?p=7#comments</comments>
		<pubDate>Thu, 03 Aug 2006 09:20:10 +0000</pubDate>
		<dc:creator>tom</dc:creator>
		
		<category><![CDATA[Blogging]]></category>

		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://blog.synlapse.com/?p=7</guid>
		<description><![CDATA[So I wanted some blog-posting shortcuts, and after a little searching it seemed that Notable was one of the most common, so I downloaded and installed it.  It worked alright, but I had some gripes:

page was no longer valid XHTML due to some unencoded &#038;s and reused object IDs
icons were not all the same [...]]]></description>
			<content:encoded><![CDATA[<p>So I wanted some blog-posting shortcuts, and after a little searching it seemed that <a href="http://www.calevans.com/view.php/page/notable" target="_blank">Notable</a> was one of the most common, so I downloaded and installed it.  It worked alright, but I had some gripes:</p>
<ul>
<li>page was no longer valid XHTML due to some unencoded &#038;s and reused object IDs</li>
<li>icons were not all the same size</li>
<li>no way to display text along with the icons</li>
<li>no slashdot submission support</li>
<li>ability to use blog categor(y|ies) in submission URLs, for tag fields for instance</li>
</ul>
<p>I ended up fixing these myself, and in the hope that others will want these fixes/features I am making the new version available for download.</p>
<div class="project_download"><a href="http://blog.synlapse.com/code/notable/wp-notable.tgz">DOWNLOAD NOTABLE v1.141</a></div>
<p>Installation directions can be assumed to be the same as the official v1.14 release.</p>
<p>Read on for details of what was changed . . .</p>
<p><span id="more-7"></span></p>
<p>I probably should have tried <a href="http://push.cx/sociable" target="_blank">Sociable</a>, but I didn&#8217;t, besides it would only have solved the first item, although adding sites in Sociable looks easier than adding them in Notable.  Regardless, I didn&#8217;t try Sociable, I just did it myself.  After some confusion about why my changes weren&#8217;t effecting anything (notable stores its settings in the blog DB, so changes in the script did nothing), things went pretty smoothly.</p>
<p>My first tactic for dealing with the DB issue was to delete the DB info to force it to read from the script again (not great), but I happened to run into <a href="http://davidseah.com/archives/2006/06/29/social-bookmarking-twiddling/" target="_blank">someone else&#8217;s blog</a> who was hacking on Notable also, and who had fixed this issue cleanly, so I stole his solution for that (Thanks Dave!).  I also noticed that he had wanted text along with his icons as well, but he did it by adding the text to each icon - I wanted something more user-definable, something flexible.</p>
<p>Fixing the XHTML validation stuff was easy, just replaced the &#038;s with <code>&amp;s</code> where appropriate, and removed the IDs completely on the span classes.  It would have been fairly easy to make them unique, but I really didn&#8217;t see a reason why they needed specific IDs anyway, so I just yanked &#8216;em.</p>
<p>Resizing the icons so they were all 16&#215;16.  Some I did manually, but most I just took directly from the different sites&#8217; <i>favicon.ico</i>s.</p>
<p>Next I added some options to the Notable option panel to allow user-input text for any site, and created some code to handle displaying it (and wrapping it in a wp-notable_text span class so you can CSS it however you like).</p>
<p>I added slashdot as an option, easy with the DB issue fixed.</p>
<p>Finally, I added some code to replace {{category}} with the categor(y|ies) the story is filed under (multiple categories are comma separated).  I did not add this to all of the submission URLs of sites that could potentially take advantage of this (in fact I only did it for slashdot), but it is easy to do in the wp-notable.php file.</p>
<p>I also cooked up some CSS (also partly stolen from David Seah, CSS is not my strong suit) to present the icons and text cleanly.  My relevent CSS entries are:</p>
<pre><code>
/* WP NOTABLE ADDONS */

.notable {
	width: 100%;
	border-top: 1px dotted #ccc;
	margin-top: 16px;
	padding-top: 3px;
}

.wp-notable-line {
	line-height:16px;
}

.wp-notable {
	float: left;
	padding-right: 8px;
	opacity: .50;
}

.wp-notable:hover {
	opacity: 1.0;
}

.wp-notable_image {
	vertical-align: bottom;
	border: none;
}

.wp-notable_text {
    font-family: small fonts, arial;
    font-size: 7pt;
    padding-left: 1px;
}

.wp-notable a:link    { color: black; text-decoration: none; }
.wp-notable a:visited { color: black; text-decoration: none; }

/* END WP NOTABLE */
</code></pre>
<p>Important note, with the &#8220;float: left&#8221; specified above it is important that you change the icon separator in the notable options to &#8220;no space&#8221;, otherwise you&#8217;re icons will all float to the left.</p>
<p>This CSS makes the icons 50% transparent in firefox and other browsers, turning them fully visible on mouse-over.  For IE, however, they stay fully visible the whole time.  I wasn&#8217;t able to get IEs alpha filter to work with the roll-over in the same manner, so I opted to make them always visible for IE.</p>
<p>I intend to submit my changes to the creator of Notable, but for now feel free to comment with questions or problems here.</p>
<p>-Tom</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.synlapse.com/?feed=rss2&amp;p=7</wfw:commentRss>
		</item>
		<item>
		<title>Secure WinAmp Playlist Updates</title>
		<link>http://blog.synlapse.com/?p=6</link>
		<comments>http://blog.synlapse.com/?p=6#comments</comments>
		<pubDate>Mon, 12 Jun 2006 10:41:35 +0000</pubDate>
		<dc:creator>tom</dc:creator>
		
		<category><![CDATA[Audio]]></category>

		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.synlapse.com/?p=6</guid>
		<description><![CDATA[So I wanted a nifty &#8220;Now Playing&#8221; box on the side of my blog, but I wanted to do it securely.
I found a WinAmp plug-in called Do-Something which looked promising, at the start of any new song it would do any (or any chain) of several actions.  Most notable to me was submit a [...]]]></description>
			<content:encoded><![CDATA[<p>So I wanted a nifty &#8220;Now Playing&#8221; box on the side of my blog, but I wanted to do it securely.</p>
<p>I found a WinAmp plug-in called <a title="Do-Something" target="_blank" href="http://www.oddsock.org/tools/dosomething/">Do-Something</a> which looked promising, at the start of any new song it would do any (or any chain) of several actions.  Most notable to me was submit a URL.  The idea was simple enough, submit a url with the artist and song name (these it gets from the file tag), and a shared password, to a CGI script on the web server.  The CGI would then update some file used in a SSI by the page, and poof, &#8220;Now Playing&#8221; would be up and running.  Unfortunately, this simple method is not very secure&#8230;</p>
<p><span id="more-6"></span><br />
Anyone able to sniff network traffic between the server and my computer could see the password in plain text and then submit anything they like to the CGI.  Not only could this be used as method to post arbitrary code into my blog (XSS for instance), they could also do something really serious like post that I&#8217;m listening to John Tesh.  In light of that, I set out to solve this old problem in the usual way: transmit a hash instead of the password. There is one additional step we will need to add for this method to be truly secure however, which I will discuss after I introduce the basics:</p>
<p>Take the ARTIST, the song TITLE, and your PASSWORD, and combine them together as follows:</p>
<p>Ex:<br />
ARTIST: <font style="color: blue">Weezer</font><br />
TITLE: <font style="color: green">Freak Me Out</font><br />
PASSWORD: <font style="color: red">ReplaceWithSecurePassword</font></p>
<p>OUTPUT: <font style="color: blue">Weezer</font><font style="color: green">Freak Me Out</font><font style="color: red">ReplaceWithSecurePassword</font></p>
<p>Now we take that OUTPUT, hash it with a strong hash function (say SHA1), and get:</p>
<p>HASHOUTPUT: 5c87ac46e7714c579c9e6401a049eb7fb635ad19</p>
<p>Now we send the TITLE, ARTIST, and HASHOUTPUT.  The receiving CGI already knows the password, so it takes the ARTIST and TITLE you sent, and PASSWORD it knows, and hashes them and verifies that the HASHOUTPUT it calculates matches the HASHOUTPUT you sent.  If it does, then all is good and it updates the &#8220;Now Playing&#8221; file, otherwise it ignores the request.</p>
<p>A few important things to note about this method:</p>
<ul>
<li>It does not reveal the password in plaintext as the original method did - Well that was the point wasn&#8217;t it?</li>
<li>It uses a hash of the artist, song, and password, instead of just a hash of the password - this is important.  If you don&#8217;t use the artist and title in the hash then the attacker doesn&#8217;t need the password anyway!  The hash of the password alone won&#8217;t change.   He can simply submit whatever artist, whatever title, and then use the same hash he captured from you earlier as it will not have changed.  Concatennating the password with the other info serves to hide the password and ensure that a captured hash does no good to a would-be attackers.</li>
<li>If you follow the second point carefully, it leads to a weakness in the above method.  We can be (almost totally) certain that no two songs are going to give us the same hash output, but by the above method we are absolutely guaranteed that the same song will always give the same hash.  This is a problem.  This means that although an attacker can&#8217;t submit random songs/artists, he can resend previous submissions and they will be accepted.  Essentially, any valid submission we send will ALWAYS be valid, and therefore always honored.  This leads to what is called a &#8220;replay&#8221; attack: the attacker can resend any submission we&#8217;ve made and it will be successful.</li>
</ul>
<p>The solution to a replay attack is an expiry (experation date), or in this case a timestamp.  We make a slight modification to our previous method and include the current time:</p>
<p>Ex:<br />
ARTIST: <font style="color: blue">Weezer</font><br />
TITLE: <font style="color: green">Freak Me Out</font><br />
TIME: <strong>1150106145</strong> (in readable form 6/12/2006 02:55:45)<br />
PASSWORD: <font style="color: red">ReplaceWithSecurePassword</font></p>
<p>OUTPUT: <font style="color: blue">Weezer</font><font style="color: green">Freak Me Out</font><strong>1150106145</strong><font style="color: red">ReplaceWithSecurePassword</font></p>
<p>Now we hash that output as before:<br />
HASHOUTPUT: 269022a985c8df4dc343e007d4ae8c0340ee71e9</p>
<p>Because this new hash is time dependent, if we do this calculation one second later we will get a completely different result.  By sending the timestamp along in the submission, the CGI can use it to check that its hash output matches and that the time is reasonably close to the current time (say within a few seconds to a few minutes depending on your time synchronization).  After that time is up the captured hash does no good to the attacker, any replay he makes will be rejected as its valid time window has expired.</p>
<p>We now have a fully functional cryptographic method, but implementing it is now harder.  The &#8220;Do Something!&#8221; plug-in does not support hashing, timestamps, etc&#8230; so we&#8217;re going to have to do that ourselves.  What is does support is outputting a file with the ARTIST and TITLE at the start of each song, and it supports executing commands, so we&#8217;re going to have it output this file, then execute a program we write which will get the ARTIST and TITLE from that file, then do the required hashing and submit the information to our CGI.</p>
<p>We first set up the &#8220;Generate HTML Playlist&#8221; action in &#8220;Do Something!&#8221;  This action asks for a template in and an output file.  We first create a template containing simply <code>%%CURRENTARTIST%%::%%CURRENTSONGTITLE%%</code> and set the template in to that file.  You can then choose any output file you want, just make sure you know where it is, you&#8217;ll need to put its location in the submission file so it knows where to get its info from.  Be sure to &#8220;Add&#8221; this action when you finish setting it up.<br />
Next we add a &#8220;Run A Command&#8221; action, containing simply the path to our submission program (submitsong.pl) posted below.  Add this and hit &#8220;OK.&#8221;  Set up the files below and you&#8217;re done!<br />
The files:</p>
<p>submitsong.pl: - Client side perl script to submit info</p>
<pre><code>use strict;
use warnings;

use Digest::SHA1 "sha1_hex";
use HTTP::Request;
use LWP::UserAgent;

my $file = 'c:\temp\songlist';

my $url = "http://www.yourblog.com/nowplaying/song.php?";

my $PSK = "ReplaceWithSecurePassword";

open(FILE, "<$file") or die "Unable to open input file!";

my $line = <FILE>;
chomp $line;

my ($artist, $song) = split(/::/, $line,2);

close FILE;

my $timestamp = time();

my $sha1sum = sha1_hex($artist . $song . $timestamp . $PSK);

&#038;clean(\$artist);
&#038;clean(\$song);

my $request = HTTP::Request->new(GET => $url . "a=$artist" . "&#038;" . "s=$song" . "&#038;" . "t=$timestamp" . "&#038;" . "h=$sha1sum");
my $ua = LWP::UserAgent->new;
my $response = $ua->request($request);

if ($response->is_success) {
  print $response->content . "\n";
}
else {
	print $response->status_line . "\n";
}

exit();

sub clean {
	my $sr = shift;
	$$sr =~ s/#/%23/g;
	$$sr =~ s/\$/%24/g;
	$$sr =~ s/&#038;/%26/g;
	$$sr =~ s/\+/%2B/g;
	$$sr =~ s/\,/%2C/g;
	$$sr =~ s/\//%2F/g;
	$$sr =~ s/:/%3A/g;
	$$sr =~ s/;/%3B/g;
	$$sr =~ s/=/%3D/g;
	$$sr =~ s/\?/%3F/g;
	$$sr =~ s/@/%40/g;
}</code></pre>
<p>song.php: - Server side CGI to process and verify song submission</p>
<pre><code><?php

$PSK = "ReplaceWithSecurePassword";
$tolerance = 10;

function clean($input) {
    $input = substr($input, 0, 255);
    if (ereg('^[-a-zA-Z0-9_\.\+\*\?\$\,\/=:;!@#&#038;\(\)[.[.][.].]\' ]+$', $input)) {
        return $input;
    }
    return "";
}

$artist = $_GET['a'];
$song = $_GET['s'];
$timestamp = $_GET['t'];
$sha1sum = $_GET['h'];

Header("Content-type: text/plain");
Header("Cache-Control: no-store, no-cache");

$artist = &#038;clean($artist);
$song = &#038;clean($song);

if (!ereg('^[0-9]{10}$', $timestamp)) {
   print "Timestamp invalid!\n";
   $timestamp = "";
}

if (!ereg('^[0-9a-f]{40}$', $sha1sum)) {
   print "SHA1 hash invalid!\n";
   $sha1sum = "";
}

if ( !$artist || !$song || !$timestamp || !$sha1sum ) {
   print "Required field(s) are missing or invalid\n";
   exit;
}

if ( abs(time() - $timestamp) > $tolerance ) {
   print "Timestamp is outside tolerance\n";
   exit;
}

if (sha1($artist . $song . $timestamp . $PSK) != $sha1sum) {
   print "SHA1 sum did not match\n";
   exit;
}

if ( $logfp = @fopen("song.txt", "w") ) {
    fwrite($logfp, $artist . " - " . $song . "\n");
    fclose($logfp);
}

if ( $logfp = @fopen("artist.txt", "w") ) {
    fwrite($logfp, $artist);
    fclose($logfp);
}

if ( $logfp = @fopen("title.txt", "w") ) {
    fwrite($logfp, $song);
    fclose($logfp);
}

?></code></pre>
<p>If all goes well then song.php will make several files:</p>
<p>song.txt - Contains &#8220;ARTIST - TITLE&#8221;, useful if you want this common format.<br />
artist.txt - Contains ARTIST<br />
title.txt - Contains TITLE</p>
<p>These last two can be used to present them individually however you&#8217;d like.</p>
<p>Now all we need is to display them in the page and we are done.  This can be done as:</p>
<p>SSI style:<br />
<code><!--#include virtual="/song/song.txt" -->;</code></p>
<p>Script style:<br />
<code><?php print file_get_contents("artist.txt"); print "<BR />&#8220;; print file_get_contents(&#8221;title.txt&#8221;);?></code></p>
<p>You now have your own secure &#8220;Now Playing&#8221; section!</p>
<p>A few notes:</p>
<ul>
<li>SHA1 is not truly secure anymore, but attacks on it are still hugely computationally intensive - much more work than breaking into your &#8216;Now Playing&#8217; list would be worth.  In the future, improvements and new attack vectors may make this a more realistic threat, but ostensibly by then you could simply use a different hash function in the files above (it would only be a line or two of code to change in each).</li>
<li>DoSomething is not great.  It only works with mp3s, only looks at version 1 ID3 tags, opens an annoying system console window, and is generally ill-suited to this application.  If anyone knows of a better plug-in please let me know, and if I ever get really fed up with it I may just write my own.</li>
<li>Should go without saying, but be sure to replace the password &#8220;ReplaceWithSecurePassword&#8221; with a secure password, and one roughly the same length (or longer).</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.synlapse.com/?feed=rss2&amp;p=6</wfw:commentRss>
		</item>
		<item>
		<title>It is so choice.</title>
		<link>http://blog.synlapse.com/?p=5</link>
		<comments>http://blog.synlapse.com/?p=5#comments</comments>
		<pubDate>Sat, 27 May 2006 22:18:34 +0000</pubDate>
		<dc:creator>tom</dc:creator>
		
		<category><![CDATA[Rave]]></category>

		<guid isPermaLink="false">http://blog.synlapse.com/?p=5</guid>
		<description><![CDATA[
Just thought I&#8217;d take a second to say -&#8221;I mean, SunMilk man!  Wow.   SunMilk&#8230; you know?   Wow.&#8221;
Basically they take nonfat milk and add sunflower oil, and you end up with milk that tastes almost like whole milk but is much better for you (1% fat, unsaturated).  I find that [...]]]></description>
			<content:encoded><![CDATA[<div style="text-align: center; padding-bottom: 10px"><a target="_blank" href="http://www.sunmilk.com/"><img title="Sunmilk!" alt="Sunmilk!" src="http://www.sunmilk.com/images/nutr_main1.gif" /><img title="Sunmilk!" alt="Sunmilk!" src="http://www.sunmilk.com/images/nutr_main2.gif" /></a></div>
<p>Just thought I&#8217;d take a second to say -&#8221;I mean, SunMilk man!  Wow.   SunMilk&#8230; you know?   Wow.&#8221;</p>
<p>Basically they take nonfat milk and add sunflower oil, and you end up with milk that tastes almost like whole milk but is much better for you (1% fat, unsaturated).  I find that if I mix it ~3:1 with nonfat milk it still tastes better than normal 1% milk, and has: less sugar, less calories, less cholesterol, less fat (and it&#8217;s unsaturated vs. saturated), and more protein.  Plus it tastes good.</p>
<p>The only downside is the cost, it&#8217;s kinda expensive (like $3.50 for a half gallon), which is actually the main reason I do the 3:1 thing, stretches it out.</p>
<p>If you have the means, I highly recommend picking some up.   <a title="Sunmilk Retailer Finder" target="_blank" href="http://www.sunmilk.com/retailer.htm">Find some in your area!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.synlapse.com/?feed=rss2&amp;p=5</wfw:commentRss>
		</item>
		<item>
		<title>VPNs and You: 1 - Providing secure remote access with OpenVPN</title>
		<link>http://blog.synlapse.com/?p=4</link>
		<comments>http://blog.synlapse.com/?p=4#comments</comments>
		<pubDate>Thu, 25 May 2006 09:02:42 +0000</pubDate>
		<dc:creator>tom</dc:creator>
		
		<category><![CDATA[Networking]]></category>

		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.synlapse.com/?p=4</guid>
		<description><![CDATA[First things first, why not IPSEC you ask?  Long story short, most IPSEC implementations suck.  However, directly contrary to that statement, I will be using OpenBSD in this article, and OpenBSD has a truly excellent IPSEC implementation.  So, why not use IPSEC?  Because *most* IPSEC implementations suck!  If both ends [...]]]></description>
			<content:encoded><![CDATA[<p>First things first, why not IPSEC you ask?  Long story short, most IPSEC implementations suck.  However, directly contrary to that statement, I will be using OpenBSD in this article, and OpenBSD has a truly excellent IPSEC implementation.  So, why not use IPSEC?  Because *most* IPSEC implementations suck!  If both ends of our VPN were OpenBSD, or professional-level homogenius hardware solutions, then IPSEC could be ideal.  Secure, high-speed, reliable, you name it - when IPSEC is done right it can be extremely powerful.</p>
<p>However, for remote access for employees, we need to assume the worst case, the worst case being Windows.  Windows XP has an IPSEC implementation, I mean, in theory.  In reality it is so craptacular that almost everyone uses either the SafeNet client or the Cisco client, both are quite good, both are not free.  To be more specific, Cisco&#8217;s client is technically free, but only in combination with purchase of their hardware, which is significantly less free.</p>
<p>Enter <a title="OpenVPN Homepage" target="_blank" href="http://openvpn.net/">OpenVPN</a>, a free, open source, SSL based VPN solution for nearly any OS you can think, and of particular import to this discussion - a very good Windows client and a very good OpenBSD server.  If you have any history with VPNs, then SSL may set off alarm bells for you as there are a number of crappy web-based SSL VPN solutions around. Don&#8217;t be worried, OpenVPN is NOT web based.</p>
<p>Here&#8217;s the basics:</p>
<ul>
<li>OpenVPN is an SSL VPN, again, please note that SSL != WEB BASED</li>
<li>It works similarly to IPSEC, but is not compatible, as the cumbersome IKE algorithm is replaced with SSL/TLS</li>
<li>Supports two-factor authentication (HIPAA compliance requirement)</li>
<li>Relatively easy to install and manage</li>
<li>It plays well with OpenBSD (ported at /usr/ports/net/openvpn)</li>
<li>The Windows client GUI is solid and easy to use</li>
</ul>
<p>Note: I love OpenBSD.   I prefer to use it for any internet facing server unless there is a compelling reason not to, hence ability to play well with OpenBSD was a requirement for me.</p>
<p>Installation is a breeze, <code>/usr/ports/net/openvpn/make install</code> and you&#8217;re done.</p>
<p>Initial configuration is covered thoroughly in the very clear <a target="_blank" title="OpenVPN HOW-TO" href="http://openvpn.net/howto.html">Official HOW-TO</a>, but here&#8217;s the basics:</p>
<p><span id="more-4"></span></p>
<pre><code># mkdir -p /etc/openvpn/keys
# cp -r /usr/local/share/examples/openvpn/easy-rsa /etc/openvpn
# chown -R root:wheel /etc/openvpn
# chmod 700 /etc/openvpn/keys
# cd /etc/openvpn/easy-rsa
# . ./vars
# ./clean-all
# ./build-ca
# ./build-key-server server
# ./build-key client1
# ./build-key client2 etc.
# ./build-dh
# /usr/local/sbin/openvpn --genkey --secret ta.key
# cd keys
# mv ca.crt dh1024.pem server.crt server.key ta.key /etc/openvpn/keys
# chmod 644 /etc/openvpn/keys/{ca.crt,dh1024.pem,server.crt}
# chmod 600 /etc/openvpn/keys/{server.key,ta.key} </code></pre>
<p>ca.crt, ta.key, and your client.crts and client.keys should now be ready for secure distribution to your clients.</p>
<p>Next, we create the server configuration file /etc/server.conf:</p>
<pre><code>daemon openvpn
writepid /var/openvpn/pid
status /var/openvpn/status 10
log-append /var/openvpn/openvpn.log
local YOUR_IP
port 1194
proto udp
dev tun0

ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key
dh /etc/openvpn/keys/dh1024.pem

server 10.8.0.0 255.255.0.0
push "route 192.168.1.0 255.255.255.0"
push "dhcp-option DNS YOUR_DNS_SERVER"
push "dhcp-option WINS YOUR_WINS_SERVER"
push "redirect-gateway def1"
push "inactive 1800"

ifconfig-pool-persist /var/openvpn/ipp.txt
keepalive 10 120
inactive 1800
tls-auth /etc/openvpn/keys/ta.key 0
cipher BF-CBC
max-clients 8
user _openvpn
group _openvpn
persist-key
persist-tun
verb 6
mute 20
comp-lzo
tmp-dir /tmp
chroot /var/empty

replay-window 256
mssfix 1260
;fragment 1260

;Uncomment below if you are using openvpn-auth for two-factor authentication
;auth-user-pass-verify ./openvpn-auth via-file</code></pre>
<p>Now we create the _openvpn user and group, the /var/openvpn directory, and the tunnel interface:</p>
<pre><code># groupadd -g 500 _openvpn
# useradd -u 500 -g 500 -c 'OpenVPN Server' -s /sbin/nologin -d /var/openvpn -m _openvpn
# echo 'link0 up' > /etc/hostname.tun0
# sh /etc/netstart tun0
</code></pre>
<p>We are now ready to try our OpenVPN server - launch by:</p>
<p><code>/usr/local/sbin/openvpn /etc/openvpn/server.conf</code></p>
<p>Check <code>/var/log/daemon</code> and <code>/var/openvpn/openvpn.log</code> for errors and add the following to <code>/etc/rc.local</code> to make OpenVPN start on boot:</p>
<pre><code>if [ -x /usr/local/sbin/openvpn ]; then
    /usr/local/sbin/openvpn --config /etc/openvpn/server.conf
fi</code></pre>
<p>The server should now be ready, so we just need a client, which we will cover in part two of this series.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.synlapse.com/?feed=rss2&amp;p=4</wfw:commentRss>
		</item>
	</channel>
</rss>
