Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pankajjoshi/KEK URL rotation for CVM #1854

Open
wants to merge 16 commits into
base: ade-singlepass-dev
Choose a base branch
from

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
VMEncryption/main/handle.py Outdated Show resolved Hide resolved
VMEncryption/main/handle.py Outdated Show resolved Hide resolved
VMEncryption/main/CryptMountConfigUtil.py Outdated Show resolved Hide resolved
VMEncryption/main/DiskUtil.py Show resolved Hide resolved
#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 ...

@@ -270,6 +272,196 @@ def get_protected_settings():
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.

4 participants