BrowserID

Facebook, Google, twitter, aside from all being social networks, all allow you to log in to third party websites with your account with them.

This is convenient for users as they have fewer logins to remember, and don’t have to repeatedly enter the same information every time they want to use a new web site.

It’s good for third party sites because it’s fast and easy for the users, and also because they often gain easy access to extended data about the user in the form of their social network.

It’s good for the social network because they get more information about what their users do when they’re not active on the network directly. This is valuable both to improve the network, but more significantly is valuable for ad targeting which allows them to make money.

There are some downsides though. For the user, a loss of privacy, and for the third party site, having to share the usage data with the identifying party.

There are a number of alternatives, but none have yet taken off.

Mozilla BrowserID/Persona is a recent attempt I’ve been experimenting with over the last couple of months.

The two core design decisions which differentiate it from other attempts are:
1. Use of am email address to identify users rather than a URI as users are used to thinking of themselves in terms of email addresses.
2. Designed to be natively implemented by browsers. This is good for preventing phishing and protecting privacy.

Like OpenID, it’s decentralised, allowing domain owners to vouch for users at that domain. One of the challenges that brings is in bootstrap. Most people don’t run their own domains, so for people to opt-in, they’d have to wait until their e-mail provider adds support. In order to work round this, Mozilla has set up a fallback system which verifies ownership of e-mail in the traditional way, with the intention that over time, fewer and fewer people will use this.

Java on the web…

It is time.

As a Java developer, this probably should be difficult to say, but it’s not. Now is the time to disable the Java browser plugin by default. In the past year I’ve only consciously used it on one site, and in that time there have been a whole bunch of security vulnerabilities in it.

The era of native plugins is nearly over, Java included. There are still a few sites out there which need it, but those are so few and far between that I’d recommend keeping it installed and disabling the plugin and re-enabling only when absolutely required.

This is trivial to do in Firefox, and I’m sure must be in other browsers as well.

Mozilla Popcorn (JS)

I’ll confess that I’ve been a little sceptical about the Mozilla Popcorn.js effort over the last year or so. Putting twitter feeds beside a video doesn’t feel particularly interesting. The mozillapopcorn.org site says “Popcorn makes video work like the web”, but I haven’t understood what that means until now. It means 2 things. Firstly, a radially different video-on-the-web experience, where content and video are interleaved. Where video insn’t relegated to being a box on the page with a set of controls. Even simple things like being able to add a ticker to the bottom of the video which contains other ‘page’ content allows the video to be given much greater prominence. And secondly, it’s about the ‘view-source’ nature of the web, and extending this to video effects. Popcorn.js isn’t ‘editing’ the video, but applying effects and overlays in a non-destructive way. This makes it possible for people to come along and discover and learn how things were done. It’s early days for much of this, but I now at least understand why there’s so much excitement as it might have a profound impact on the future web.

BarCampLondon 9

Just a brief post to thank all the organisers and sponsors of BarCampLondon9 this past weekend. It was a 2 day marathon of interesting talks, discussions, tech-humour, and werewolf. It really sparked off a number of interesting thoughts which I’ll have to dig into sometime soon. I did a quick talk on building Firefox addons using http://builder.addons.mozilla.org which seemed to go down ok. No slides. No fear.

Distracting Planets….

Today I got a little distracted by a simple tweet… These planets look pretty cool, so I decided to try to create one. I jumped to Pixelmator which I bought a while ago. Uh. It doesn’t have a ‘Polar Coordinates’ filter. Oh well, I thought. How hard can it be to implement in Quartz Composer? Answer: Most of a day.

Was interesting to dig out basic trig knowledge, and I’m sure my solution isn’t optimal, but it was a fun way to spend an afternoon.

I got there in the end, but unfortunately a little late to actually spend the time to make a decent planet… maybe something for the train tomorrow.
Anyway, I’ve uploaded the .qtz file to downloads.illsley.org. Feel free to grab it and drop it in ~/Library/Compositions/ if you want to play with planets on the Mac.

HSTS, CAs, and pinning

