Showing posts with label end-user security. Show all posts
Showing posts with label end-user security. Show all posts

Sunday, July 10, 2016

2FA FTW

This morning brought yet another story of identity theft (ID Theft in three steps: 'Adequate' Telstra and telco identity checks questioned) by the all-too-easy technique of finding an individual's name, home address and date of birth. These are all things that are on the public record and quite easy to discover; they should not be used as an authenticator. The US has a related problem with Social Security numbers which should also be regarded as an identifier, not an authenticator.

One of the most important steps in identity theft is getting access to the victim's email account. This is because the attacker does not know the password for the victim's bank, PayPal, eBay or other accounts, but the most common technique for password reset is to email a link to the user. In other words, the email account is used as yet another authenticator in a chain of trust. This means that email account mismanagement poses an extreme risk for user - it is both highly likely to be targeted, and also leads to severe consequences if compromised.

The weak link in all of this is the use of passwords; human beings being human and of bounded rationality, we tend to choose bad passwords that are easily guessable or discoverable. Even worse, we reuse passwords - confronted with the need to memorise the passwords for 20 or 30 different accounts, we understandably fail. Not everybody knows about password safes, for example. Inevitably, however, one of the sites we use gets compromised, the password hashes are stolen and posted on pastebin, and within minutes, a Rainbow Tables attack (or even quite mundane dictionary attack) reveals that favourite password, along with the email address, to the Bad Guy. And if the same password was used for the email account, it's Game Over.

I long ago determined that my email account had to use a unique and painfully complex passphrase, since the security of so many other assets depended upon it. It might be a pain in the ass to pause for a while as I hunt and peck my way through a long near-random string, but it's the price I pay for peace of mind.

And a few years ago, I decided that it was time to move to two-factor authentication for my email account. I'd had enough of running my own email servers and moved my email, etc. to Google Apps for Work, and Google was starting to offer two-factor authentication. I'm not a starry-eyed believer in 2FA - in many cases, there are better alternatives and a more sophisticated risk-based approach to the problem should reveal them - but to rely purely on passwords for such an important application is inviting disaster.

Enabling two-factor authentication is a fairly straightforward process, and Google nicely provides several alternative approaches. The most obvious is to rely on a mobile phone number and send an SMS (or voice message) to it - what banking systems call a mobile Transaction Authentication Number (mTAN). But that won't always work for me - some places I work are screened so that a mobile phone signal can't reach them. Once nice alternative is a Security Key - a small device that plugs into a USB port and provides cryptographic authentication; this will work with any software that supports the FIDO (Fast Identity Online) U2F (Universal 2nd Factor) specification, such as Chrome (but not Firefox, unfortunately). And there's the Google Authenticator, a smartphone and tablet app (technically, a soft token) which generates a unique six-digit number each minute. Any of these can be combined with the passphrase to allow a successful login.

A Yubikey Neo - a "security key" which also supports NFC (near-field communications)
This will overcome what I suspect is the biggest obstacle for many people contemplating the switch to two-factor authentication for Gmail, etc. - the fear that they will be locked out of their account if they lose their phone or another device or simply don't have it to hand. With a little extra setup, there's always an alternative available.

Setting up two-factor authentication is done by going to https://myaccount.google.com/security/signinoptions/two-step-verification or just clicking on your avatar at top right of a Gmail or other Google page, then choosing "My Account", then under "Sign-in & security", selecting "Signing in to Google" and on that page, under "Password & sign-in method" clicking on "2-step Verification". Unsurprisingly, you'll be prompted for your login ID and password before getting access to this page.

Turning on 2-step verification will start by sending a verification code to your recovery phone number. If you receive this successfully then 2-step verification will be turned on. At this point, any other sessions and devices you may have logged in to this Google account will be effectively logged out, and you will need to log in again, using 2-step verification. However, you may want to delay that until you have set up your security key or authenticator app.

Security keys, such as the Yubikey, are inexpensive and widely available - I got mine from Amazon. Adding the security key to a Google account is very easy - on the 2-step Verification page, just click on "ADD SECURITY KEY"and you will prompted to insert your key and tap on its button if required. A second or two later, it will have been recognised and added to your account.

