Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions VMEncryption/main/check_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,17 +401,25 @@ def validate_skr_release_rsa_or_ec_key(self,public_settings,check_release_rsa_or
return
manage_id = public_settings.get(CommonVariables.EncryptionManagedIdentity)
KeyEncryptionKeyUrl=public_settings.get(CommonVariables.KeyEncryptionKeyURLKey)
if manage_id:
ret = self._update_imds_managed_id_env_variable(manage_id)
if not ret:
raise Exception(msg)
#checking if managed_id and KeyEncryptionKeyUrl is present. mandatory for DDE.
if not manage_id:
raise Exception('managed identity is not provided. Managed Identity is a mandatory field.')
if not KeyEncryptionKeyUrl:
raise Exception('KEK URL is not provided. Key encryption key URL is a mandatory field.')
ret = self._update_imds_managed_id_env_variable(manage_id)
if not ret:
raise Exception(msg)
cmd = './AzureAttestSKR -n 123456 -k {0} -c imds -r'.format(KeyEncryptionKeyUrl)
executor = CommandExecutor(self.logger)
result = executor.Execute(cmd)
if result != CommonVariables.process_success:
if manage_id:
raise Exception ('{0} Encryption managed identity: {1}'.format(msg,manage_id))
raise Exception(msg)
#SKR is failed trace the logs.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: # SKR has failed. Turn on tracing and log the output.

self.logger.log('SKR has failed. Turn on tracing and log the output.')
os.environ["SKR_TRACE_ON"]="1"
result = executor.Execute(cmd)
#re-check, to ensure the SKR.
if result != CommonVariables.process_success:
raise Exception(msg)
Comment thread
canfikret marked this conversation as resolved.
return

def precheck_for_fatal_failures(self, public_settings, encryption_status, DistroPatcher, existing_volume_type,check_release_rsa_or_ec_key=False):
Expand Down