Skip to content

Conversation

@pankajosh
Copy link

This commit is capturing KEK URL rotation for CVM.
Passphrase is re-wrapped with new KEK URL and stamped to LUKS2 header with new settings.

@pankajosh pankajosh changed the title Pankajjoshi/ke krotation cvm Pankajjoshi/KEK URL rotation for CVM Nov 30, 2023
#remove backup token id
self.remove_token(device_name=device_name,token_id=ade_token_id_backup)
return
self.logger.log("resotre luks2 token for device {0} is started.".format(device_name))
Copy link
Member

Choose a reason for hiding this comment

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

Replace all: resotre -> restore

Copy link
Author

Choose a reason for hiding this comment

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

done

self.import_token_data(device_path=device_path,token_data=data,token_id=CommonVariables.AzureDiskEncryptionToken)
#remove backup
self.remove_token(device_name=device_name,token_id=ade_token_id_backup)
self.logger.log("resotre luks2 token for device {0} is successful.".format(device_name))
Copy link
Member

Choose a reason for hiding this comment

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

... from toke id x to token id y.

Copy link
Author

Choose a reason for hiding this comment

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

done

#removing backup token
disk_util.remove_token(device_name=device_item.name,token_id=CommonVariables.cvm_ade_vm_encryption_backup_token_id)
extension_parameter.commit()
bek_util.umount_azure_passhprase(encryption_config)
Copy link
Member

Choose a reason for hiding this comment

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

Remove this bek_util ...

else:
return protected_settings_str

def create_temp_file(file_content):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we move these new functions to a new file called something like cvmLuksUtil?


def import_token(self,device_path,passphrase_file,public_settings):
'''this function reads passphrase from passphrase file, wrap it and update in token field of LUKS2 header.'''

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please move this new functions to a new file for CVM.

Copy link
Author

Choose a reason for hiding this comment

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

I have done it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants