Tuesday, April 5, 2011

Aladdin HASP security dongles, USB-over-Ethernet devices, and licensing frameworks.

If you’ve done virtualization work in an engineering companies, you’ve probably come across a USB hardware dongle. These awful devices are used to ‘secure’ software from unauthorized copying. Software companies love them because they believe that dongles prevent piracy (or make it difficult), and VMware architects hate them because
  • they require additional hardware and software to use in a virtual environment
  • the additional software is sometimes flaky
  • physical elements add a single point of failure and prevent us from using SRM
  • they’re difficult to test because our customers need them to use their products, and we need them to test our solutions
  • we dislike physical things.
In 2010-2011, the most common type of security dongle in circulation is the Aladdin HASP series. Aladdin HASP is a family of hardware produced by SafeNet Inc (previously Aladdin Knowledge Systems). There are several types of HASP dongles.
  • HASP
  • HASP4
  • HASP Hard Lock (HL)
  • NetHASP
  • TimeHASP
The most common HASP keys are the HASP4 and HASP HL. The features of these two types differ: amount of onboard memory (used to store entitlements, instructions) and encryption strength. Neither dongle has a battery-backed RTC (real-time clock, typically used to enable time-based software rental). HASP keys can be identified by their translucent and coloured shells. The following are photos of the HASP4 and HASP HL keys.
Aladdin HASP dongles - universally disliked
Dongles: back, and with a vengeance!
As shown above, the form factor cannot be used to accurately identify the type of dongle. HASP4 dongles typically have stickers containing the letters H4. HASP HL dongles typically have an engraving in the reading HASP HL.
Dongles are only half of the problem. The problem is the license software used to drive them. For HASP4 dongles, it’s often FlexNet. For HASP HL dongles, it’s the HASP HL server.
Applications protected with FlexNet and Aladdin HASP4
FlexNet is a licensing framework published by Flexera Software. Vendors license and customize the FlexNet framework to meet their entitlement management requirements. In the majority of FlexNet implementations, machine-specific license files are used to protect applications.
The non-dongle FlexNet license check-out process is illustrated below.
FlexNet - license checkout process
  1. Client contacts FlexNet license server and requests vendor daemon port: The FLEXenabled application contacts the license server and asks for the port of the vendor daemon. The FLEXenabled application knows the hostname and FlexNet license server port number from the client license file.
  2. Server responds with vendor daemon port: The FlexNet license manager replies with the port of the vendor daemon
  3. Client responds with license check-out request: The FLEXenabled application sends a license check-out request to the vendor daemon
  4. Vendor daemon reads license file to determine entitlement
  5. Server sends accept or reject: The vendor daemon determines whether any valid licenses are available and sends an accept/reject to the FLEXenabled application.
The FlexNet framework supports the use of Aladdin HASP hardware dongles (as well as other dongle types). HASP4 sits on top of the FlexNet framework. This involves an additional step between step 4 and 5. I’ll label these 4A and 4B.
FlexNet and HASP - license checkout process
4A. Contact HASP4 server: the vendor daemon contacts the HASP4 server and requests the HASP_ID of all connected HASP dongles.
4B. Dongle check: The HASP4 server contacts all connected HASP dongles and retrieves the HASP_ID. It passes these to the vendor daemon which checks for an authorized dongle.
Applications protected with HASP HL
Aladdin HASP HL is a standalone licensing framework. The license check-out process is illustrated below.
Aladdin HASP HL - license checkout process
  1. Client contacts HASP HL Server: The protected application sends a request for a license check-out to the HASP HL Server.
  2. Entitlement check: The HASP HL Server asks the Aladdin HASP HL dongle whether the license check=out is permitted. The dongle determines whether this is allowed and replies with an answer.
  3. Response: The HASP HL Server replies to the application.
