Google
 

Appropriate Uses of SSL in Web Applications

June 16, 2006 – 11:58 am

SSL is a nice feature to show off to customers - it has a nice lock icon which reassures users that they are secure. However, it comes at a price - the encryption and decryption process does take up time CPU time on both client and server, in additon to the increased bandwidth that is necessary for transfering encrypted data. In this post I am going to quickly summarize some of the things we learned when we added SSL to web applications in our company.

There are two exteremes when using SSL - you can choose not to use at all, relying on the fact that network sniffing is sufficiently rare. On the other extreme you can go super-crazy and encrypt everything with SSL, thus slowing down your web application and making users less happy. But there is a third choice - a more balanced use of SSL. You can encrypt only certain sensitive sections leaving the rest of the web app unencrypted and fast. If you look around the web, you will find the third choice is what many major websites employ. For example, Amazon only requires login and SSL whenever a user orders something, or accesses private information.

Of course your choice also depends on the type of application your are working on. For example, a bank should probably encrypt every page in their customer systems since the data is so sensitive. On the other hand, Bob’s Cleaners doesn’t need to encrypt their informational website, since the data is not sensitive at all. Here I am assuming that the actual web application does not need SSL, but some sensitive sections do.

When implementing this balanced approach, the usual way to do it would be to encrypt the login page, the login action and any pages that have to do with things like changing passwords, forgotten passwords, and financial information. It is also a good practice to encrypt or hash sensitive data such as passwords and credit card numbers throughout the web application including the database.

Last but not least, several implementation tips:
o Browsers will display security prompts if you try to switch from a secure to an unsecure page without user interaction such as a redirect. That means that in many cases, you cannot simply send the users once they have logged in to an unsecure page. One way to get around this issue is to point users to a secure page after they have logged in, but provide only non-secure links on that page. When they follow the links, the browser will not prompt them since it is a user action.

o The login page itself should be encrypted as well. Otherwise, the users have no way of knowing if the login page itself is real EVEN if the login action may be encrypted. However, this presents a different problem since many servers will start the session via cookies when the user sees this secure page. The problem is that those cookies will be lost once the user crosses over into a nonsecure section. You can either prompt the user to login again every time they come back to the secure section (like Amazon does). OR you can land them on a unencrypted page first, then redirect them to the secure login page.

The Law of Unintended Consequences

February 24, 2005 – 10:41 am

Some time ago one of our customers asked us for a feature where a certain box on a certain printed document would be limited to a certain size. The feature was promptly put in place and used for the past few weeks. Yesterday, they suddenly realized that some of the stuff that doesn’t fit into the box because of the size is actually important and needed, so the feature had to be dropped. Go figure.

The Importance of Redundancy

January 25, 2005 – 1:26 pm

The NY Post is reporting (via Drudge)that a fire knocked out an entire subway line in NYC for 5 years:

A fire in a subway control room has put the C line out of service for up to five years and caused serious problems on the A line that will make the commute miserable for hundreds of thousands of subway riders, officials said yesterday.

The unstaffed room containing 600 electrical devices called “relays” that are used to power signals and switches along a segment of the vital Eighth Avenue line were destroyed Sunday in the blaze.

And guess what, they didn’t have backups! This is why it is important to have redundancy:

The TA said there is no backup power system in place at that location. Without a signal system, Reuter said, “you could only get so many trains on a line. Chambers Street is the choke point in the signal system.”

Proper Bug Hunting

December 7, 2004 – 1:13 pm

Joel has a great piece which mentions the right approach to bug fighting:

For example, if I assign a bug to a developer I expect them to:
1. reproduce the bug
2. if it’s not immediately reproducible, make a good faith effort to figure out why it’s happening to me instead of just assuming that I’m doped up on anti-allergy medication and hallucinating it
3. find the root cause
4. do some searches to see if the same errors were made elsewhere in the code
5. fix them all
6. test the fix
7. think about whether this bug might be causing serious implications for a customer who needs to be told about the fix etc.

That’s the Rosh Gadol behavior. Possible Rosh Katan behaviors would be
1. resolved-not-repro. You can always get away with this once without even trying to repro the bug, because later you can pretend you didn’t understand the bug report.
2. without even reproing the bug, make a change to the source code that seems like it would fix it and resolve it as fixed. If it wasn’t, I’ll catch it when I close the bug, right? And if it’s really still broken, surely another tester will find it.

Rosh Gadol of course is quite the opposite: taking initiative and doing what is desired, not what is requested.

Development Tools for FireFox and Opera

November 22, 2004 – 1:21 pm

I have been using Chris Pederick’s Web Developer toolbar for Mozilla and Firefox in conjunction with Daniel Savard’s Live HTTP Header extension for a while. Recently I challenged a friend of mine who is a big Opera fan to find a similar tool for Opera. He came up with 1 and 2. After trying it out, I can say that it doesn’t come close to the Firefox tools. Somehow the Opera stuff feels clunkier, the JavaScript console is very slow (at least on Linux), and the entire extension interface is simply not there - menus and toolbars are used instead. But you can try them out for yourself.