Home >

Administration Guide > Backup and Restore HSMs and Partitions > Local Application Partition Backup and Restore Using the Backup HSM

Local Application-Partition Backup and Restore Using the Backup HSM

This section describes how to perform local backup and restore operations using the SafeNet Remote Backup HSM (Backup HSM). A local backup is defined as one in which the Backup HSM is local to the HSM or to the SafeNet HSM client workstation used to administer the HSM. To perform a local backup/restore, you can connect the Backup HSM using one of the following methods:

to a USB port on the SafeNet Network HSM appliance. This method allows you use LunaSH to backup all of the SafeNet Network HSM partitions on the appliance that are owned by you, the HSM SO. It does not allow you to backup partitions that have their own SO. See Partition Backup and Restore Using a Backup HSM Connected Directly to a SafeNet Network HSM Appliance for details.

to a USB port on the SafeNet HSM client workstation. This method allows you use LunaCM to backup any SafeNet Network HSM or SafeNet PCI-E HSM partitions that are visible as slots. See Partition Backup and Restore Using a Backup HSM Connected to a Local Client Workstation for details.

The backup operation can go from a source partition (on a SafeNet Network HSM) to an existing partition on the Backup HSM, or if one does not exist, a new partition can be created during the backup . The restore operation, however, cannot create a target partition on a SafeNet Network HSM; it must already exist.

You can restore a partition backup to the source HSM or to a different SafeNet Network HSM. The HSM you restore to must already have a suitable partition created for the restored objects. The partition can have any name - it does not need to match the name of the source partition on the backup HSM.

Partition Backup and Restore Using a Backup HSM Connected Directly to a SafeNet Network HSM Appliance

The simplest way to backup your SafeNet Network HSM is to connect the Backup HSM directly to the SafeNet Network HSM appliance. To perform a backup/restore, you open an SSH or serial connection from your workstation to the appliance, and then launch LunaSH in a terminal session to perform the backup, as illustrated in the following figure:

Figure 1: Configuration for SafeNet Network HSM partition backup/restore using a Backup HSM connected directly to the SafeNet Network HSM appliance

 

The workstation is simply a display terminal for LunaSH running on the appliance. It does not require the SafeNet HSM client software.

The PEDs are required only if the SafeNet Network HSM is PED-authenticated. The appropriate SO (blue), partition (black) and domain (red) PED keys are required. The SO (blue), partition (black) PED keys can be the same for both devices, or can be different. Both devices must share the same domain (red) PED key value. Although two PEDs are recommended (one connected to the SafeNet Network HSM and one connected to the Backup HSM) you can use a single PED, if desired. If using a single PED, note that you can connect the PED to only one HSM at a time. You will need to disconnect it from the source (SafeNet Network HSM) HSM and connect to the target (SafeNet Remote Backup HSM) when PED operations are needed at those HSMs respectively.

Note:  You can use this method to backup the partitions on the SafeNet Network HSM appliance that are owned by you, the HSM SO. You cannot use this method to backup partitions configured with their own SO. To backup a partition with SO, you must use LunaCM, as described in Partition Backup and Restore Using a Backup HSM Connected to a Local Client Workstation.

To backup a SafeNet Network HSM partition to a directly connected Backup HSM

1.Connect all the required components and open a terminal session to the SafeNet Network HSM appliance. See the following topics for details:

Open a Connection in the Configuration Guide

Backup HSM Installation, Storage, and Maintenance

As soon as the PED is connected to a powered HSM it starts up and defaults to Local mode with the Awaiting command... prompt.

2.Open a LunaSH session on the SafeNet Network HSM appliance.

login as: admin 
admin@192.20.10.202's password:
Last login: Tue Dec 30 16:03:46 2014 from 192.16.153.111

SafeNet Network HSM 6.0.0-25 Command Line Shell - Copyright (c) 2001-2014 SafeNet, Inc. All rights reserved.
[myluna] lunash:>

3.Use the token backup list and token backup show commands to determine the serial number of the Backup HSM and to verify its partition and storage configuration:

[myluna] lunash:>token backup list 

Token Details:
============
Token Label:     BackupHSM
Slot:           6
Serial #: 7000179
Firmware: 6.22.0
Hardware Model: SafeNet USB HSM

Command Result : 0 (Success)
[myluna] lunash:>

lunash:> token backup show -serial 700179
Token Details:  
============
Token Label:     BackupHSM  
Serial #:        700179  
Firmware:                        6.22.0  
Hardware Model: SafeNet USB HSM  
Authentication Method: PED keys  
Token Admin login status: Logged In  
Token Admin login attempts left: 3 before Token zeroization!

Partition Information:  
======================
Partitions licensed on token:     20  
Partitions created on token:      0
----------------------

There are no partitions.

Token Storage Information:  
==========================

Maximum Token Storage Space (Bytes): 16252928  
Space In Use (Bytes):                0  
Free Space Left (Bytes):             16252928

License Information:  
====================

621010355-000 621-010355-000 G5 Backup Device Base  
621000005-001 621-000005-001 Backup Device Partitions 20  
621000006-001 621-000006-001 Backup Device Storage 15.5 MB  
621000007-001 621-000007-001 Backup Device Store MTK Split Externally  
621000008-001 621-000008-001 Backup Device Remote Ped Enable

Command result : 0 (Success)  
lunash:>

4.Use the partition backup command to backup a specified partition and provide the PED keys as prompted, for example:

[myluna] lunash:>par backup -s 7000179 -par p1 -tokenPar bck1  

Type 'proceed' to continue the backup, or 'quit'
to abort this operation.
> proceed
Please enter the password for the HSM partition:
> *******

Warning: You will need to attach Luna PED to the SafeNet Backup HSM
         to complete this operation.
         You may use the same Luna PED that you used for SafeNet Network HSM.
 
Please hit <enter> when you are ready to proceed. 

Luna PED operation required to login to token - use token Security Officer (blue) PED key.
Luna PED operation required to create a partition - use User or Partition Owner (black) PED key.
Luna PED operation required to login to user on token - use User or Partition Owner (black) PED key.
Luna PED operation required to generate cloning domain on the partition - use Domain (red) PED key.
            
Object "1-User DES Key1" (handle 17) cloned to handle 11 on target
Object "1-User DES Key2" (handle 18) cloned to handle 12 on target
Object "1-User Public RSA Key1-512" (handle 19) cloned to handle 13 on target
.
.
.
Object "1-User ARIA Key3" (handle 124) cloned to handle 118 on target  
Object "1-User ARIA Key4" (handle 125) cloned to handle 119 on target
Object "1-User ARIA Key5" (handle 126) cloned to handle 120 on target
'partition backup' successful.

Command Result : 0 (Success)
[myluna] lunash:>


5.Use the token backup show command to verify the backup:

lunash:> token backup show -serial 667788
Token Details:  
============
Token Label:                      BackupHSM  
Serial #:                         700179  
Firmware:                         6.22.0  
Hardware Model:                   SafeNet USB HSM  
Authentication Method:            PED keys  
Token Admin login status:         Logged In  
Token Admin login attempts left:  3 before Token zeroization!

Partition Information:  
======================
Partitions licensed on token: 20  
Partitions created on token:   1
----------------------
Partition: 7000179008,         Name: bck1.

Token Storage Information:  
==========================

Maximum Token Storage Space (Bytes): 16252928  
Space In Use (Bytes):                    43616  
Free Space Left (Bytes):              16209312  

License Information:  
====================

621010355-000 621-010355-000 G5 Backup Device Base  
621000005-001 621-000005-001 Backup Device Partitions 20  
621000006-001 621-000006-001 Backup Device Storage 15.5 MB  
621000007-001 621-000007-001 Backup Device Store MTK Split Externally  
621000008-001 621-000008-001 Backup Device Remote PED Enable

Command result : 0 (Success)  
lunash:>
To restore a SafeNet Network HSM partition from a directly connected Backup HSM

