libGuid = $libGuid; $this->method = $method; $this->policy = $method == 4 && ($ekmType == 1 || $ekmType == 5) ? 0x2 : 0xFF; $this->density = 0xFF; $this->key_path = 0xFF; $this->method_not_used = 0; $this->policy_not_used = 0; $this->fips_mode = $fips_mode; $this->key_reuse = $key_reuse; } }; $akmResult = akm_get_error_codes(); $ekmServerTypeMap = array(1=> "Q-EKM", 2 => "SKM", 4 => "KMIP", 5 => "TKLM/SKLM"); function DoSkmSetup() { global $akmResult; global $user; $res = @akm_setup_servers($user); if( $res != $akmResult->SUCCEEDED ) { error_log("akm_setup_servers failed with a ". $res); return $res; } set_time_limit(0); // Turn off time limit or php will complain with large amounts of data do { sleep(60); @reset_inactive_timer($user); $akmStatus = @akm_setup_progress($user, 0); if( $akmStatus->result == 0x10 /* TimeOut */ ) { $akmStatus->status = 0x55003; break; } else if( $akmStatus->result == 0x2c /* BadSerialNumber */ ) { $akmStatus->status = 0x55000; break; } else if( $akmStatus->result == 0x7F000013 /* SetupDuplicateSerialNumber */ ) { $akmStatus->status = 0x7F000013; break; } } while( $akmStatus->status != $akmResult->StatusFinished ); set_time_limit(300); // Set back to the default if( $akmStatus->result == $akmResult->SUCCEEDED || $akmStatus->result == $akmResult->SetupSucceededKeysGenerated) { error_log("akm_setup_progress returned succeeded"); } return $akmStatus->result; } function hasLoadedDrive($libGuid) { global $user, $sortCriteria; $drives = get_all_drives_by_library($user, $libGuid, $sortCriteria, (int)0,(int)MEDIA_TYPE_ANY); foreach($drives as $drive) { if(strlen($drive->barcode) > 0) { return true; } } return false; } function libSupportsEkmType($lib, $type) { global $user, $sortCriteria; $drives = get_all_drives_by_library($user, $lib->guid, $sortCriteria, (int)0,(int)MEDIA_TYPE_ANY); foreach($drives as $drive) { if(!$drive->encryptionSupported) return false; if($drive->vendor == "IBM" && getDriveGeneration($drive) < 5 && ($type != 1 && $type != 5)) return false; if($drive->vendor == "IBM" && getDriveGeneration($drive) > 6 && ($type == 1)) return false; if($drive->vendor == "HP" && ($type == 1 || $type == 5)) return false; } return true; } function libSupportsFIPS($lib) { // Must have only HP LTO5+ FC drives global $user, $sortCriteria, $ekmType; // FIPS only works on SKM and KMIP if($ekmType != 2 && $ekmType != 4) return false; $drives = get_all_drives_by_library($user, $lib->guid, $sortCriteria, (int)0,(int)MEDIA_TYPE_ANY); foreach($drives as $drive) { if(!$drive->encryptionSupported) return false; if($drive->vendor == "IBM") return false; if(getDriveGeneration($drive) < 5) return false; if($drive->interfaceType != "Fibre") return false; } return true; } function libSupportsKeyReuse($lib) { // Must have only HP LTO4+ drives global $user, $sortCriteria, $ekmType; // KR only works on SKM and KMIP if($ekmType != 2 && $ekmType != 4) return false; $drives = get_all_drives_by_library($user, $lib->guid, $sortCriteria, (int)0,(int)MEDIA_TYPE_ANY); foreach($drives as $drive) { if(!$drive->encryptionSupported) return false; if($drive->vendor == "IBM") return false; } return true; } $qekmDefaults = get_ekm_multi($user, 1); $akmDefaults = get_ekm_multi($user, 2); $kmipDefaults = get_ekm_multi($user, 4); $tklmDefaults = get_ekm_multi($user, 5); $akmResult = akm_get_error_codes(); if ($_SERVER[REQUEST_METHOD] == "POST") { $keysGenerated = false; $operationInProgress = true; $status = new ReturnStatus(); $enableLME = strlen($_POST["enableLME"]) > 0 ? explode(":", $_POST["enableLME"]) : array(); $disableLME = strlen($_POST["disableLME"]) > 0 ? explode(":", $_POST["disableLME"]) : array(); $enableKR = strlen($_POST["enableKR"]) > 0 ? explode(":", $_POST["enableKR"]) : array(); $disableKR = strlen($_POST["disableKR"]) > 0 ? explode(":", $_POST["disableKR"]) : array(); $enableFIPS = strlen($_POST["enableFIPS"]) > 0 ? explode(":", $_POST["enableFIPS"]) : array(); $disableFIPS = strlen($_POST["disableFIPS"]) > 0 ? explode(":", $_POST["disableFIPS"]) : array(); $allToChange = array_merge($enableLME, $disableLME, $enableKR, $disableKR, $enableFIPS, $disableFIPS); // Double-check drives are unloaded foreach($allToChange as $libGuid) { if(hasLoadedDrive($libGuid)) { $status->setErrorCode(0x50021); print $status->out(); return; } } // Take partitions to be modified offline foreach($allToChange as $libGuid) { change_library_mode($user, $libGuid, 0); } // Perform SKM setup if necessary if($ekmType == 2 && count($enableLME) > 0) { if(akm_servers_available($user, true)) { $result = DoSkmSetup(); if($result != $akmResult->SUCCEEDED && $result != $akmResult->SetupSucceededKeysGenerated) { // SKM setup failed, so we have to stop here. error_log("skm setup failed: ".$result); $status->setErrorCode( $result ); print $status->out(); return; } else if($result == $akmResult->SetupSucceededKeysGenerated) { $keysGenerated = true; } } else { // Do nothing else & set error condition. Partitions will // remain offline. $status->setErrorCode( 1 ); // TODO determine proper error code print $status->out(); return; } } foreach($allToChange as $libGuid) { // Get current settings for this partition $ekm = get_partition_enryption($user, $libGuid); $method = $ekm->method; $reuseKeys = $ekm->reuse_keys; $fips = $ekm->fips_mode; // Determine new method based on presence in LME arrays if(in_array($libGuid, $enableLME)) $method = 4; if(in_array($libGuid, $disableLME)) $method = 3; if(in_array($libGuid, $enableKR)) $reuseKeys = true; if(in_array($libGuid, $disableKR)) $reuseKeys = false; if(in_array($libGuid, $enableFIPS)) $fips = true; if(in_array($libGuid, $disableFIPS)) $fips = false; // If LME is off, FIPS must also be off if($method != 4) $fips = false; $data = new EkmData($libGuid, $method, $fips, $reuseKeys); set_partition_enryption($user, $data); // Setup SNW license for each drive $drives = get_all_drives_by_library($user, $libGuid, $sortCriteria, (int)0,(int)MEDIA_TYPE_ANY); foreach($drives as $drive) { $license = get_dps_license($user, $drive->guid); submit_dps_license($user, $drive->guid, $license->CPFEnabled, $license->LMEnabled, $license->DPFEnabled, $fips); } } foreach($allToChange as $libGuid) { change_library_mode($user, $libGuid, 1); } if($keysGenerated) { print $status->closeMsg(4, "akm_setup_servers was run" ); } else { print $status->out(); } return; } // Determine if certificates are installed for the current EKM type $hasCerts = (($ekmType == 1) or ($ekmType == 5) or ($ekmType == 2 and has_certs_installed($user, 0, 4, 6) == 1) or ($ekmType == 4 and has_certs_installed($user, 8, 9) == 1)); // Determine if there are valid settings for the selected ekm type $hasValidDefaults = (($ekmType == 2 and count($akmDefaults->managers) >= 2) or ($ekmType == 4 and count($kmipDefaults->managers) >= 2) or ($ekmType == 1 and count($qekmDefaults->managers) >= 1) or ($ekmType == 5 and count($tklmDefaults->managers) >= 1)); // Get partition info $libs = get_logical_libraries($user, $sortCriteria); error_log("libs : ".print_r($libs,true)); foreach($libs as $k => $lib) { // Add info for FIPS and EKM support $libs[$k]->ekmSupported = libSupportsEkmType($lib, $ekmType); $libs[$k]->fipsSupported = libSupportsFIPS($lib); // Add info for Key Reuse support (not supported by IBM drives) $libs[$k]->krSupported = libSupportsKeyReuse($lib); // Add DPS license count $libs[$k]->snwUsed = get_dps_used_count_for_partition($user, $lib->guid); } // Collect a list of partitions with loaded drives $withLoadedDrives = array(); foreach($libs as $lib) { if(hasLoadedDrive($lib->guid)) array_push($withLoadedDrives, $lib->guid); } // Determine if SKM setup is in-progress $akmStatus = @akm_setup_progress($user, 0); $libBusy = !($akmStatus->status == $akmResult->StatusFinished || $akmStatus->status == $akmResult->StatusNotStarted); $ekmLicAvailable = get_ekm_drive_cnt($user); $snwLicAvailable = get_max_dps_drive_cnt($user); ?> Setup - Partition Encryption Key Server Access Configuration

Setup - Encryption Partition Configuration

Set up EKM encryption for library partitions.

An Encryption Key Management license must be installed on the library in order to use this feature.
Please click here to add a license key.

The Encryption Key Servers are not set up. Please make sure they are configured properly to view this page.
Please click here to go the "Setup - Encryption System Configuration" page and set up your EKM servers.

No encryption certificates are installed for the currently configured encryption key server type.
Please click here to go the "Import Encryption Certificates" page and install the certificates.

You cannot edit the Encryption Method of a partition with a tape cartridge loaded in a drive.

$lib) { $canChange = !in_array($lib->guid, $withLoadedDrives); ?>
Partition Type Library Managed Encryption Key Reuse FIPS  
name ?> " class="method == 4 ? "" : "disable"?>"> method == 4, $canChange && $lib->ekmSupported); ?> keyReuse, $canChange && $ekmType != 1 && $ekmType != 5); ?> fipsEnabled, $canChange && $ekmType != 1 && $ekmType != 5 && $lib->fipsSupported); ?>
(Cannot edit when a drive is loaded)