Setting up Google Authenticator is almost as easy. The 2-step Verification page prompts you to install the app (versions are available for both iPhone and Android) and then tap "Set up account". This will allow you to scan a QR code which presumably seeds the pseudo-random number generator in the Authenticator app. And that's it - from this time on, opening the Authenticator app displays a six-digit number, changing every minute, which you can use to authenticate to Google.

Google Authenticator
Google selects the second factor in a priority order - first (default) choice for me is the security key, then comes the Google Authenticator app, and only if those aren't available does it fall back on SMS authentication codes.

Logging In

As mentioned above, setting up 2-step verification effectively logs you out on other devices and sessions, so you'll need to log in again. Your phone may pop up a dialog requesting an authentication code, especially if you have the Google Device Policy app installed for remote management. In my case, I tapped the button requesting Google to send an authentication code, and a second later the SMS arrived - but after I'd viewed the SMS and written down the code, I couldn't get back to the authorization dialog. Since the phone is still logged in and hasn't skipped a beat, I can only presume that the Device Policy app was able to directly read the SMS and didn't need me to manually enter the code.

When I booted my Chromebook and logged in, it initially accepted just the password but then gave me a notification message that said I should log out and in again. This time, it prompted me to insert my security key and tap its button, after which I was logged in.

Chrome on Windows can be a bit confusing, because it requires a log in to the browser itself, independently of any web sites you may log in to (this is because Chrome syncs your bookmarks and other data to your Google account). So you may get a couple of prompts to authenticate when you first launch Chrome and log in to a Google page such as Gmail.

Firefox does not yet support security keys - there's a Bugzilla page where you can track development progress at https://bugzilla.mozilla.org/show_bug.cgi?id=1065729. However, you can use Google Authenticator to log in to Google, as shown:

Thunderbird shares code with Firefox and also does not support security keys. In fact, if you've been relying on "Normal password" authentication for IMAP access to your Gmail account, it's now time to change. Right-click on your account in Thunderbird and choose "Settings", then click on "Server Settings" and change the "Authentication method" to OAuth2. Click on "OK", and then click on "Get messages" to force authentication. You'll get a password prompt and then a dialog like the one above, allowing you to authenticate using Google Authenticator or an SMS code. Once that's done, Thunderbird will be happy for the foreseeable future. If you're using the Provider for Google Calendar plugin, that should also prompt for re-authentication.

Third-party Sites

One of the beauties of adopting this technology is that it can eliminate the need for passwords for other web sites and applications. The OAuth2 protocol referred to above allows Google to function as an identity provider for other relying web sites - part of an underlying technology called federated identity management. I use this as part of my own systems - for example, I no longer use a password when logging in to my own web site, but instead have configured the content management system (in this case, Moodle) to use OAuth2 to get Google to confirm my identity. Not only can the site be more confident this really is me - I've used two-factor authentication to prove it - but I don't have to type in a password.
My own web site now supports login with Google credentials

Many other sites also use two-factor authentication or federated identity management; for example DropBox now supports security keys, as does GithubSalesforce and many other sites. You can set up Facebook to use Google Authenticator by going to your settings, then choosing "Security", then clicking on "Code Generator" and clicking on "Set up another way to get security codes" and scanning the resultant QR code. The Facebook app on your phone can also be used as a generator.

You can log in to The Guardian, O'Reilly Media and many other sites using federated identity management with Google, Facebook, LinkedIn or Twitter acting as identity providers. Of course, social media networks are keen to have you use them as identity providers since then they can track you across other sites, although they have other ways of doing that anyway. However, as a Google Apps user I am a Google customer, rather than a consumer of free services, so I prefer to use only my Google ID for authentication.

Summary

Email accounts are too valuable to protect with only a password, especially a weak or reused password. Two-factor authentication providers better security and lowers the risk of identity theft. It takes only a few minutes to set up and rarely inconvenient thereafter. Use it.


Saturday, February 28, 2009

Sharing Your Stuff with the World (or Bits of It)