To restore the partition contents from the SafeNet Remote Backup Device to the same local SafeNet Network HSM, use the same setup described above, but use the partition backup restore command instead .

1.Connect all the required components and open a terminal session to the SafeNet Network HSM appliance. See the following topics for details:

Open a Connection in the Configuration Guide

Backup HSM Installation, Storage, and Maintenance

As soon as the PED is connected to a powered HSM it starts up and defaults to Local mode with the Awaiting command... prompt.

2.Open a LunaSH session on the SafeNet Network HSM appliance.

login as: admin 
admin@192.20.10.202's password:
Last login: Tue Feb 28 16:03:46 2012 from 192.16.153.111

SafeNet Network HSM 5.1.0-25 Command Line Shell - Copyright (c) 2001-2011 SafeNet, Inc. All rights reserved.
[myluna] lunash:>

3.Use the partition restore command to restore a partition:

[myluna] lunash:>par restore -s 7000179 -tokenPar bk5 -par p1 -replace 
Please enter the password for the HSM partition:   
> *******

CAUTION: Are you sure you wish to erase all objects in the
          partition named: p1
          Type 'proceed' to continue, or 'quit' to quit now.
          > proceed
Warning: You will need to attach Luna PED to the SafeNet Backup HSM to complete this operation.
        You may use the same Luna PED that you used for SafeNet Network HSM.

Please hit <enter> when you are ready to proceed.

Luna PED operation required to login to user on token - use User or Partition Owner (black) PED key.
Object "1-User DES Key1" (handle 17) cloned to handle 11 on target  
Object "1-User DES Key2" (handle 18) cloned to handle 12 on target
Object "1-User Public RSA Key1-512" (handle 19) cloned to handle 13 on target
.
.
.
Object "1-User ARIA Key3" (handle 124) cloned to handle 118 on target
Object "1-User ARIA Key4" (handle 125) cloned to handle 119 on target
Object "1-User ARIA Key5" (handle 126) cloned to handle 120 on target
'partition restore' successful.

Command Result : 0 (Success)
[myluna] lunash:>  

Partition Backup and Restore Using a Backup HSM Connected to a Local Client Workstation

You can connect the Backup HSM to a SafeNet HSM client workstation to backup any SafeNet Network HSM or SafeNet PCI partitions that are visible as slots in LunaCM, as illustrated in the following figure:

Figure 2: Configuration for SafeNet Network HSM/PCI-E partition backup/restore using a Backup HSM connected to a local client workstation

In this configuration, you connect the Backup HSM and SafeNet Remote PED, via USB, to your SafeNet HSM client workstation. The SafeNet Network HSM appliance is remote to the SafeNet HSM client workstation and is connected using NTLS. Any installed PCI-E devices communicate with the SafeNet HSM client over the PCI bus.

Any partitions you want to backup must be registered with the SafeNet HSM client workstation, and be visible as slots in LunaCM. The Backup HSM most also be visible as a slot.

If you are backing up PED-authenticated partitions, you require a PED. If you want to backup SafeNet Network HSM partitions, the PED must have remote capability (Remote PED). Remote PED uses the pedserver/pedclient processes running on the SafeNet HSM client workstation and on the SafeNet Network HSM appliance to provide remote PED services for the network-attached SafeNet Network HSM appliance. The PED provides authentication for all of the attached HSMs (the USB-connected SafeNet Remote Backup HSM, the NTLS-connected SafeNet Network HSM, and the PCI bus-connected SafeNet PCI-E HSM). Every slot on the backup must have same domain (red PED Key) as the matching slot on the source HSMs.

Note:  If you have Private Key Cloning switched off for the current partition, then the backup operation proceeds, but skips over any private keys, and clones only the permitted objects onto the Backup HSM. Similarly, if you restore from a token that includes private keys, but the target partition has Private Key Cloning disallowed, then all other objects are recovered to the partition, but the private keys are skipped during the operation.