The DigiNotar, Comodo, and other recent CA incidents has made it clear that the current CA/SSL model requires at least some reinforcement. An enhanced form of HSTS has been under discussion for a while, and this week an initial submission was made to the IETF’s websec group. It would work by allowing an HSTS response to ‘pin’ an HSTS enabled domain to a list of root certificates, end entity certificates, or public keys used from end entity certificates. This allows, for example gmail.com to say that for the next 6 months, only certificates from a set of CAs should be trusted by a browser. While it’s not a panacea, it would help detect and prevent SSL MITMing like that detected in the DigiNotar case. There is a bootstrap problem (the first time someone visits a site, the browser can be fooled), but incremental improvement and defence in depth is the order of business here. If you’re not careful, pinning could have negative consequences, and the spec is careful to minimise these – notably that if you limit yourself to a single CA, you can effectively be extorted when your existing certificate expires, as you have no choice but to pay for a new certificate from the pinned CA.

It’s this flexibility which introduces what I think is a difficult to solve problem. If you’re running a non-SSL site, and an attacker can gain access to your DNS (as recently happened to theregister.co.uk and others), they can ‘pin’ your users to a public key which you don’t have the private key to, and which isn’t revocable. At that point, you either rely on the browser vendors to somehow decide that you really do own your site, and push some kind of special unpin message to all browsers, or you pay up to the attacker to buy the private key, from which you can have a cert issued, and which you can then use to serve your site, and probably downgrade from pinning and HSTS.

In this case, we’ve essentially shifted trust from CAs to DNS registrars, who inevitably have less security expertise. Without HSTS+pinning, theregister.co.uk just had to wait for the registrar to correct the whois records, and for the DNS to propagate. With pinning, a similar registrar failure could have a much longer lasting impact. There are variants to this attack which simply require acting as a MITM, but in those cases, gaining a CA cert for a target domin is considered much harder.

This attack essentially targets the bootstrap phase which we already knew wasn’t secure. After a few days pondering solutions to the problem, the solutions I can come up with essentially further weaken the bootstrap phase, but enable pinning over the long-term without these problems for non-secured sites.

My proposal is to soften the effect of the ‘pin’ for 72 hours from when a domain is first pinned. If, in that period, a certificate which doesn’t correspond to the pin is encountered, the browser must apply heuristics to determine what to do. This may include user input or communication with white/blacklist services. It must not blindly obey the pin.

Why is it important to put this into the spec? If I think about the costs of setting up a truly secure and trustworthy blacklist/unpin service, the task is as complex as running a CA. I think it’s unreasonable to expect that browser vendors will want to get into that business. And even if they did, the time it might take for them to correctly identify the domain owner and correct pinning status would likely be lengthy. Any site owner setting a pin would be rightly upset if their site was incorrectly unpinned. Providing a short window (at the already weak boostrap phase) where a lower set of expectations is codified would provide cover to implement sensible heuristics and low-bureaucracy services to mitigate the worst of the problem, without implying that those same services would be appropriate for a general pin revocation scenario.

A new OSGi tool… kindof…

After watching the #osgitool session the other day which covered some pretty advanced OSGi tooling, it occurred to me that given the learning and migration curve to use OSGi, there are people a long way from using it, but who could benefit from the OSGi metadata everyone is spending time on.

How so? Well, Eclipse supports ‘Access Rules’ on dependency libraries which essentially mimic the Export-Package property in OSGi. A tool which allows you to easily set up this configuration based on the manifest would allow you to respect the (normally carefully crafted) Export-Package restrictions without going all the way to OSGi. Hopefully this means that you’re less likely to use APIs which are considered internal, and so when you’re upgrading the version of your dependency, there’s less likelihood of accidental incompatibilities.

The source to this (very simple) plugin is on github, and along with a built jar which you can drop in the dropins folder.

Then, to use it, simply right-click on a Java project and select “Refresh OSGi export restrictions”. This will then scan the dependent jars and their manifests, and for OSGi bundles, update the Access Rules to explicitly allow use of exported packages, and forbid use of all other packages (this is visible in the Java Build Path/Libraries tab).

If it’s useful and you have feedback, please use the tracker on github.

Leaving IBM…

