{"id":1489,"date":"2013-04-23T23:48:28","date_gmt":"2013-04-24T06:48:28","guid":{"rendered":"http:\/\/gregbaker.ca\/blog\/?p=1489"},"modified":"2013-05-05T00:55:14","modified_gmt":"2013-05-05T07:55:14","slug":"network-sanitization","status":"publish","type":"post","link":"http:\/\/gregbaker.ca\/blog\/2013\/04\/23\/network-sanitization\/","title":{"rendered":"Network Sanitization"},"content":{"rendered":"<p>I have been spending a fair amount of time working in coffee shops in Hangzhou. The culture seems to be that buying a coffee also buys me several hours sitting in a table doing whatever I damned well please. It&#8217;s a nice change of scenery from my apartment. They usually have wi-fi, but it would be pragmatic to assume that whatever traffic goes over that connection is beamed directly to a billboard outside. I generally feel the same way about hotel internet, free airport wi-fi, and other dodgy connections: I just don&#8217;t trust that they have any interest in protecting my privacy.<\/p>\n<p>I really want to encrypt all of my traffic over those links. I always encrypted my mail client connections anyway, and SSH is inherently encrypted. That really leaves my browser as the weak link in my average-day networking.<\/p>\n<p>After considering some options, I ended up with just about the simplest solution, although it does take touch of technical know-how to get going. The basic idea is that <a href=\"http:\/\/embraceubuntu.com\/2006\/12\/08\/ssh-tunnel-socks-proxy-forwarding-secure-browsing\/\">SSH can provide an encrypted SOCKS server<\/a>. Using it basically involves setting my browser to <a href=\"https:\/\/calomel.org\/firefox_ssh_proxy.html\">use the SOCKS tunnel for everything<\/a>, and starting up the SOCKS tunnel with a command like this:<\/p>\n<blockquote><p><code>ssh -C -D 1080 userid@someserver.example.com<\/code><\/p><\/blockquote>\n<p>It&#8217;s also possible to do this on <a href=\"http:\/\/vectrosecurity.com\/content\/view\/67\/26\/\">Windows with PuTTY<\/a> and on <a href=\"http:\/\/www.mikeash.com\/ssh_socks.html\">a Mac from the Terminal<\/a>.<\/p>\n<p>In theory, this can speed up a slow connection a little. It removes the TCP handshake from their network, and the compression (<code>-C<\/code>) might help for the right kind of traffic.<\/p>\n<p>Of course, you need a server to SSH to. If I&#8217;m working, I use a computer in the department at SFU. I figure that&#8217;s kosher. Another option is Amazon: a <a href=\"http:\/\/aws.amazon.com\/free\/\">Amazon Web Services free tier<\/a> should stay free if you use a micro instance and keep the bandwidth under control. As I recall, I just used their most generic looking Ubuntu image and changed just about nothing.<\/p>\n<p>You privacy is, of course, only as good as your endpoint. Sooner or later, your unencrypted web traffic has to get out there into the big-bad internet. It&#8217;s not that I particularly trust Amazon, but I don&#8217;t trust any other provider much more.<\/p>\n<p>I have also experimented with <a href=\"https:\/\/github.com\/apenwarr\/sshuttle\">sshuttle<\/a>. It pushes your entire network interface over the SSH connection. That&#8217;s technically better, but the SOCKS tunnel usually passes the &#8220;good enough&#8221; bar for me.<\/p>\n<p><strong>Edit:<\/strong> &#8230;and <a href=\"https:\/\/addons.mozilla.org\/en-US\/firefox\/addon\/proxy-selector\/\">Proxy Selector<\/a> to flip the SOCKS proxy on when I need it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been spending a fair amount of time working in coffee shops in Hangzhou. The culture seems to be that buying a coffee also buys me several hours sitting in a table doing whatever I damned well please. It&#8217;s a nice change of scenery from my apartment. They usually have wi-fi, but it would [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,10,18],"tags":[],"class_list":["post-1489","post","type-post","status-publish","format-standard","hentry","category-china","category-tech","category-travel"],"_links":{"self":[{"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/posts\/1489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/comments?post=1489"}],"version-history":[{"count":4,"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/posts\/1489\/revisions"}],"predecessor-version":[{"id":1509,"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/posts\/1489\/revisions\/1509"}],"wp:attachment":[{"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/media?parent=1489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/categories?post=1489"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/gregbaker.ca\/blog\/wp-json\/wp\/v2\/tags?post=1489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}