To backup an application partition to a Backup HSM connected to a SafeNet HSM client workstation

1.Configure the remote PED, as described in Remote PED.

2.Start the LunaCM utility on the SafeNet HSM client workstation.

C:\Program Files\SafeNet\LunaClient>lunacm.exe

LunaCM V2.3.3 - Copyright (c) 2006-2014 SafeNet, Inc.

        Available HSM's:

        Slot Id ->              1
        HSM Label ->            SA52_P1
        HSM Serial Number ->    500409014
        HSM Model ->            LunaSA
        HSM Firmware Version -> 6.22.0
        HSM Configuration ->    SafeNet Network HSM Slot (PED) Signing With Cloning Mode
        HSM Status ->           OK
     
        Slot Id ->              2
        HSM Label ->            BackupHSM Serial Number ->    700101
        HSM Model ->            G5Backup
        HSM Firmware Version -> 6.22.0
        HSM Configuration ->    Remote Backup HSM (PED) Backup Device
        HSM Status ->           OK

        Current Slot Id: 1

 

3.Use the slot set command to go to the slot you want to back up.

lunacm:> slot set slot 1

        Current Slot Id: 1     (SafeNet Network HSM Slot 6.10.1 (PED) Signing With Cloning Mode)

Command Result : No Error

 

4.Establish that the HSM is listening for a SafeNet Remote PED.

lunacm:>ped get

        HSM slot 1 listening to local PED (PED id=0).

Command Result : No Error

lunacm:> ped connect ip 192.20.10.190

Command Result : No Error

lunacm:> ped get

        HSM slot 1 listening to remote PED (PED id=100).

Command Result : No Error

lunacm:>
   

The SafeNet Network HSM is now listening for PED interaction via the link between PEDclient on the SafeNet Network HSM appliance and PEDserver on the workstation, and is not expecting a PED connected directly at the location of the SafeNet Network HSM.

5.Log into the partition in the current slot. This is the partition that you want to back up.

lunacm:> par login

        Option -password was not supplied.  It is required.

        Enter the password: *******

        User is activated, PED is not required.

Command Result : No Error

lunacm:> 
 

6.Disconnect the logical PED connection from your source HSM (slot 1 in this example), and connect to the Backup HSM (slot 2 in this example). The PED remains physically connected by USB cable to the SafeNet HSM client workstation, and remains in Remote mode - you are merely changing slots that are in conversation with that PED.

a.First, tell the SafeNet Network HSM to disconnect from Remote PED.

lunacm:> ped disconnect

        Are you sure you wish to disconnect the remote ped?

        Type 'proceed' to continue, or 'quit' to quit now -> proceed

Command Result : No Error

b.Then tell the Backup HSM to connect to Remote PED (it makes no difference that the PED and the Remote Backup HSM are USB-connected to the same workstation/laptop; when use of "Remote PED" is invoked by command "ped connect" and verified by "ped get", all HSM-PED interaction takes place between "pedclient" running on that workstation and "pedserver", also running on that workstation).

lunacm:> ped connect ip 192.20.10.189 -slot 2

Command Result : No Error

lunacm:> ped get -slot 2

        HSM slot 2 listening to remote PED (PED id=100).

Command Result : No Error

7.Use the partition archive backup command to perform the backup from the current slot (slot 1 in the example, see above) to the partition that you designate on the Backup HSM. Now that the Backup HSM is listening correctly for a PED, the target partition can be created, with PED action for the authentication.

