Protecting Your Data with SSH – Setting up a Proxy (Part 2)

In the first part of this article I introduced Public Key Encryption and SSH. In this part, we will look at how to use SSH to secure your traffic when using an untrusted network.
As previously mentioned, this was partly inspired by events from SuperHappyDevHouse. At the last event we wanted to promote the idea of encrypting your traffic. One of the ideas was to simply write out the command for encrypting your SSH traffic on whiteboards that were placed around the house for collaboration. This was a step in the right direction as people came up to the group of people I was with and asked for help. At least we brought awareness to this problem.
The code we posted was simple:
sudo ssh -l <username> -NfD <port> <ip>
This creates an SSH tunnel that acts as a SOCKS5 proxy server using the specified port. All traffic going through this proxy will be tunneled through SSH and thus be encrypted. Before we get ahead of ourselves, let’s take a look at the options we specified.

  • -l – Specifies the username on the remote server
  • -N – Tells SSH not to run any remote commands.
  • -f – Has SSH run in the background.
  • -D – This is the option that actually creates the SOCKS server.

Thank you Mike Lundy for preparing the command for everyone!
Now that we have SSH running in the background as a SOCKS proxy server, we need to configure our applications to use it. For our example we will look at configuring Firefox to send all of its traffic over SSH.
Under Tools->Options, navigate to “Advacned” and click on the “Network” tab. When you click on the “Settings” button, it will bring up options for “Connection Settings.” Here you can manually configure your proxy settings by clicking the “Manual proxy configuration” radio button and then under “SOCKS Host:” type “localhost” and the port specified in the ssh command you issued earlier under “Port.” Click “OK” and you now have all of your Firefox traffic being tunneled through SSH.

A Look at the Practical Applications of Microformats

HTML used to semantically describe what information looks like. HTML is now leaving the styling of information up to Cascading Style Sheets and is becoming more interested in describing what the data is. There are tags to let the browser know what information is a header, paragraph, list, etc. Microformats take the concept of describing data up a notch. Microformats are pieces of semantic data embedded into HTML that uses existing standards to describe what the information is. Once a user agent (such as a web browser) knows what certain pieces of data are, it can export the data to a more appropriate context. In this article we’re going to look at two microformats in particular: hCard, hCalendar.

Both hCard and hCalendar are based off of already existing standards (vCard – RFC#2426 and iCalelndar – RFC#2445 respectively). With some XSLT transformations or Javascript parsing, we can export the microformatted data in a webpage to other pages or into other data formats. For example, sites like upcoming.org mark up events with the hCalendar microformat. If we plan on attending these events, we can add it our Google Calendar, Yahoo Calendar, or 30Boxes to remind us about the event at a later date.

One of, if not the most popular microformat user-agent is the Firefox extension Operator by Michael Kaply. Currently, Michael is working on adding microformat functionality and javascript functions for microformats to Firefox 3. This means we’ll be seeing a lot of these features in the next version of Firefox. Operator supports a wide range of microformats, but as previously mentioned we’re only going to stick to hCard, hCalendar and we’re going to talk a bit about rel-tag. The premise of operator is simple: if it detects any microformatted data, it allows you to take some sort of action. If you find a person or place marked up with hCard, you can export it as a vCard or add to yahoo contacts. Exporting an hCard as a vCard will allow you to save a contact to programs like Address Book, Outlook or any program that supports the vCard standard.

I’ve already mentioned what you can do with information marked up with hCalendar, so let’s look at rel-tag. Rel-tag is simply marking up up the “rel” property of a hyperlink with the value “tag.” Once Operator knows that the link is a tag, it can then look for that same tag at sites like flickr, technorati, and del.icio.us. A common use for tags is looking up additional information about something you’re reading. Blog posts for example are usually tagged, so people can find pictures on flickr, related blog posts on technorati, or related sites on del.icio.us.

Let’s take a moment to recap and see why we like microformats and operator. For one we don’t have to input data ourselves. Since the data is already online we’re simply copying it to our application of choice. With this comes the advantage of actions becoming point and click. If you want to add an event to your Google Calendar, you point and click on the add to Google Calendar option. Pretty simple.

One area that can benefit from microformats is the cell phone market. I’ve already written about the iPhone as a microformat killer-app, but I wanted to expand this idea to include both cellular phones and internet-enabled PDAs. Cell phones and PDAs both have notoriously horrible input interfaces. Don’t you dread typing out a long text message, let alone trying to search for something on a cell phone browser? What about trying to write something out in Graffiti? What if these devices had the point and click ease of use that operator has? With REAL browsers coming to next-gen cell phones such as the iPhone, I see no reason why microformats shouldn’t be a part of this market. Imagine adding a person’s contact information into your cell phone via their hCard. You have all of the information you need about them ready to and be entered into your cell phone at the tap of a stylus. The same can be said about events and adding it to your calendar application on your cell phone or PDA.

With these smaller devices, ease of input usually suffers. In this case microformats make a great alternative to user input and can help overcome these shortcomings. It really can be just as easy as point and click.

Operator 0.6 Released!

Michael Kaply emailed me today to announce the release of Operator 0.6. Here are a list of changes (taken from his site):

  • Performance Improvements – I’ve done a few things here. The main thing is that I was going through the document’s DOM one time for each microformat. I’ve reduced that to one time for all microformats, and I also cache the list of microformats as best I can (there’s more work to be done here. I’ve also modified it so that I don’t build any menus until the icons are actually clicked. In addition, I removed the code that did a reverse lookup on geos to get the address. This was causing a MAJOR performance problem on pages with geo tags. I think this is a deficiency in the geo spec – I wish they had a way to specify a name for the geo on the geo tag.
  • User Interface – I’ve added both a toolbar button and a status bar icon that contain all the Operator functionality.
  • Handlers – I’ve made it so that handlers can indicate that they require data in a microformat. If that data is not there, the handler won’t appear. In addition I’ve added basic support for 30 Boxes. If any 30 Boxes developers are out there, please feel free to contact me so we can discuss why I can’t make 30 Boxes work as good as Yahoo or Google Calendar. I’ve also added support for Yedda.
  • Microformats – I’ve added support for hResume. It’s not there by default, so if you want to see it, you’ll have to add it using the Microformats tab in Options.
  • Debug – I’ve modified the debug dialogs so that they now display in a readonly text area that can be copied to the clipboard. They are also formatted better.
  • Tags – I’ve improved the parsing to be more compliant with the spec for valid/invalid tags. You’ll notice the tags on my blog don’t display because they are invalid. (Thanks blogger!)
  • Browsers – I’ve verified that Operator works on Flock and modified the install.rdf to support Flock
  • hCard – I’ve added support for the “hCard reference via object.”

Before I give any of my opinions I would like to try it out for a few days to really get to know the differences. Anyways, I suggest you check it out and give Michael feedback as well.

    Operator: A Firefox Plugin Bringing Functionality to Microformats

    As previously mentioned I would do a review of the brand new Firefox plugin “Operator” by Michael Kaply. Instead, I felt this article at the Mozilla Labs Blog did a better job than I ever could at describing the functionality of Operator.
    There are a few highlights I would still like to cover though. First there are two modes to the plugin: Actions and Microformats. The former is where you get the real functionality out of the plugin; You can export contacts to your defualt email application (Outlook, Mail.app, etc.), add events to your Google Calendar, find a location on Google Maps, and look up tags at flickr, del.icio.us, technorati, and upcoming.org. The latter shows you the microformat type being used on the page and can be used for writing/debuging your own microformats.
    Anyways, check out the plugin and read the article to discover the potential that microformats have.