After more than five years working in the IBM Hursley Software Lab, I’ve decided that it’s time to move on. I’ve enjoyed my time in Hursley greatly and learned a lot, but in order to further grow my career, I’ve decided to leave the connectivity middleware space. I’ve worked with a lot of talented developers and architects in Hursley and around the globe on a variety of interesting projects and products, and I hope I cross paths with many of them in the future, and wish them all the best.

So what does the future hold? Well, a move away from a software product vendor to a company which uses technology and software in support of (and to drive) its business. Also a move from the leafy Hampshire countryside to Canary Wharf. On a date TBC in the not too distant future, I’ll start work as a software engineer at Morgan Stanley.

I’m really excited and looking forward to working with a new team on new challenges and learning a lot more about the finance industry.

I5y.li

I shook up my whole web presence last weekend because of an impending hosting renewal bill. I moved all of my hosting from dreamhost.com to an ec2 micro instance. This gives me a bunch more flexibility for a reasonable price, and gives me a little more exposure to the ec2 platform.

One of the benefits is the ability to host tomcat, and hence use some java on the web. My first attempt is that of a (private) URL shortener, providing urls at i5y.li

Why i5y.li? i5y is a shortening of Illsley, and li was a cheap ccTLD with some at least relevant letters (.ly which is probably the most obvious option is much more expensive.)

OSGi, Java Security Manager, and keeping things simple…

I’ve spent the last couple of hours trying to understand Java2 Security in an OSGi environment. There’s a presentation available at [link] which gave me lots of information and hints of what to search for and what to play with. I’ve also had a quick skim to the relevant section of the OSGi 4.2 spec. Here’s a quick summary of what I’ve discovered. It may not be 100% correct… do let me know if i’ve got the wrong end of the stick on something.

In an OSGi 4.2 environment, the Conditional Permission Service is king. Well… kindof. There are 3 sources of permission information to consider:
1. Java2 Security Policy
2. Dynamic(Programmatic) configuration of the Conditional Permission Service
3. Local Permissions. (Static, per bundle policy)

In a relatively static environment it appears that you could pretty much ignore the programmatic Conditional Permission Service and rely on the more static options 1 and 3.

In order to enable OSGi security, you start by enabling Java2 security with an ‘all permissions’ policy file. Yes, I did just say that. It seems counter intuitive, but in order to allow the OSGi Framework to do its thing, it needs full permissions. It seems to be plausible to give just the framework bundle(s) the All Permission in the policy, but this affects (removes) the implied permissions of the other bundles which breaks everything. More investigation required.

So, assuming you already have an OSGi application:

java -jar org.eclipse.osgi_3.6.0.v20100517.jar -Djava.security.manager -Djava.security.policy=all.policy

all.policy:

grant { permission java.security.AllPermission; };

And you’re in an identical situation to before. All code has all permissions. The up side is that it’s just a couple of steps to start restricting the priviledges of your bundles.

Add an empty file “OSGI-INF/permissions.perm” to a bundle, and apart from some implict permissions (e.g. to import packages, read/write the bundle configuration area), that bundle has had its permissions entirely removed. You can the start giving the bundle permissions e.g. by adding a line:

(java.io.FilePermission “/Users/*” “read”)

This provides a very simple way to enumerate the permissions a bundle requires and restrict it to them. It also provides a simple file to audit for each bundle. There are a couple of important things to note:

1. An empty file is not equivalent to no permissions.perm file. Make sure you have a permissions.perm file if you want restricted permissions.

2. The permissions.perm file specifies the maximum permissions the bundle requires. The framework/Conditional Permission Service in conjunction with the system security policy may result in lower available permissions.

This looks great for reducing the risks from exploits in bundles I develop, but clearly doesn’t help much with 3rd party bundles, which is where the Conditional Permission Service should come into its own. More on that once I’ve worked it through.

Next Page »


About

I’m David Illsley, I’m a Software Engineer, currently working for Morgan Stanley in London. In the past I worked for IBM developing products in the WebSphere family, and before that I studied at Edinburgh University. I'm also a PMC member @TheASF, and outside the realms of technology, enjoy skulking around the dark corners of theatre...

Archives

c

Disclaimer

The postings on this site solely reflect the personal views of the author and do not necessarily represent the views, positions, strategies or opinions of my employer.

Twitter Updates


Follow

Get every new post delivered to your Inbox.