Okay, enough about licensing frameworks. How do you virtualize a server that has a USB dongle plugged in the back?
To do it, you’ll need a USB-over-Ethernet device. A USB-over-Ethernet device is a network attached USB hub that connect USB peripheral devices to a server over a network. They were typically used as range extenders for USB devices (such as receipt printers, point of sale barcode scanners, biometric readers, manufacturing line control systems) where having a local PC was not practical or secure. Recently, they have been used to connect USB devices to virtual machines.
The following illustration (taken from VMware's AnywhereUSB guide) shows how an AnywhereUSB USB-over-Ethernet device can be used to connect USB devices to a virtual machine.
image
The advantages of USB-over-Ethernet devices are
  1. Dongles with potentially high replacement costs can be secured in datacentre (I worked with a dongle that costed $45,000 to replace. The vendor had a clause in the EULA stating the replacement cost of a dongle was equal to the cost of the license. No joke.)
  2. VMs with license servers can be protected with VMware HA and VMware FT – license servers previously didn’t have any HA mechanism.
  3. They allows you to virtualize those “final few” servers in datacentre.
  4. They are easy to centrally manage and monitor
  5. No major architectural changes required.
USB-over-Ethernet devices aren’t without their drawbacks…
  1. There is the possibility of potential incompatibility between dongles and USB-over-Ethernet device. These devices aren’t perfect.
  2. They introduce another point of failure
  3. No USB-over-Ethernet devices on market have redundant power supplies – if you have to do power testing, get ready to lose the device.
  4. The cheapest USB-over-Ethernet devices aren’t rack mountable.
  5. They require additional drivers in virtual machine.
  6. They are difficult to source in Australia: It is important to have hot spare ready or you could potentially be waiting weeks for a replacement. That’s a week of your licensed software being unavailable to users. If you need them, please contact me!
A word of caution: hardware dongles are notorious for being finicky. Working with dongles can be tedious and time consuming. When you find a configuration that works for you, document the solution current state: the USB-over-Ethernet firmware level, the host driver software, the OS and even the hotfix level. Pay careful attention during your patch cycle and ensure that the dongle continues to work after any updates have been applied. There are documented cases of incompatible dongles and servers and there is no definitive hardware compatibility list and determining compatibility is an exercise in trial and error. USB-over-Ethernet devices vendors periodically release firmware updates to improve compatibility, but those same firmware updates could break compatibility. Exercise extreme caution!
USB-over-Ethernet devices
There are a few USB-over-Ethernet devices on the market.
  1. Digi AnywhereUSB: these are the most popular device on the market. Use these and your problems will be minimized. If you can’t source the AnywhereUSB…
  2. Lantronix UBox: was previously popular. Although discontinued, the UBox is more compatible with certain families of security devices. The device drivers for this software are a little less stable.
  3. Belkin Network USB hub: don’t even bother. Support for HASP dongles are hit and miss.
image
The Digi AnywhereUSB/5. Plug the USB dongle in the front, the network cable in the back, and you’re set.
In my next post, I’ll describe the process for installing these devices in your environment.












Monday, April 4, 2011

The Australian Government and SSO, Part 2: Electric Boogaloo.

Australia.gov.au is the Australian government’s attempt at single sign-on (SSO) for citizens. According to Australia.gov.au, “Dealing with the Australian Government online just got easier, with a single account to sign on to multiple agencies.” Sound familiar?

Let’s make a Australia.gov.au ID and see if it lives up to the claim!

The signup process: the signup process is convoluted. Step 1 involves agreeing to terms and conditions which is reasonable. Step 2 and 3 involve picking a password and secret questions. Just wait…why are we picking a password before picking a username? Why are we doing this before even entering our names? It’s like an SSO version of Jeopardy where you enter the password first. After completing the signup, you are assigned a username that starts with two letters and followed by six digits.

Australia.gov.au - final step of signup process
What an easy to remember username! (Don’t worry, I changed it before taking a screenshot)

Connecting your Australia.gov.au identity with other agencies: buried in the My Accounts section is a Manage Agency Links page that allows you to use your Australia.gov.au ID with the other government agencies. At the time of writing, there are only three: the Child Support Agency, Centrelink and Medicare Australia.

Australia.gov.au - manage agency links screen

If you choose to link your Australia.gov.au ID with these agencies, you are prompted to enter your already existing username and password for those sites.

 

Australia.gov.au - linking a CSA accountAustralia.gov.au - linking a Centrelink account

Australia.gov.au - linking your Medicare account

The screens prompting you to link your accounts.

It’s important to note that you can only link already existing agency accounts. You must create accounts individually at each government agencies before you can link them together with your Australia.gov.au, which defeats the purpose of single sign-on.

Once you’ve connected a pre-existing agency account, a link to the agency appears in your My Account section. To test, I’ve linked my existing Medicare Online Services account. A link now appears to Medicare Australia.

image

Clicking on this link gives me a…

image

…an error message saying “A SAML error has occurred.” That’s not good! As I am not a customer of the other agencies, I am unable to test the linking feature.

Password management: a minimum password complexity applies to Australia.gov.au IDs. With a single identity, it is important to allow strong passwords which make use of special characters. Unfortunately, some special characters are disallowed.

Other observations: if you forget your username, you are locked out of the service. There is no username recovery process. To change your secret questions, you need to answer a secret question. If you’ve forgotten the answer, you’re unable to change it. You are also unable to login, because you need to answer your secret question with each login.

Verdict: The inability to retrieve a lost username is a showstopper: it is not unreasonable for people to forget their username, especially if they can’t pick it and it consists of random characters and numbers. The same goes with secret questions. While other companies like Facebook, Google and Microsoft are implementing worldwide SSO systems with ease, the Australian Government are reinventing the SSO mistakes of 2006. Australia.gov.au is another disappointing attempt at SSO by the Australian Government, and I have no reason to believe it will improve any time soon.

CREATE DATABASE failed with clustered Microsoft SQL Server 2008 instance

Trying to create a database on a clustered SQL 2008 instance? Getting the following error message?

Cannot use file 'D:\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\myDatabase.mdf' for clustered server. Only formatted files on which the cluster resource of the server has a dependency can be used. Either the disk resource containing the file is not present in the cluster group or the cluster resource of the Sql Server does not have a dependency on it.

CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

If so, you forgot to configure the disk dependency in Failover Cluster Manager! SQL prevents you from creating databases on volumes which aren’t a dependency of the SQL Server resource. This is to prevent situations where SQL Server comes online before the disk containing the database which would lead to a “I can’t see the database!” error from SQL.

To remediate this, simply add the dependency.

  1. Open Failover Cluster Manager
  2. Select your clustered application
  3. Right-click on your SQL Server resource then click Properties.
  4. Click on the Dependencies tab.
  5. Click the Insert button to add an additional row, then select the shared disk that contains your SQL databases.
  6. Ensure that all resources are required (there is an AND next to subsequent resources) then click OK.

Tuesday, March 22, 2011

AUSkey compatibility with IE9, Chrome and Firefox.

AUSkey is the Australian Government’s attempt at Internet SSO for businesses. To use it, you need to download AUSkey software, which is available on the AUSkey Software page. At the moment, cross-browser compatibility is restricted to IE9 and Firefox. Here are the browsers I’ve tested so far.

 

AUSkey
1.4.0.3

AUSkey
1.3.18

Windows    
Microsoft Internet Explorer 9 RTM

image

image

Microsoft Internet Explorer 9 RTM (64-bit)

image

image

Google Chrome 10.0.648.151 beta

image

image

Mozilla Firefox 4

image

 

Mozilla Firefox 3.6.15

image

image

Apple    
Safari 5.0.3

image

 
Google Chrome 10.0.648.151 beta

image

 

If you’re using AUSkey 1.3.18, a straight upgrade to 1.4.0.3 works fine. Ensure you close your browsers before installation: the AUSkey installer caused Google Chrome to crash!

EDIT 24/3: Tested AUSkey on my Mac: it works for Google Chrome on Mac, but not Windows.

Thursday, March 17, 2011

How to install the Amazon EC2 VM Import Connector for VMware vCenter

Another day, another cloud development! Amazon have released a connector which allows you to V2V your VMware virtual machines to the Amazon cloud! Will there come a day where Amazon VPC (Virtual Private Cloud) reigns supreme and VMware has gone the way of the dodo? Will it be cheaper to pay Amazon a monthly fee rather than put ESXi on a Dell Chicken McPowerEdge? This product reminds me of the old VMware P2V Assistant (the predecessor to VMware Importer/VMware Converter) – clunky but an important element of a greater picture.

After importing a few VMs, I can say the Amazon EC2 VM Import Connector for VMware vCenter feels like a 1.0 product. It’s difficult to use and there’s a few strange design decisions, but one day we’ll be performing V2As (VMware2AmazonEC2) as regularly as we perform P2Vs. 

Anyway, back to reality. There are a few limitations with this tool.

  • The VM must be deployed into a network with a DHCP server! If you don’t have a DHCP server, you can’t deploy this appliance. This is annoying. YOU CANNOT DEPLOY THIS APPLIANCE WITHOUT A DHCP SERVER. You can assign a static IP later, but you need the DHCP server to complete installation.
  • No live conversions. You must power off your virtual machine before importing it to EC2.
  • Any VM you export to EC2 can’t have a virtual disk larger than 1TB
  • The disk of the Amazon EC2 VM Import Connector VM must be large enough to hold an image of the VM you want to export. Do you want to upload a 500gb VM? You’ll need another 500gb of staging space.
  • The Amazon Import Connector requires direct access to the internet. Proxies are not supported.
  • Before you perform your V2V, remember to configure the firewall correctly and enable Remote Desktop access. If you don’t, the V2V will succeed…but you’ll have no way of logging into it! Amazon doesn’t have a ‘remote console’ function yet.
  • On a slow internet connection? You have 7 days to upload your VM. That’s not a problem if you have a fast internet connection in a country with an Amazon datacentre (United States, Ireland, Singapore, Japan) but you might be waiting awhile if you’re in Australia!

To install the Amazon EC2 VM Import Connector for VMware vCenter (that’s a mouthful), perform the following tasks.

  1. Download the Amazon EC2 VM Import Connector for VMware vCenter OVA.
    At the time of writing, the latest version is Amazon-EC2-VM-Import-Connector.ova (version 1.01)
  2. In vCenter, click File then Deploy OVF Template…
  3. In the Source screen, click Browse… and select the OVA you have downloaded.

    Deploy OVF template: select the source location
  4. On the OVF Template Details, confirm you have enough disk space then click Next.

    Deploy OVF Template: Verify OVF template details
  5. On the Name and Location screen, enter the name of the VM and select an inventory location then click Next.

    Deploy OVF Template: Name and Location
  6. On the Host / Cluster screen, select the host and cluster then click Next.

    Deploy OVF Template: Which host?
  7. On the Datastore screen, select where you want to place the Amazon VM. emember, the VM is 1gb thin-provisioned and a 250gb thick-provisioned. Click Next to continue.

    Deploy OVF template: select datastore
  8. On the Disk Format screen, select whether you want the Amazon VM to be thick or thin-provisioned. If unsure, choose thick. Click Next to continue.

    Deploy OVF template: select disk format
  9. On the Network Mapping screen, select the destination network you want the Amazon VM to connect to, then click Next.

    Deploy OVF template: select network mapping
  10. On the Ready to Complete screen, click Finish to deploy the Amazon VM.

    Deploy OVF template: ready to complete
  11. When the deployment has completed, click Close.

    Deploy OVF Template: deployment completed successfully
  12. In the vCenter client, power on the Amazon VM.
    Interestingly, it appears to be a FreeBSD VM.

    Amazon EC2 VM Import Connector-1.0.1
  13. Right-click on the VM and click Open Console.
    You can see the Amazon VM starting up. Upon startup, it will attempt to get a DHCP IP address. If you don’t use DHCP, this will time out.

    DHCP discovery

    The VM will eventually reach a login screen which has a Management Website and Management Password. Record these two details for later.

    If you don’t have DHCP on your network and get a 172.x.x.x address, you will not be able to proceed - turn off the VM now and put a temporary DHCP server on your network!

    Amazon S3 Import Connector - website and password details
  14. Open a web browser and browse to the management website listed.
    Enter the Management Password then click Login.

    Amazon EC2 VM Import Connector for VMware vCenter web interface
  15. If you don’t want to use DHCP, perform the following tasks.

    Click on the Network tab then click Static Config.
    Amazon EC2 VM Import Connector for VMware vCenter network configuration

    Enter your networking details then click Configure Static IP

    Amazon EC2 VM Import Connector for VMware vCenter static network configuration

    When the networking details have been saved, a green box will appear. Click the Click to Manage link to return to the main screen.

    Amazon EC2 VM Import Connector for VMware vCenter network configuration - static IP configuration successful
  16. Click the vCenter tab then click Register.
    Enter the vCenter IP/Hostname and the username and password of a user account with access to vCenter, then click Register Connector with vCenter.

    Connector registration with vCenter

    If you enter an incorrect hostname, you will get the error message x is not a valid value for vCenter IP/Hostname.

    is not a valid value for vCenter IP/Hostname

    If you enter an incorrect username or password, you will get the error message The Username and/or Password is not correct.

    The Username and/or Password is not correct.

    If you enter a correct account that doesn’t have privileges, you’ll get the error message An Unknown error occurred. Please try again.

    An unknown error occurred. Please try again.

    If all your details are correct, you’ll get the message vCenter Connector registered with the vCenter Server successfully.

    vCenter Connector registered with the vCenter Server successfully.

    When you’re successful, you’ll receive the usual certificate warning. Install the certificate and click Ignore.

    The usual vCenter certificate warning
  17. Click on the Status tab. All elements should be marked as [OK].

    Amazon EC2 VM Import Connector Status
  18. Close the web page.
  19. Close and reopen vCenter.
  20. Open the vCenter Plug-in Manager (Plug-ins > Manage Plug-ins)

    Confirm that the EC2 Conversion Plug-in (version 0.5) is installed. There is no need to enable it.

    EC2 Conversion Plug-in in the VMware Plug-in Manager
  21. Click on any VM in your environment.
    There should be an additional tab at the top.

    Additional Import to EC2 tab on VM

Congratulations, you have installed the EC2 importer!

In the next article in this series, I’ll actually perform a V2V to Amazon!

Wednesday, March 16, 2011

Want to delete all items in your Amazon S3 bucket?

If you try to delete an S3 bucket while there are still items inside, you’ll get the error message

The bucket you tried to delete is not empty. Please delete all objects and folders in the bucket and try again.

Amazon S3: The bucket you tried to delete is not empty. Please delete all objects and folders in the bucket and try again.

If you have items are in the root folder of a bucket, you have to delete them first. Sounds easy, unless you have millions of object in your bucket! To make matters worse, there is no API to empty a bucket.

You have several options.

  1. Try to empty the bucket through the web interface: There is no Select All button, and if you try to select too many objects at once you’ll get a Loading… screen which loses your selection. And if your keys contain strings like // or \ the web interface will break.
  2. Use a client app: CloudBerry Explorer for Amazon S3 or SpaceBlock for Windows are good. Unfortunately, they are not multithreaded so deleting millions of objects can take a long time. Recommended.
  3. Write some code: delete-s3-bucket.pl written by Jonathan Kamens is extremely helpful. Maxim Veksler’s BucketDestroy Java app has got me out of trouble too. These scripts are your only option if you have keys with control characters in their names.

To avoid this problem in the future, create a folder within your bucket and place all your files there.

Monday, March 14, 2011

Error deploying Oracle Enterprise Linux using vCenter guest customizations

Do you perform your deployments using vCenter guest customizations?
Do you want to deploy your Oracle Enterprise Linux (OEL) templates with guest customizations, the same way you deploy RHEL and SUSE?

If you try, you’ll receive the following error message

Customization of the guest operating system ‘oracleLinux64Guest’ is not supported in this configuration. Microsoft Vista ™ and Linux guests with Logical Volume Manager are supported only for recent ESX host and VMware Tools versions. Refer to vCenter documentation for supported configurations.

Customization of the guest operating system ‘oracleLinux64Guest’ is not supported in this configuration. Microsoft Vista ™ and Linux guests with Logical Volume Manager are supported only for recent ESX host and VMware Tools versions. Refer to vCenter documentation for supported configurations.

Cause: Although the Oracle Enterprise Linux is supported as a guest within VMware, guest customizations aren’t supported.

Workaround: Pretend it’s a RHEL template: convert your Oracle Enterprise Linux template back to a virtual machine, change the VM OS type to Red Hat Enterprise Linux, mark it as a template and redeploy.

Lame VMware, lame!

Friday, March 4, 2011

Moving VMs between clusters

I received the following error message when trying to move VMs between clusters.A general system error occurred: Failed to start migration pre-copy. Error 0xbad010d. The ESX hosts failed to connect over the VMotion network. See the error stack for details on the cause of this problem.

Failed to start migration pre-copy. Error: The ESX hosts failed to connect over the VMotion network.
vMotion migration [111111111:1111111111111111] failed to create a connection with remote host <192.168.1.1: The ESX hosts failed to connect over the VMotion network.
Migration [111111111:1111111111111111] failed to connect to remote host <192.168.1.1>: Network unreachable

The long string of numbers refer to a unique vMotion event and are interchangeable.

Migrate virtual machine error - a general system error has occured. Failed to start migration pre-copy

This error was caused by a lack of network connectivity between the source and target VMs. Specifically, my two clusters had different VMotion networks. While this is a supported case, there were firewall rules blocking the VMotion traffic. Unfortunately, the Migrate Virtual Machine wizard doesn’t check for network connectivity, only if there are showstopper compatibility issues (like different CPU, target ESX host not having a VMotion network, etc.)

VMware Migrate Wizard - compatibility warning

If you get this issue, ensure your firewall isn’t blocking connectivity.