lunacm:> partition archive backup -slot 2 -par SAbck1

        Logging in as the SO on slot 2.
        Please attend to the PED.

        Creating partition SAbck1 on slot 2.
        Please attend to the PED.

        Logging into the container SAbck1 on slot 2 as the user.
        Please attend to the PED.

        Creating Domain for the partition SAbck1 on slot 2.
        Please attend to the PED.

        Verifying that all objects can be backed up...
        85 objects will be backed up.

        Backing up objects...
        Cloned object 99 to partition SAbck1 (new handle 19).
        Cloned object 33 to partition SAbck1 (new handle 20).
        Cloned object 108 to partition SAbck1 (new handle 23).
        Cloned object 134 to partition SAbck1 (new handle 24).
        Cloned object 83 to partition SAbck1 (new handle 25).
        Cloned object 117 to partition SAbck1 (new handle 26).
        Cloned object 126 to partition SAbck1 (new handle 27).
        Cloned object 65 to partition SAbck1 (new handle 28).
        Cloned object 140 to partition SAbck1 (new handle 29).
        Cloned object 131 to partition SAbck1 (new handle 30).
        Cloned object 94 to partition SAbck1 (new handle 31).
        Cloned object 109 to partition SAbck1 (new handle 35).
        Cloned object 66 to partition SAbck1 (new handle 36).
        Cloned object 123 to partition SAbck1 (new handle 39).
        Cloned object 74 to partition SAbck1 (new handle 40).
        Cloned object 50 to partition SAbck1 (new handle 44).
        Cloned object 43 to partition SAbck1 (new handle 45).
        Cloned object 52 to partition SAbck1 (new handle 46).
        Cloned object 124 to partition SAbck1 (new handle 47).
        Cloned object 115 to partition SAbck1 (new handle 48).
        
        Backup Complete.

        20 objects have been backed up to partition SAbck1
        on slot 2.

Command Result : No Error
 

8.Backup is complete, and can be verified if you like.

To restore an application partition from a Backup HSM connected to a SafeNet HSM client workstation

1.Create a target partition for the restore operation on the HSM you are restoring to, if it does not already exist, and register the partition with the SafeNet HSM client workstation so that it is visible as a slot in LunaCM.

2.Start the LunaCM utility on the SafeNet HSM client workstation.

C:\Program Files\SafeNet\LunaClient>lunacm.exe

LunaCM V2.3.3 - Copyright (c) 2006-2014 SafeNet, Inc.

        Available HSM's:

        Slot Id ->              1
        HSM Label ->            SA52_P1
        HSM Serial Number ->    500409014
        HSM Model ->            LunaSA
        HSM Firmware Version -> 6.22.0
        HSM Configuration ->    SafeNet Network HSM Slot (PED) Signing With Cloning Mode
        HSM Status ->           OK
     
        Slot Id ->              2
        HSM Label ->            BackupHSM Serial Number ->    700101
        HSM Model ->            G5Backup
        HSM Firmware Version -> 6.22.0
        HSM Configuration ->    Remote Backup HSM (PED) Backup Device
        HSM Status ->           OK

        Current Slot Id: 1

 

3.Use the slot set command to go to the slot you want to restore to.

lunacm:> slot set slot 1

        Current Slot Id: 1     (SafeNet Network HSM Slot 6.22.0 (PED) Signing With Cloning Mode)

Command Result : No Error

4.Open a remote PED session to the SafeNet Network HSM you are restoring to.

lunacm:> ped connect ip 192.20.10.190

Command Result : No Error

lunacm:> ped get

        HSM slot 1 listening to remote PED (PED id=100).

Command Result : No Error

lunacm:>
   

The SafeNet Network HSM is now listening for PED interaction via the link between PEDclient on the SafeNet Network HSM appliance and PEDserver on the workstation, and is not expecting a PED connected directly at the location of the SafeNet Network HSM.

5.Log into the partition in the current slot. This is the partition that you want to restore to.

lunacm:> par login

        Option -password was not supplied.  It is required.

        Enter the password: *******

        User is activated, PED is not required.

Command Result : No Error

lunacm:> 

6.Use the partition archive restore command restore the partition from the Backup HSM to the current slot, adding to, or replacing, the current partition contents.

partition archive restore -slot <backup-hsm-slotnumber> -partition LunaSAPartitionname -password ClientPassword -replace

Note:  In the command above, you could have used -add instead of -replace. Adding might result in unwanted behaviors, such as having two keys with the same label, if one existed in the HSM Partition and one on the backup token. The two would be assigned different handles, however.