Host virtual machine assisting booting of a fully-encrypted user virtual machine on a cloud environment

The disclosure provides a key transmission method and device of a virtual machine under full disk encryption during pre-boot. The method includes: pre-booting the virtual machine, where the virtual machine is in a full disk encryption state; during the pre-boot, establishing, by the virtual machine, a transmission channel with a cloud platform, where the cloud platform is configured to provide a key; requesting, by the virtual machine, the key from the cloud platform through the transmission channel, and receiving the key sent by the cloud platform; and decrypting, by the virtual machine, an operation system by using the key, and booting the operation system. In embodiments of the present disclosure, key transmission may be implemented during a pre-boot phase of the virtual machine, so as to boot the virtual machine.

FIELD OF THE DISCLOSURE

The present disclosure relates to the field of communications technologies, and in particular, to a key transmission method and device of a virtual machine (Virtual Machine, VM) under full disk encryption during pre-boot.

BACKGROUND

In a cloud computing scenario, magnetic disk data of a virtual machine (Virtual Machine, VM), including data of a system disk and of a data disk, is under a security risk. If full disk encryption is performed on VM data and a key is held by a user, unauthorized personnel are incapable of obtaining data of the user. In this way, sensitive data of the user in the cloud is protected to a great degree.

A conventional full disk encryption technology, as a solution to terminal security, is already mature. In the conventional technology, before booting an operation system, that is, in a pre-boot (Pre-boot) phase, a key may be generated by a boot loader (boot loader) program according to a password input by the user. Data on the magnetic disk is decrypted by use of the key. The decrypted data includes an operation system (Operation System, OS), and the operation system may be booted after being decrypted.

In the foregoing conventional full disk encryption technology, the user executes an operation on a single terminal, and the boot loader program may obtain the key. However, in a cloud application scenario, a key needed by the VM needs to be obtained from an external cloud platform. Before the operation system of the VM is booted, the VM does not have an IP address and is incapable of communicating with the outside, thereby being incapable of obtaining the key. Therefore, the operation system of the VM cannot be booted, which causes the VM to be halted in the pre-boot phase.

SUMMARY

The present disclosure provides a key transmission method and device of a virtual machine under full disk encryption during pre-boot, so that a boot loader program in the VM may obtain a key in a pre-boot phase to boot an operation system of the VM.

The present disclosure provides a key transmission method of a virtual machine under full disk encryption during pre-boot, including: pre-booting the virtual machine, where the virtual machine is in a full disk encryption state; during the pre-boot, establishing, by the virtual machine, a transmission channel with a cloud platform, where the cloud platform is configured to provide a key; requesting, by the virtual machine through the transmission channel, a key from the cloud platform, and receiving the key sent by the cloud platform; and decrypting, by the virtual machine, an operation system by using the key, and booting the operation system.

The present disclosure provides a key transmission device of a virtual machine under full disk encryption during pre-boot, including: an establishing module, configured to pre-boot the virtual machine in a full disk encryption state, and establish a transmission channel with a cloud platform during the pre-boot, where the cloud platform is configured to provide a key; a transmitting module, configured to request, through the transmission channel, a key from the cloud platform, and receive the key sent by the cloud platform; and a decrypting module, configured to decrypt an operation system by using the key and boot the operation system.

It may be known from the foregoing solutions that, in embodiments of the present disclosure, during the pre-boot phase, the virtual machine establishes the transmission channel with the cloud platform that provides the key, implementing the key transmission during the pre-boot phase, so that the virtual machine is capable of obtaining the key, thereby decrypting the operation system of the virtual machine and booting the operation system of the virtual machine, and avoiding halting in the pre-boot phase due to incapability of obtaining the key.

DETAILED DESCRIPTION OF THE EMBODIMENTS

In order to make the objectives, solutions, and advantages of the present disclosure more clear, the solutions according to embodiments of the present disclosure are clearly and completely described in the following with reference to the accompanying drawings. Obviously, the embodiments described are merely part of rather than all of the embodiments of the present disclosure. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments of the present disclosure without making creative efforts shall fall within the protection scope of the present disclosure.

FIG. 1is a schematic flow chart of a key transmission method of a virtual machine under full disk encryption during pre-boot according to an embodiment of the present disclosure. The method includes:

Step11: A VM pre-boots, and establishes a transmission channel with a cloud platform during the pre-boot, where the cloud platform is configured to provide a key.

The VM is in a full disk encryption state during the pre-boot. That is, an operation system of the VM is in an encrypted state, and the operation system of the VM needs to be decrypted in order to complete the boot of the VM; otherwise the VM is halted in a pre-boot state as in the prior art.

The VM refers to a virtual machine that is used by a user. For example, in an XEN scenario, the VM refers to a Domain U. In addition, in the XEN scenario, a special virtual machine further exists, namely, a host (Domain0). The host is not a virtual machine used by a user, but a virtual machine that manages each Domain U. Therefore, in the XEN scenario, the foregoing VM refers to the Domain U. It may be understood that, for a scenario of other virtualization platforms where the Domain0and Domain U are not distinguished, for example, in a VMware ESXi scenario, a function of the Domain0may be executed by a hypervisor, and an operation executed by the Domain U may be executed by a virtual machine on the hypervisor.

Generally speaking, an operation system of the Domain0is not encrypted. Therefore, after the cloud platform delivers, to the Domain0, an instruction to boot the virtual machine, the operation system of the Domain0is booted. However, a system disk of the Domain U, that is, the disk where the operation system is located, is encrypted and needs decryption before being booted. A key of each Domain U may be stored in the cloud platform.

Modules which are in the cloud platform and relate to VM magnetic disk encryption may be further subdivided into a key management module and an encryption management module. The key management module is configured to manage the key of each Domain U, for example, generating a key corresponding to each Domain U, updating a key, storing a key, backing up a key, restoring a key, and so on. The encryption management module is configured to determine a management policy, for example, configuring information of a Domain U needing to be encrypted and configuring information of a volume needing to be encrypted on the Domain U. In addition, the encryption management module is also responsible for transferring a key in the key management module to the Domain U.

In addition, the foregoing transmission channel may be a transmission channel via the hypervisor (hypervisor), or a transmission channel directly established with the cloud platform by use of an IP address. Reference may be made to the subsequent embodiments for specific content.

Step12: The VM requests, through the transmission channel, the key from the cloud platform, receives the key sent by the cloud platform, and decrypts the operation system by using the key and boots the operation system.

Because the transmission channel has already been established between the cloud platform and the VM, the cloud platform may transmit the key to the VM through the transmission channel.

After obtaining the key, the VM may decrypt, according to the obtained key, the system disk where the operation system is located, and boot the operation system after obtaining the operation system, instead of being halted in a pre-boot phase as in the prior art.

In this embodiment, during the pre-boot phase, the transmission channel with the cloud platform that provides the key is established, implementing the key transmission during the pre-boot phase, so that the virtual machine is capable of obtaining the key, thereby decrypting the operation system of the virtual machine and booting the operation system of the virtual machine, and avoiding halting in the pre-boot phase due to incapability of obtaining the key.

FIG. 2is a schematic flow chart of a key transmission method of a virtual machine under full disk encryption during pre-boot according to another embodiment of the present disclosure, andFIG. 3is a schematic structural diagram of a system corresponding toFIG. 2. In this embodiment, an XEN scenario and a transmission channel established via a hypervisor is taken as an example.

Referring toFIG. 3, the system includes a key management module31, an encryption management module32, a host33, the virtual machine34, and a hypervisor (hypervisor)35. The key management module31and the encryption management module32may be located in a cloud platform. The host33, the virtual machine34, and the hypervisor35may be located on a cloud server. One cloud platform may manage multiple cloud servers. The host is a Domain0, and the virtual machine is a Domain U.

The key management module is configured to manage a key of each virtual machine, including functions of generating a key, updating a key, storing a key, backing up a key, and restoring a key. The key management module may be set by a cloud provider, and may also be set by a user. For example, in some application scenarios, if the user does not trust the cloud provider and requires to input a key corresponding to the virtual machine manually, the key may be managed by the user. At this time, the key management module may be a self-assistant portal (portal) key input system.

The encryption management module mainly manages which VM or VMs need to be encrypted and which volume or volumes of the VM(s) are encrypted. The user may make a choice according to a degree of sensitivity of data on a magnetic disk. Meanwhile, the module also undertakes a function of key transfer, transferring the key in the key management module to the virtual machine for use.

The host is deployed with a back-end key transferring module, configured to obtain the key from the cloud platform and transmit the key to a front-end key transferring module through a transmission channel in the hypervisor.

The hypervisor is a “meta” operation system in a virtual environment, and may access all physical devices including the magnetic disk and a memory on the cloud server. When the cloud server boots and executes the hypervisor, the hypervisor loads operation systems of all virtual machines and allocates a proper quantity of a memory, a CPU, a network, and a magnetic disk to each virtual machine. For example, the hypervisor may be an open-source XEN.

Each virtual machine may be deployed with an encryption agent (Agent) module, configured to perform encryption/decryption management of the virtual machine. For example, the user delivers an encryption instruction via the encryption agent module, encrypts data of the VM according to the key, or decrypts the encrypted data according to the key. In this embodiment, an encryption agent module including a boot loader module is taken as an example. The boot loader module is configured to run a boot loader program. The boot loader program may read the data including an encrypted operation system from the magnetic disk of the virtual machine, decrypt the operation system by using the key, and then boot the operation system. For example, the boot loader module may include a front-end key transferring module and an encrypting/decrypting module. The front-end key transferring module is configured to obtain the key. The encrypting/decrypting module is configured to encrypt/decrypt data according to the key obtained by the front-end key transferring module. In addition, in a pre-boot phase, the hypervisor may also virtually obtain a virtual basic input output system (Virtual Basic Input Output System, vBIOS) on the virtual machine.

Referring toFIG. 2in combination with the system shown inFIG. 3, the method provided in this embodiment includes:

Step201: Perform a boot procedure, including running of a boot loader (boot loader) module, where the boot loader module may include an encrypting/decrypting module and a front-end key transferring module.

For example, a cloud server is booted, a Domain0is booted, and a hypervisor is run.

Because the Domain0is not encrypted, after the cloud server is booted, the Domain0is booted. After being booted, the Domain0may obtain an IP address, and may establish a communication connection with a cloud platform side by using the IP address, and may establish a connection with an encryption management module, so as to exchange data with the cloud platform.

The cloud platform performs a pre-boot operation on a Domain U, boots the boot loader module during a pre-boot operation procedure, and allocates a transmission channel with the Domain0to each Domain U in the hypervisor when booting the Domain U.

For example, the pre-boot operation may include:

The encryption management module sends, to the Domain0, an instruction to boot a virtual machine.

The Domain0forwards, to the hypervisor, the instruction to boot the virtual machine.

After receiving the instruction to boot the virtual machine, the hypervisor boots the Domain U, obtains a vBIOS corresponding to the Domain0by virtualization, and loads a system volume file of the Domain U. The system volume file includes a part of data that does not need to be encrypted, and includes another part of data that needs to be encrypted. The data that does not need to be encrypted may be, for example, a boot loader program, a master boot record (Master Boot Record, MBR) of the magnetic disk, and so on. The data that needs to be encrypted includes an operation system of the Domain U, and may further include data in a data disk that needs to be encrypted by the user. For the data that does not need to be encrypted, the hypervisor may boot these programs one by one, for example, by loading. Because the boot loader program does not need to be encrypted, the boot loader module including the boot loader program may be booted after loading.

It may be understood that, the foregoing boot procedure and pre-boot operation of the cloud server may be implemented by using the existing technologies. Reference may be made to an existing process for the specific contents.

The hypervisor may provide the transmission channel for the Domain0and Domain U in a manner of sharing memory. For example, a stipulated shared memory space is allocated to each Domain U in the hypervisor. The memory space may be shared by the Domain0and the corresponding Domain U, so that the Domain U and the Domain0exchange data through the corresponding memory space.

Step202: The encrypting/decrypting module in the boot loader module sends a key request message to the front-end key transferring module.

Step203: The front-end key transferring module in the boot loader module sends the key request message to the back-end key transferring module in the Domain0through the transmission channel provided by the hypervisor.

For example, after booting the MBR, the hypervisor triggers sending of the key request message by the boot loader module.

The front-end key transferring module in each Domain U may send a key request message to the Domain0through the allocated shared memory space.

Step204: The back-end key transferring module adds identification information of the Domain U to the key request message, and sends the key request message to the encryption management module.

The identification information of the Domain U may be determined according to information of the shared memory which the key request message is from. For example, the key request message is from a first memory and the Domain0has allocated the first memory to a first Domain U during configuration. Then it may be determined that the identification information of the Domain U is identification information of the first Domain U.

Step205: The encryption management module forwards the key request message including the identification information of the Domain U to the key management module.

Step206: The key management module determines a corresponding key according to the identification information of the Domain U.

The key management module is a module that manages a key of each Domain U, and stores each Domain U and its corresponding key.

Step207: The key management module returns the key to the encryption management module.

Step208: The encryption management module returns the key to the back-end key transferring module.

Step209: The back-end key transferring module returns the key to the front-end key transferring module through the transmission channel in the hypervisor.

In addition, if decryption processing is performed on different Domain Us in parallel, a message of the returned key may further carry identification information of a corresponding Domain U. Definitely, if decryption processing is performed on each Domain U serially, identification information of a Domain U may not be carried.

Step210: The front-end key transferring module sends the key to the encrypting/decrypting module.

Step211: The encrypting/decrypting module in the boot loader module decrypts an operation system file of the Domain U according to the key received by front-end key transferring module; and the operation system is booted after the decryption.

For example, the boot loader module may first read the encrypted operation system from the magnetic disk and then decrypt the operation system by using the obtained key.

In this embodiment, by establishing the transmission channel between the Domain0and the Domain U in the hypervisor, a channel connection between the Domain U and the cloud platform may be implemented, so that the key may be obtained from the cloud platform, thereby implementing the decryption and boot of the operation system.

FIG. 4is a schematic flow chart of a key transmission method of a virtual machine under full disk encryption during pre-boot according to another embodiment of the present disclosure, andFIG. 5is a schematic structural diagram of a system corresponding toFIG. 4. In this embodiment, that a Domain U obtains an IP address and establishes a transmission channel with a cloud platform according to the IP address is taken as an example.

A difference from the foregoing embodiment is that, in this embodiment, a system volume file of each Domain U includes a boot loader operation system (boot loader OS), which is used to replace the boot loader program in the foregoing embodiment. The boot loader OS is a micro operation system, which not only has a function of the boot loader program, but also has the following functions:

(1) network interface card drive: capable of utilizing a function of a virtual network interface card obtained by virtualization by a vBIOS;

(2) dynamic host configuration protocol (Dynamic Host Configuration Protocol, DHCP) client function: capable of applying to a DHCP server for allocating an IP address; and

(3) TCP/UDP/IP protocol stack: capable of establishing a secure IP channel, for example, a secure sockets layer (Secure Sockets Layer, SSL) channel, with an encryption management module of the cloud platform, so as to obtain a key.

Because the foregoing boot loader OS is set, and the boot loader OS may apply to the DHCP server for the IP address via a virtual network interface card and establish a connection with an encryption management platform according to the IP address. Therefore, in this embodiment, there is no need to establish a transmission channel via the hypervisor.

After a cloud server is booted, a Domain0may be booted.

The cloud platform performs a pre-boot operation on the Domain U and boots a boot loader OS module during a pre-boot operation procedure.

Similar to the processing on the boot loader, the boot loader OS may be set in the system volume file and the boot loader OS is not encrypted. Therefore, the boot loader OS module may be booted during the pre-boot procedure.

Step401: A boot loader operation system (boot loader OS) module sends an IP address application message to a DHCP server via a virtual network interface card.

Step402: The DHCP server returns an allocated IP address to the boot loader OS module.

Step403: The boot loader OS module establishes a transmission channel with an encryption management module according to the obtained IP address.

Step404: The boot loader OS module sends a key request message to the encryption management module through the established transmission channel, where the key request message carries identification information of a Domain U.

Step405: The encryption management module sends the key request message carrying the identification information of the Domain U to the key management module.

Step406: The key management module determines a corresponding key according to the identification information of the Domain U, and returns the key to the encryption management module.

Step407: The encryption management module returns the key to the boot loader OS module through the established transmission channel.

In addition, if decryption processing is performed on different Domain Us in parallel, a message of the returned key may further carry identification information of a corresponding Domain U. Definitely, if decryption processing is performed on each Domain U serially, identification information of a Domain U may not be carried.

Step408: The boot loader OS module decrypts an operation system of the Domain U by using the key and boots the operation system.

Because the boot loader OS has a function of the boot loader, a processing process similar to that of the boot loader in the foregoing embodiment may implement the decryption and boot of the operation system.

In this embodiment, by setting the boot loader OS, the IP address is obtained and the transmission channel between the Domain0and the Domain U is established, thereby implementing a channel connection between the Domain U and the cloud platform, so that the key may be obtained from the cloud platform, implementing the decryption and boot of the operation system.

A decryption process is described in the foregoing, and an encryption process may be executed as follows. It may be understood that, the following encryption process may be applied before the foregoing decryption process, that is, after booting the operation system normally, the virtual machine may perform the full disk encryption on data. The virtual machine may be turned off after the full disk encryption, and when the virtual machine needs to be booted again next time, the foregoing decryption process may be used for processing in a pre-boot phase when the virtual machine is booted again.

FIG. 6is a schematic flow chart of an encryption method according to an embodiment of the present disclosure, including:

Step601: An encrypting/decrypting module of an encryption agent module receives a volume encryption instruction.

Step602: The encrypting/decrypting module sends a key application request message to a front-end key transferring module of the encryption agent module.

Step603: The front-end key transferring module of the encryption agent module sends the key application request message to a back-end key transferring module in a Domain0through a transmission channel in a hypervisor.

Step604: The back-end key transferring module adds identification information of a Domain U to the key application request message, and sends the key application request message to the encryption management module.

The back-end key transferring module may determine the identification information of the Domain U according to information of a shared memory.

Step605: The encryption management module forwards the key application request message including the identification information of the Domain U to a key management module.

Step606: The key management module generates a corresponding key according to the identification information of the Domain U.

Step607: The key management module returns the key to the encryption management module.

Step608: The encryption management module returns the key to the back-end key transferring module.

Step609: The back-end key transferring module returns the key to the front-end key transferring module through the transmission channel in the hypervisor.

In addition, if decryption processing is performed on different Domain Us in parallel, a message of the returned key may further carry identification information of a corresponding Domain U. Definitely, if decryption processing is performed on each Domain U serially, identification information of a Domain U may not be carried.

Step610: The front-end key transferring module sends the key to the encrypting/decrypting module.

Step611: The encrypting/decrypting module encrypts a volume by using the key, that is, performs full disk encryption on data of a virtual machine by using the key.

In this embodiment, reference may be made to the embodiment shown inFIG. 2for establishment of the transmission channel in the hypervisor and determination of the identification information of the Domain U by the Domain0.

FIG. 7is a schematic flow chart of an encryption method according to another embodiment of the present disclosure. Since an operation system of a Domain U is already booted during encryption, the Domain U may obtain an IP address, thereby establishing a connection with a cloud platform side. In this embodiment, establishing the connection between the Domain U and a cloud platform is taken as an example. This embodiment includes:

Step701: An encryption agent module receives a volume encryption instruction.

Step702: The encryption agent module sends a key application request message including identification information of a Domain U to an encryption management module through an established transmission channel.

Step703: The encryption management module sends the key application request message including the identification information of the Domain U to a key management module.

Step704: The key management module generates a corresponding key according to the identification information of the Domain U.

Step705: The key management module returns the key to the encryption management module.

Step706: The encryption management module returns the key to the encryption agent module through the established transmission channel.

In addition, if decryption processing is performed on different Domain Us in parallel, a message of the returned key may further carry identification information of a corresponding Domain U. Definitely, if decryption processing is performed on each Domain U serially, identification information of a Domain U may not be carried.

Step707: The encryption agent module encrypts a volume by using the key, that is, performs full disk encryption on data of a virtual machine by using the key.

In addition, in the foregoing embodiment, the identification information of the Domain U may be generated by using the following manner: first, when an encryption agent is installed, the encryption agent may generate a unique identifier according to some information (for example, MAC of the VM+some random numbers) by following a certain private algorithm. The identifier is retained by the encryption management module during registration of the encryption agent, is sent to the key management system, and is in a one-to-one correspondence with the key.

An encryption agent program should write some information, for example, MAC and random number information, at a certain location of a hard disk. Subsequently, a dynamic encrypting/decrypting module in a boot Loader OS obtains this identifier by calculation according to the information by following a private algorithm, and then carries this identifier in a key application message.FIG. 8is a schematic structural diagram of a key transmission device of a virtual machine under full disk encryption during pre-boot according to the present disclosure. In this embodiment, the device may be a Domain U. The device includes an establishing module81, a transmitting module82, and a decrypting module83. The establishing module81is configured to perform a pre-boot operation on the virtual machine in a full disk encryption state, and establish a transmission channel with a cloud platform during the pre-boot, where the cloud platform is configured to provide a key. The transmitting module82is configured to request a key from the cloud platform through the transmission channel, and receive the key sent by the cloud platform. The decrypting module83is configured to decrypt an operation system by using the key and boot the operation system.

The establishing module is a boot loader module. The boot loader module is configured to determine a transmission channel which is allocated to the virtual machine and is in a hypervisor, and obtain the transmission channel between the virtual machine and the cloud platform through the transmission channel which is allocated to the virtual machine and is in the hypervisor.

For example, in an XEN scenario, the boot loader module in the Domain U may establish a transmission channel with a Domain0via the hypervisor. The Domain0may obtain an IP address after being booted and may also establish a transmission channel with the cloud platform according to the IP address. Therefore, the Domain U may establish the transmission channel with the cloud platform via the Domain0.

The transmitting module is configured to:

send a key request message to the cloud platform through the transmission channel in the hypervisor, where the key request message carries identification information of the virtual machine, and receive a key returned by the cloud platform, where the key is determined by the cloud platform according to the identification information of the virtual machine.

The establishing module is a boot loader system module. The boot loader system module is configured to apply to a DHCP server for an IP address after the boot loader operation system is booted, and establish the transmission channel with the cloud platform according to the IP address.

The transmitting module is configured to: send the key request message to the cloud platform through the established IP channel, where the key request message carries the identification information of the virtual machine, and receive the key returned by the cloud platform, where the key is determined by the cloud platform according to the identification information of the virtual machine.

The transmitting module is configured to: send the key request message to a host through the transmission channel in the hypervisor, and send the key request message to the cloud platform via an IP connection channel between the host and the cloud platform, where the host finishes booting, obtains an IP address, and establishes the IP connection channel with the cloud platform before the virtual machine is pre-booted.

In this embodiment, the device may further include an encrypting module, configured to, after a previous normal boot of the operation system, send a key request message carrying the identification information of the virtual machine to the cloud platform through the transmission channel in the hypervisor, receive the key determined according to the identification information of the virtual machine and sent by the cloud platform, and perform full disk encryption processing on data of the virtual machine by using the key; or, after a previous normal boot of the operation system, obtain the IP address, establish the IP connection with the cloud platform according to the IP address, send the key request message carrying the identification information of the virtual machine to the cloud platform through the IP connection, receive the key determined according to the identification information of the virtual machine and sent by the cloud platform, and perform full disk encryption processing on data of the virtual machine by using the key.

In addition, the foregoing decrypting module and the encrypting module may belong to one same physical module, that is, be equivalent to the encrypting/decrypting module in the foregoing method.

In this embodiment, during a pre-boot phase, the transmission channel with the cloud platform providing the key is established, implementing the key transmission during the pre-boot phase, so that the virtual machine is capable of obtaining the key, thereby decrypting the operation system of the virtual machine and booting the operation system of the virtual machine, avoiding halting in the pre-boot phase due to incapability of obtaining the key.

Persons of ordinary skill in the art may understand that all or part of the steps of the foregoing method embodiments may be implemented by a program instructing relevant hardware. The foregoing program may be stored in a computer readable storage medium. When the program is executed, the steps of the foregoing method embodiments are executed. The foregoing storage medium may include various media that may store program codes, such as an ROM, an RAM, a magnetic disk, or a compact disk, and so on.

Finally, it should be noted that the foregoing embodiments are merely used for illustrating the solutions of the present disclosure, but not intended to limit the present disclosure. Although the present disclosure has been illustrated in detail with reference to the foregoing embodiments, persons of ordinary skill in the art should understand that, they may still make modifications to the solutions recorded in each foregoing embodiment, or make equivalent replacements to part of the features in it, where such modifications or replacements do not make the nature of corresponding solutions depart from the scope of the solutions of each embodiment of the present disclosure.