Someone recently pointed me to the SheevaPlug computer - an ingenious little plug computer that essentially consists of a low-power computer built into a wall-wart - and a consumer applicance based on it, the Pogoplug (http://pogoplug.com/). There's a nice write-up in the SheevaPlug at http://linuxdevices.com/news/NS9634061300.html and their development info is at http://www.marvell.com/products/embedded_processors/developer/kirkwood/sheevaplug.jsp.

The Pogoplug is a small server appliance which shares the contents of a USB hard drive (or flash drive) attached to it. It does this by setting up an SSL connection back to the the company's servers, where a browser-based interface lets you administer your account and generate links which you can email to others so that they can access the shared files on your device. Devilishly ingenious.

The company's home page trumpet's the device's ease-of-use: "Just connect Pogoplug to your home network and attach any external drive or memory stick. That's it, no need to call your office networking guy"

In my cynical fashion, I'd rephrase that: "Please, please don't call your office networking guy because once he hears what you're planning, he'll slap you upside the head and we won't make the sale!".

In other words, if the nasty, restrictive network admins at work won't let you connect remotely because It's A Bad Idea, then this thing is An Even Worse Idea.

The last thing any enterprise firewall admin wants to come across is a device he didn't know about that sits on the inside network and pokes holes through the firewall. In this case, I'm betting (the device is in early beta) that it connects back to port 443 on Pogoplug's servers, since many firewalls don't block or proxy SSL connections. So, expect the firewall admins to black-list pogoplug.com, thereby stopping this device in its tracks.

Once you've shared your stuff, other users can log in at the Pogoplug site via their web browser - this solves the problem of locating a Pogoplug hidden behind a modem with a DHCP-allocated IP address that might change. Of course, this suggests various easy attacks: a keystroke logger, spyware or even XSS attack on a user's browser could capture the user's credentials. In fact, if I was an Evil Criminal Mastermind banging out spyware to capture banking, eBay and email credentials, I'd add my.pogoplug.com on the list of pages to monitor, just to see what might turn up - most Pogoplugs will contain shared photos, videos, etc. but there's bound to be more than a few users who let their guards drop and use it to transfer more sensitive information.

Of course, if our Evil Criminal Mastermind was to compromise the Pogoplug servers, he would own every Pogoplug in the world. I do hope that their software isn't written in PHP by a summer intern.

Access control concerns me, too. If the access checking is done at the Pogoplug servers, that means they have access to the entire contents of the USB drive. People are quite likely to use a single drive for backup, carrying documents around and also plugging into the Pogoplug, and would be trusting the company to protect all of that.

Of course, Pogoplug isn't the only company offering boxes like this; Lacie, Axentra and probably others have them, too, in many cases based on the Marvell OEM SheevaPlug.

Here's a way it could be done better (and a free design innovation for router manufacturers like Netgear and Linksys):

Put the USB connector on the router itself. Many ADSL modem/routers already have a feature to nominate a machine on one of their internal IP addresses as a "DMZ machine" and do port forwarding of common services to that machine, letting you run things like web servers on an internal machine. And the router already has the ability to register with dyndns.org, so that you can register a domain name and that lets people find the external IP address of the modem. I don't like the port forwarding approach, because if an attacker is able to compromise a service on an internal machine, then he's on the inside and can see other machines as well.

Those modem/routers are based on a Linux kernel anyway, so it would be easy to add support for a simple web server that can serve just static data (there used to be such an animal in the 2.6 kernel, but I think Linus took it out again). Add a USB port to the router, with a predefined mount point that is the web server HTML root. Add a simple management interface to let the user manage .htaccess files, and hey presto! Now there's a web server that can be accessed by outside users and uses a dynamic DNS service, rather than a centralized management scheme. There's no central web page for login credentials, making it harder for spyware, etc. to grab credentials.

The access control is entirely in the user's hands; nobody else gets open access to everything on the inserted drive (as would be the scheme for Pogoplug, where the access control is at my.pogoplug.com). And there's a switch in user perceptions, too - if you plug a drive into the router, you're clearly doing that to put it On The Internet, while plugging a drive into a wall-wart inside your house, well, people are a bit more vague about that.

So, what about it, Netgear and Linksys?

Back to the Pogoplug: Neat device, but don't trust it too much. Only use it for semi-public material; don't put personal, private or embarrassing material on there, and make sure you choose good passwords and are careful not to use them from public computers. I'd also put a big "PUBLIC" sticker on the drive to make sure that you never relax and accidentally put something sensive on there. And don't take one into the office!