Secure virtual machine measurement method, related equipment and storage medium
By calculating and verifying the hash value of the secure virtual machine, the problem of insufficient security during the startup process of the secure virtual machine is solved, ensuring that the cloud platform correctly starts the secure virtual machine according to user requirements, improving security and user trust.
Patent Information
- Application Number
- CN202410679864.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-08-27
AI Technical Summary
There are security issues in the startup process of secure virtual machines in the existing technology, resulting in deviations between the actual running secure virtual machines and user requirements. How to verify whether the cloud platform safely starts the secure virtual machines in accordance with user requirements and improve the efficiency of the secure virtual machine startup process? Security.
Provides a secure virtual machine measurement method by calculating the hash value in the configuration information of the target secure virtual machine and providing the hash value to the user terminal. The user terminal verifies the actually started secure virtual machine based on the hash value to ensure The cloud platform safely launches secure virtual machines according to user requirements.
It improves the security of the secure virtual machine startup process, ensures that the secure virtual machine starts correctly according to preset conditions, and enhances users' trust in the security of the cloud platform.
Smart Images

Figure CN118550646A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a secure virtual machine measurement method, related equipment and storage medium. Background Art
[0002] Trusted Execution Environment (TEE) is a computer technology proposed to enhance the security of cloud platforms. This technology covers multiple aspects such as hardware security modules, virtualization technology, and encryption algorithms. Among them, virtualization technology meets the information processing needs of different users by creating multiple secure virtual machines. At the same time, it also helps to maximize the utilization of hardware resources. It is one of the most critical technologies in the trusted execution environment.
[0003] Although the virtualization technology implemented based on the cloud platform can ensure the data security between secure virtual machines to a certain extent through the hardware-level isolation environment, various security issues may still arise in the startup process of the secure virtual machine, resulting in a deviation between the actually running secure virtual machine and user needs. Therefore, how to verify whether the cloud platform has safely started the secure virtual machine according to user requirements and improve the security of the secure virtual machine startup process has become one of the technical problems that technical personnel in this field need to solve urgently. Summary of the invention
[0004] In view of this, the present application is committed to providing a secure virtual machine measurement method, related equipment and storage medium. After the secure virtual machine is started, a hash value calculated based on the target configuration items of the secure virtual machine is provided to the user terminal. The user terminal verifies the actually started secure virtual machine based on the obtained hash value, ensuring that the cloud platform safely starts the secure virtual machine according to user requirements, thereby improving the security of the secure virtual machine startup process.
[0005] In a first aspect, the present application provides a secure virtual machine measurement method, which is applied to a first processor, and the method includes:
[0006] In response to the startup result of the target secure virtual machine, determining whether a preset virtual machine measurement condition is met;
[0007] If the preset virtual machine measurement condition is met, calculating a hash value of a target configuration item in the configuration information of the target secure virtual machine;
[0008] At least the hash value is provided to a user terminal, and the user terminal obtains the target configuration item based on the hash value and verifies the target configuration item.
[0009] In a possible implementation manner, determining whether a preset virtual machine metric condition is met includes:
[0010] If the cloud platform to which the first processor belongs is operating normally, the virtual machine manager corresponding to the target secure virtual machine is in a working state, the target secure virtual machine is in a waiting state for startup, and the security configuration information in the configuration information of the target secure virtual machine meets the preset configuration rules, it is determined that the preset virtual machine measurement condition is met;
[0011] If the cloud platform operates abnormally, or the virtual machine manager is in a non-working state, or the target secure virtual machine is not in the waiting-to-start state, or at least one configuration item in the security configuration information does not comply with the preset configuration rule, it is determined that the preset virtual machine measurement condition is not met.
[0012] In a possible implementation, the secure virtual machine measurement method provided in the first aspect of the present application further includes: if the cloud platform operates abnormally, controlling all secure virtual machines of the cloud platform to stop operating, and marking each of the secure virtual machines as inactive;
[0013] If the virtual machine manager is in a non-working state, controlling the virtual machine manager to run;
[0014] If the target secure virtual machine is not in the waiting-to-start state, terminating the measurement process of the target secure virtual machine, and notifying the user terminal that the target secure virtual machine is started abnormally;
[0015] If at least one configuration item in the security configuration information does not comply with the preset configuration rule, the measurement process of the target secure virtual machine is terminated.
[0016] In one possible implementation, the target configuration item includes at least one of the startup information of the secure virtual machine, the private data summary of the secure virtual machine, the version number of the secure firmware in the first processor, the summary of the secure firmware, a random number generated by the secure firmware, and a transmission key for encrypting configuration information.
[0017] In a possible implementation manner, at least providing the hash value to the user terminal includes:
[0018] Sending the hash value and the transmission key to the user terminal via a secure channel;
[0019] Among them, the secure channel is created based on the channel key generated by the first processor during the process of starting the target secure virtual machine, the user terminal obtains the ciphertext of the target configuration item based on the hash value, decrypts the ciphertext based on the transmission key, and verifies the plaintext of the obtained target configuration item.
[0020] In a possible implementation manner, the secure virtual machine measurement method provided in the first aspect of the present application further includes: obtaining a disk encryption key, where the disk encryption key is provided by the user terminal after determining that the target secure virtual machine measurement result is normal;
[0021] The disk data of the target secure virtual machine is encrypted based on the disk encryption key.
[0022] In a possible implementation, before encrypting the disk data of the target secure virtual machine based on the disk encryption key, marking the target secure virtual machine as a disk encryption state;
[0023] After encrypting the disk data of the target secure virtual machine based on the disk encryption key, marking the target secure virtual machine as an activated state.
[0024] In a second aspect, the present application further provides a processor, which is configured to execute the secure virtual machine measurement method as described in any one of the first aspects of the present application.
[0025] In a third aspect, the present application provides a system on chip, including a second processor and the first processor provided in the second aspect of the present application, wherein:
[0026] The second processor is communicatively connected to the first processor;
[0027] The second processor is used to start the secure virtual machine and send a start result of the secure virtual machine to the first processor.
[0028] In an optional implementation, the second processor is further configured to: during the secure virtual machine measurement process, check a startup process of a secure virtual machine that is not in a waiting-to-start state.
[0029] In a fourth aspect, the present application provides a server, comprising a system on chip, a memory, and a peripheral device as described in any one of the third aspects of the present application, wherein:
[0030] The system on chip is communicatively connected with the memory and the peripheral device respectively.
[0031] In a fifth aspect, the present application provides a computer-readable storage medium storing a computer program, which, when executed, implements the secure virtual machine measurement method as described in any one of the first aspects of the present application.
[0032] Based on the above content, in the secure virtual machine measurement method provided by the present application, the first processor determines whether a preset virtual machine measurement condition is met in response to the startup result of the target secure virtual machine. When the preset virtual machine measurement condition is met, the hash value of the target configuration item in the configuration information of the target secure virtual machine is calculated, and the obtained hash value is provided to at least the user terminal. The user terminal obtains the target configuration item based on the hash value, and verifies the target configuration item to determine whether the target secure virtual machine is started as required. Based on this, after the secure virtual machine is started, the method provides the user terminal with a hash value obtained based on the target configuration item. The user terminal verifies the actually started secure virtual machine according to the obtained hash value, thereby ensuring that the cloud platform safely starts the secure virtual machine according to user requirements and improving the security of the secure virtual machine startup process. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 It is a schematic diagram of a cloud service system involved in an embodiment of the present invention.
[0035] Figure 2 It is a schematic diagram of the structure of a system on chip provided by an embodiment of the present invention.
[0036] Figure 3 It is a flow chart of a secure virtual machine startup method provided by an embodiment of the present invention.
[0037] Figure 4 It is a flowchart of another secure virtual machine startup method provided by an embodiment of the present invention.
[0038] Figure 5 It is a flow chart of a cloud platform performance verification method provided by an embodiment of the present invention.
[0039] Figure 6 It is a flowchart of a secure virtual machine measurement method provided by an embodiment of the present invention.
[0040] Figure 7 It is a flowchart of another secure virtual machine measurement method provided by an embodiment of the present invention.
[0041] Figure 8 It is a flowchart of a secure virtual machine debugging method provided by an embodiment of the present invention.
[0042] Fig. 9It is a flowchart of another secure virtual machine debugging method provided by an embodiment of the present invention.
[0043] Fig.10 It is a flowchart of another secure virtual machine debugging method provided by an embodiment of the present invention.
[0044] Fig.11 It is a flowchart of another secure virtual machine startup method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0046] As mentioned earlier, Trusted Execution Environment (TEE) is a computer technology proposed to enhance the security of cloud platforms. This technology covers multiple aspects such as hardware security modules, virtualization technology, and encryption algorithms. Among them, virtualization technology meets the information processing needs of different users by creating multiple secure virtual machines. At the same time, it also helps to maximize the utilization of hardware resources. It is one of the most critical technologies in the trusted execution environment.
[0047] Given the important role of virtualization technology in a trusted execution environment, the security of secure virtual machines has become a research focus in this field. In the actual application of secure virtual machines, there are multiple links that may affect the normal operation of secure virtual machines, and thus affect the security of secure virtual machines and the entire cloud platform, such as the startup of secure virtual machines, the measurement of secure virtual machines, and the debugging of secure virtual machines. More importantly, it is also necessary to prevent attackers from spying on secure virtual machines through the virtual machine manager. The technical solution provided in this application aims to solve the relevant problems involved in the above process, provide support for the normal operation of secure virtual machines and the security of secure virtual machines, and then provide better services to users on the basis of fully utilizing the hardware resources of the cloud platform.
[0048] Based on the above content, this application relates to a cloud service system, combined with Figure 1 As shown, the cloud service system includes a server 10 and a user terminal 20.
[0049] First of all, it should be noted that in actual applications, the cloud service system can be configured with one or more servers 10. The specific number of servers 10 is determined based on the scale of the cloud service system and the computing power of a single server. This application does not limit the specific number of servers 10. For the convenience of describing the structure of the cloud service system provided by this application, Figure 1 In the illustrated embodiment, one server 10 is shown. The specific structure of the server 10 will be expanded in subsequent contents and will not be described in detail here.
[0050] The cloud platform provides a secure virtual machine operating environment for cloud service providers, combined with Figure 1 As shown, the cloud platform runs on the server 10, that is, the cloud platform mentioned in this application includes the hardware resources included in the server 10, and also includes software resources running on these hardware resources to provide cloud services to users. The cloud platform provides services to users in the form of virtual machines by sharing the hardware resources of the server.
[0051] The secure virtual machine runs on the cloud platform. In actual applications, one server 10 can usually support multiple secure virtual machines. Since virtualization technology allows the creation of multiple isolated execution environments on the same hardware, the relative isolation of each secure virtual machine can be ensured. On the basis of ensuring the security and isolation requirements of each secure virtual machine, full utilization of server hardware resources is achieved, and differentiated cloud services are provided to virtual machine users.
[0052] The user terminal 20 is a terminal used by the virtual machine user 30. In practical applications, the user terminal 20 can be a variety of terminal devices, such as a laptop, a personal computer, or a platform computer. Of course, it can also be other electronic products that can access the cloud platform and interact with the cloud platform. This application does not limit the specific selection and implementation of the user terminal 20.
[0053] The server 10 is connected to each user terminal 20 in communication, and provides a secure virtual machine for each user terminal 20. The virtual machine user 30 accesses the cloud platform through the user terminal 20, and can then rent (i.e. use) the secure virtual machine provided by the cloud platform, and enjoy the server resources provided by the server 10 in the form of a secure virtual machine. The virtual machine user 30 can deploy application software or store data in the secure virtual machine used by itself. Since each secure virtual machine shares server resources, the maximum utilization of server resources can be achieved. At the same time, due to the secure isolation between each secure virtual machine, the information security of each virtual machine user 30 can be guaranteed. In actual applications, the same virtual machine user 30 can rent one secure virtual machine from the server 10, or rent more than one secure virtual machine according to its own needs, which will not be repeated here.
[0054] Furthermore, the server 10 includes a system on chip, a memory, and peripheral devices for supporting the server 10 to implement the above functions. The system on chip is connected to the memory and the peripheral devices in communication, and the system on chip is based on information interaction with the memory and the peripheral devices, and executes various methods provided in the subsequent embodiments of this application to implement the server functions described in the above content. It should be noted that the specific selection of peripheral devices needs to be determined in combination with the specific composition and operation requirements of the system on chip and the specific functions of the server 10. In actual applications, peripheral devices may include external storage devices (hard disks, etc.), input / output devices, networking devices and other devices. Of course, other devices may also be included, which are not listed here one by one. Without exceeding the core idea of this application, they also fall within the scope of protection of this application.
[0055] For optional implementations of the system on chip, see Figure 2 The system on chip 11 provided in this embodiment includes a first processor 111, a second processor 112 and a memory controller 113. Of course, the system on chip 11 may also include other components, which are not detailed in this embodiment. The specific implementation can refer to the relevant technology, and this application does not make specific limitations on this.
[0056] Specifically, the first processor 111 may select an existing controller in the system-on-chip, or may add a controller in the system-on-chip to implement the relevant functions described in this application. In practical applications, as a preferred implementation, the first processor 111 may be a secure coprocessor (Secure Coprocessor, SCP). The secure coprocessor is a processor specially set up in the system-on-chip responsible for data security, and participates in the execution of the secure virtual machine startup method, secure virtual machine debugging method, and secure virtual machine measurement method provided in the subsequent embodiments of this application. It should be noted that in the subsequent embodiments of this application, the first processor 111 will be carried out using the secure coprocessor as an example. In an optional implementation, the secure coprocessor is configured with secure firmware, which can be regarded as a security management program in the secure coprocessor, specifically used to implement the relevant methods provided in the subsequent embodiments of this application.
[0057] Accordingly, the selection of the second processor 112 is similar to that of the first processor 111. You can select an existing controller in the system on chip, or you can add a controller in the system on chip to implement the relevant functions described in this application. In practical applications, as a preferred implementation, the second processor 112 can be an application processor (AP). Figure 2As shown, the application processor can configure the virtual machine manager (Hypervisor) in software form, and virtualize n secure virtual machines (n is an integer ≥ 1) through virtualization technology. The multiple secure virtual machines can be managed by the virtual machine manager, for example, the virtual machine manager participates in managing the startup of the secure virtual machine, the debugging of the secure virtual machine, and the management of the private memory space of the secure virtual machine divided in the memory 12. It should be noted that in the subsequent embodiments of this application, the second processor 112 will be carried out by taking the application processor as an example. Furthermore, the operation steps performed by the application processor are specifically performed by the virtual machine manager.
[0058] Furthermore, the first processor 111 is connected to the second processor 112 in communication, and information can be exchanged between the two. More importantly, compared with the second processor 112, the first processor 111 has higher security. Therefore, the first processor 111 is mainly used to process data interaction and related control processes within the system on chip, while the second processor 112 is also used to implement information interaction with external devices, such as receiving requests or information from user terminals. The specific functions of the first processor 111 and the second processor 112 will be introduced in conjunction with specific embodiments in the subsequent content, and will not be described in detail here.
[0059] The memory controller 113 is mainly used to implement access control of the memory 12. It is the hardware that controls the memory 12 and enables the memory 12 to exchange data with the system on chip. In virtualization technology, part or all of the space of the memory 12 can be used as the private memory space of the secure virtual machine. Different secure virtual machines can be allocated different private memory spaces in the memory 12. Figure 2 As shown, the memory controller 113 is integrated inside the system on chip, and is respectively connected to the first processor 111, the second processor 112 and the memory 12 outside the system on chip, and the first processor 111 and the second processor 112 access the memory 12 through the memory controller 113. Furthermore, the memory controller 113 provided in the present application is also configured with a cryptographic engine and a key slot. In a possible implementation, the key slot is implemented based on a register and is used to store relevant keys during the operation of the secure virtual machine and the virtual machine manager, such as the virtual machine key described in the subsequent embodiments. Of course, other keys can also be stored according to actual application requirements, which are not listed here one by one. Through the cryptographic engine and the key slot, encryption and decryption operations can be implemented on the virtual machine data of each secure virtual machine in the corresponding private memory space to achieve security protection of the virtual machine data.
[0060] The actual operation of a secure virtual machine involves multiple links such as configuration, startup, measurement, and debugging. The startup process of a secure virtual machine involves the initial stage of establishing a trusted execution environment, which is of great significance for ensuring the security of a feasible execution environment. Therefore, how to improve the security of the startup process of a secure virtual machine, prevent potential attacks by malware or attackers, and thereby ensure the security of a trusted execution environment has become one of the technical issues that technical personnel in this field need to solve urgently.
[0061] To solve the above problems, the present application provides a secure virtual machine startup method based on the cloud service system and system on chip provided by the aforementioned embodiments. The method is applied to the system on chip provided by the aforementioned embodiments, and is specifically executed by the first processor and the second processor in the system on chip, which cooperate with each other to realize the startup of the secure virtual machine. Since the startup process of the secure virtual machine is completed by the second processor and the first processor, the security of the startup process can be guaranteed. At the same time, the first processor will also encrypt the operating system files of the secure virtual machine and control the entire startup process to prevent the operating system from being attacked or tampered with. Therefore, it can effectively prevent potential attacks by malware or attackers, thereby ensuring the security of the trusted execution environment.
[0062] Based on the above, see Figure 3 The process of the secure virtual machine startup method provided in this embodiment may include the following steps.
[0063] S100: The application processor sends a virtual machine startup request.
[0064] Combination Figure 1 As shown, the cloud platform provides a secure virtual machine rental service to virtual machine users. Virtual machine users access the cloud platform through user terminals and enjoy the server resources provided by the server in the form of secure virtual machines. Based on this, as an optional implementation, when a virtual machine user needs to start an existing secure virtual machine in the cloud platform, the virtual machine user can send a virtual machine startup request to the cloud platform through the user terminal. Based on the foregoing content, it can be seen that the application processor is mainly responsible for the interaction with the user terminal. Therefore, the application processor receives the virtual machine startup request sent by the user terminal, and further sends the obtained virtual machine startup request to the security coprocessor.
[0065] In an optional implementation, different secure virtual machines are distinguished by different virtual machine identifiers (Virtual Machine Identifier, VMID), that is, each secure virtual machine will be assigned a VMID by the virtual machine manager during the creation process, and the VMIDs corresponding to the secure virtual machines are different from each other, and the VMIDs corresponding to the secure virtual machines will not change during the entire life cycle of the secure virtual machine. The VMID can uniquely represent the corresponding secure virtual machine. Based on this, the virtual machine startup request described in this embodiment may include the VMID of the secure virtual machine to be started, thereby clearly and uniquely indicating the secure virtual machine to be started. For ease of expression, this application defines the VMID of the secure virtual machine to be started as the target VMID. As for the creation of the secure virtual machine and the allocation process of the VMID, it will be expanded in the subsequent content and will not be described in detail here.
[0066] S101: The security coprocessor provides a first notification command to the application processor in response to a virtual machine startup request.
[0067] In actual applications, the operating systems used by various secure virtual machines may be the same or different. What is important is that the operating system files of each secure virtual machine are independently stored in an external storage device (such as a hard disk). Therefore, in the process of starting the secure virtual machine, the operating system files need to be loaded into the memory in the form of a mirror or the like. Based on this, the secure virtual machine startup method provided in this embodiment instructs the application processor to load the operating system files of the secure virtual machine to be started into the memory through the first notification command.
[0068] It should be noted that sending the first notification command in response to a virtual machine startup request is only an optional implementation method. In actual applications, the security coprocessor can also determine the timing of sending the first notification command through other means, which will not be elaborated here. Under the premise of not exceeding the core idea of this application, it also falls within the scope of protection of this application.
[0069] In an optional implementation, the virtual machine startup request includes a target VMID of the secure virtual machine to be started. After receiving the virtual machine startup request, the security coprocessor parses the virtual machine startup request to obtain the target VMID.
[0070] Furthermore, during the process of creating each secure virtual machine, the security coprocessor also stores all the configuration information of the secure virtual machine, and the configuration information records the operating system used by the corresponding secure virtual machine. More importantly, the configuration information of the secure virtual machine uses the VMID corresponding to the virtual machine itself as an index, and the configuration information of a secure virtual machine can be uniquely determined by the VMID. Based on this, after extracting the target VMID of the secure virtual machine to be started carried in the virtual machine startup request, the target configuration information corresponding to the secure virtual machine to be started is determined according to the target VMID, and the operating system used by the secure virtual machine to be started can be determined by querying the content recorded in the target configuration information. The security coprocessor generates a first notification command indicating the operating system and sends the first notification command to the application processor.
[0071] It should be noted that the first notification command can indicate the operating system in a variety of ways. For example, the operating system identifier can be carried in the first notification command. Of course, the operating system can also be indicated in other ways, which will not be described in detail here. The present invention does not limit the specific implementation method of the first notification command to indicate the operating system.
[0072] S102: The application processor loads the operating system file of the secure virtual machine to be started into the memory in response to the first notification command.
[0073] After the application processor parses the obtained first notification command and determines the operating system used by the secure virtual machine to be started, the application processor loads the operating system file of the secure virtual machine to be started into the memory in the form of a mirror.
[0074] S103: The security coprocessor encrypts the operating system files.
[0075] In the secure virtual machine startup method provided in this application, the secure coprocessor generates a unique virtual machine key for each secure virtual machine. The virtual machine keys of each secure virtual machine are uniformly managed by the secure coprocessor. The virtual machine key is mainly used to perform encryption and decryption operations on data stored in the memory. As for the process of generating the virtual machine key by the secure coprocessor, it will be expanded in the subsequent content and will not be described in detail here. For the convenience of description, the virtual machine key of the secure virtual machine to be started is referred to as the target virtual machine key in this embodiment.
[0076] In an optional implementation, the security coprocessor also establishes a binding relationship between the virtual machine key and the VMID. Based on this, after parsing the virtual machine startup request to obtain the target VMID, the target virtual machine key corresponding to the target VMID can be determined by querying the aforementioned binding relationship, and then the operating system file of the secure virtual machine to be started is encrypted based on the target virtual machine key. As for the specific implementation process of the security coprocessor accessing the memory through the memory controller and encrypting the operating system files in the memory, reference can be made to the relevant technology and will not be described in detail here.
[0077] It is understandable that by encrypting the operating system files, the security of the operating system files can be significantly improved, preventing external attacks from easily attacking the operating system of the secure virtual machine, thereby improving the security of the secure virtual machine. Furthermore, since the virtual machine keys used by each secure virtual machine are different, encrypting the operating system files can also prevent a secure virtual machine from using or changing the private data of other secure virtual machines, which helps to improve the isolation and security between secure virtual machines.
[0078] S104: The security coprocessor provides a second notification command to the application processor.
[0079] After completing the encryption of the operating system file of the secure virtual machine to be started, the security coprocessor further sends a second notification command to the application processor, instructing the application processor to start the secure virtual machine to be started.
[0080] In an optional implementation, for a secure virtual machine that has been created, the security coprocessor generates a second notification command carrying a target VMID, and sends the second notification command to the application processor.
[0081] S105: The application processor loads the target operating environment of the secure virtual machine to be started in response to the second notification command.
[0082] In response to the second notification command, the application processor determines the target operating environment information required to create the target operating environment of the secure virtual machine to be started, such as the initial register information required for starting the secure virtual machine, private memory address information, etc. Of course, other information required to meet the operation of the secure virtual machine can also be included, which will not be listed here one by one. Without exceeding the core idea of this application, it also belongs to the scope of protection of this application. After determining the target operating environment information, the target operating environment required for the operation of the secure virtual machine to be started can be created based on the target operating environment information.
[0083] In an optional implementation, the operating environment information of the secure virtual machine is indexed by VMID, i.e., VMID is used as an identifier of the operating environment information. As can be seen from the foregoing content, the VMIDs corresponding to the various secure virtual machines are different. Therefore, the operating environment information corresponding to each secure virtual machine can be accurately distinguished by VMID. Accordingly, after determining the target VMID, the operating environment information indexed by the target VMID is the operating environment information of the secure virtual machine to be started.
[0084] Based on this, when the second notification command includes the target VMID, the application processor parses the obtained second notification command, extracts the target VMID contained therein, and then determines the target operating environment information corresponding to the target VMID among multiple operating environment information, and further creates the target operating environment of the secure virtual machine to be started based on the obtained target operating environment information.
[0085] As for the specific implementation method of creating an operating environment based on the target operating environment information, reference can be made to related technical implementations, and this application does not limit this.
[0086] S106: The application processor executes the encrypted operating system file in the target operating environment to start the secure virtual machine to be started.
[0087] After the target operating environment is created, the application processor executes the encrypted operating system file in the target operating environment, starts the operating system of the secure virtual machine to be started, and completes the startup of the secure virtual machine to be started.
[0088] To sum up, through the secure virtual machine startup method provided by this embodiment, the startup process of the secure virtual machine is completed by the second processor and the first processor in cooperation, which can ensure the security of the startup process. At the same time, the first processor separately manages the virtual machine key of the secure virtual machine, and encrypts the operating system files of the secure virtual machine through the virtual machine key, which can prevent the operating system from being attacked or tampered with. Therefore, it can effectively prevent potential attacks by malware or attackers, thereby ensuring the security of the trusted execution environment.
[0089] Furthermore, in the case where the first processor adopts a security coprocessor, compared with the startup method in the prior art in which the virtual machine manager is fully responsible for starting the secure virtual machine, this method transfers part of the startup steps to the security coprocessor for execution. Therefore, the security of the security coprocessor can be fully utilized to increase the difficulty of malicious attacks. In addition, the security coprocessor uses the virtual machine key to encrypt the operating system, which can also ensure the security of the virtual machine operating system, helping to further improve the security of the secure virtual machine startup process.
[0090] It should be noted that although the application processor (i.e., the virtual machine manager) has completed the startup of the secure virtual machine, for security reasons, the secure virtual machine cannot provide services to the user at this time. In this application, whether the secure virtual machine can provide services to the user is determined by the application processor. Based on this, as an optional implementation, after the application processor starts the secure virtual machine, the security coprocessor temporarily marks the secure virtual machine as waiting for startup. In addition, the secure virtual machine can only provide services to the virtual machine user if the security coprocessor marks the secure virtual machine as activated. This process will be expanded in the subsequent content and will not be described in detail here.
[0091] It can be understood that in actual applications, there are roughly two scenarios for using secure virtual machines. In one scenario, the secure virtual machine has been created, and the virtual machine user directly uses the cloud platform to access and start the secure virtual machine. In this scenario, the secure virtual machine can be started according to the method provided in the aforementioned embodiment. In another scenario, the secure virtual machine has not yet been created. The cloud platform first needs to create a secure virtual machine according to the configuration requirements of the virtual machine user before it can start the secure virtual machine. For this scenario, based on the aforementioned embodiment, this application provides another secure virtual machine startup method to implement the configuration of the secure virtual machine and the entire startup process.
[0092] See also Figure 4 The secure virtual machine startup method provided in this embodiment includes the following steps.
[0093] S200: The application processor provides the security coprocessor with configuration information of the security virtual machine to be started.
[0094] It is understandable that the cloud platform provides cloud platform resources and services to virtual machine users in the form of secure virtual machines. In order to meet the needs of different virtual machine users, the cloud platform supports virtual machine users to configure the secure virtual machines they rent, and then enjoy personalized customized services.
[0095] As mentioned above, the application processor can exchange information with the user terminal of the virtual machine user. On this basis, the virtual machine user can send configuration requirements to the cloud platform, that is, to the application processor, through the user terminal. In an optional implementation, the virtual machine user's configuration requirements for the secure virtual machine are carried in the form of a configuration file, that is, the configuration file records all configuration information related to the secure virtual machine. Before creating a secure virtual machine, the virtual machine user uploads the configuration file of the secure virtual machine to be started to the cloud platform through the user terminal. After receiving the configuration file, the application processor parses the configuration file to obtain the configuration information therein.
[0096] Furthermore, based on the different roles played by configuration information in the entire life cycle of the secure virtual machine, the obtained configuration information can be further divided into startup configuration information, debugging configuration information, and security configuration information, among which the startup configuration information mainly includes the information required to create a secure virtual machine operating environment, the debugging configuration information mainly includes information related to the secure virtual machine debugging process, such as whether the secure virtual machine is allowed to be debugged, etc., and the security configuration information mainly includes information related to the secure virtual machine measurement process, such as whether to enable the encryption isolation function, whether to enable the virtual machine sharing function, whether to allow virtual machine migration, whether to allow cross-virtual machine data sharing, etc.
[0097] In an optional implementation, the application processor stores the security configuration information in a user-mode QEMU (Quick Emulator) space.
[0098] After parsing and obtaining all the configuration information of the secure virtual machine to be started, the application processor sends the configuration information to the security coprocessor.
[0099] S201. The security coprocessor stores configuration information in a pre-created secure virtual machine structure and sends a third notification command.
[0100] After receiving the configuration information of the security virtual machine to be started, the security coprocessor creates a security virtual machine structure for the security virtual machine and stores the obtained configuration information in the security virtual machine structure. At the same time, the life cycle of the security virtual machine to be started is also recorded. As for the specific implementation method of the security coprocessor to create the security virtual machine structure and the specific form of the security virtual machine structure, they can all be implemented with reference to the relevant technology, and this application does not limit this.
[0101] Further, the security coprocessor sends a third notification command to the application processor.
[0102] S202: In response to the third notification command, the application processor allocates a target virtual machine identifier for the secure virtual machine to be started.
[0103] As mentioned above, the present application uniquely characterizes the secure virtual machine through VMID, including various information related to the secure virtual machine. Therefore, it is necessary to allocate VMID to the secure virtual machine during the secure virtual machine creation process. In response to the third notification command, the application processor selects an unused target VMID from the VMID set, allocates it to the secure virtual machine to be started, and feeds back the allocation result to the security coprocessor.
[0104] S203: The security coprocessor stores the target virtual machine identifier in the secure virtual machine structure and sends a first notification command.
[0105] After receiving the target VMID of the secure virtual machine to be started fed back by the application processor, the security coprocessor stores it in the aforementioned secure virtual machine structure. It can be seen that one secure virtual machine corresponds to one secure virtual machine structure, which is used to store the configuration information and VMID of the secure virtual machine. Of course, it can also be used to store other related information, which will not be described in detail here.
[0106] At this point, the creation process of the secure virtual machine to be started has been completed. As an optional implementation, the security coprocessor marks the secure virtual machine to be started as a creation state from the time it receives the aforementioned configuration information to the time it stores the target VMID in the secure virtual machine structure.
[0107] Further, the security coprocessor provides the first notification command to the application processor. As an optional implementation, the specific implementation of the security coprocessor sending the first notification command can be referred to. Figure 3 The relevant contents of S101 in the illustrated embodiment will not be repeated here.
[0108] In an optional implementation, after obtaining the configuration information and the target VMID, the security coprocessor verifies the legitimacy of the startup configuration information and the target VMID in the configuration information. If the startup configuration information or the target VMID is abnormal, the subsequent startup process is terminated immediately and an alarm message is fed back.
[0109] S204: The application processor records the operating system file of the secure virtual machine to be started into the memory in response to the first notification command.
[0110] In an optional implementation, this step can refer to Figure 3 The implementation of the relevant contents of S102 in the illustrated embodiment will not be repeated here.
[0111] S205: The security coprocessor generates a target virtual machine key for the secure virtual machine to be started, and establishes a binding relationship between the target virtual machine key and the target virtual machine identifier.
[0112] The security coprocessor can generate the target virtual machine key in a variety of ways, for example, calling a true random number generator to generate a 128-bit target virtual machine key, and sending the resulting target virtual machine key to the cryptographic engine through a secure channel. Of course, the security coprocessor can also generate the target virtual machine key in other ways, which are not listed here one by one, and this application does not limit the specific generation process of the target virtual machine key.
[0113] Combined with the above content, it can be seen that there is a one-to-one correspondence between the virtual machine key, VMID and secure virtual machine. Figure 3During the startup method provided in the illustrated embodiment, it is convenient to determine the target virtual machine key of the secure virtual machine to be started. After generating the target virtual machine key, the security coprocessor further establishes a binding relationship between the target virtual machine key and the target VMID to ensure that the target virtual machine key can be accurately determined according to the target VMID.
[0114] In an optional implementation, after obtaining the target virtual machine key, the security coprocessor will also store the target virtual machine key in a key slot in the memory controller for subsequent use in encrypting and decrypting memory data.
[0115] S206: The security coprocessor encrypts the operating system file based on the target virtual machine key.
[0116] After the target virtual machine key is generated, the security coprocessor encrypts the operating system file of the secure virtual machine to be started based on the target virtual machine key.
[0117] It is understandable that the relevant contents of S205-S206 in this embodiment can be regarded as Figure 3 In the illustrated embodiment, S103 is another implementation method in the process of starting a secure virtual machine that is used for the first time.
[0118] S207: The security coprocessor sends a second notification command including startup configuration information to the application processor.
[0119] As mentioned earlier, Figure 3 The startup method provided in the illustrated embodiment is applicable to a secure virtual machine that has been created, and the operating environment information related to the secure virtual machine has added VMID as an index. However, in the application scenario corresponding to this embodiment, the application processor cannot yet obtain the operating environment information of the secure virtual machine configuration to be started. Based on this, the security coprocessor extracts the startup configuration information in the aforementioned configuration information, generates a second notification command including the startup configuration information, and sends the second notification command to the application processor.
[0120] It can be understood that the second notification command in this embodiment is different from Figure 3 The second notification command in the illustrated embodiment can be regarded as another implementation method in the process of starting the secure virtual machine used for the first time. In this embodiment, the second notification command is used to instruct the application processor to load the target operating environment of the secure virtual machine to be started according to S208-S210.
[0121] S208: The application processor parses the startup configuration information in the configuration information included in the second notification command.
[0122] The application processor parses the obtained second notification command to obtain startup configuration information related to the secure virtual machine to be started, included in the command.
[0123] S209: The application processor creates target operating environment information of the secure virtual machine to be started based on the startup configuration information, and uses the target virtual machine identifier as an index of the target operating environment information.
[0124] The application processor first creates the target operating environment information of the secure virtual machine to be started based on the startup configuration information, for example, sets the initial register information based on the startup configuration information, and determines the private memory space of the secure virtual machine to be started.
[0125] Then, the application processor uses the target virtual machine identifier as the index of the aforementioned target operating environment information, so that the startup configuration information of the to-be-started secure virtual machine corresponds to the same target VMID, which facilitates determining the corresponding operating environment information when the to-be-started secure virtual machine is started again.
[0126] S210: The application processor creates an operating environment for the secure virtual machine to be started based on the target operating environment information.
[0127] In an optional implementation, this step can refer to Figure 3 The implementation of the relevant contents of S105 in the illustrated embodiment will not be repeated here.
[0128] S211. The application processor executes the encrypted operating system file in the target operating environment to start the secure virtual machine to be started.
[0129] In an optional implementation, this step can refer to Figure 3 The implementation of the relevant contents of S106 in the illustrated embodiment will not be repeated here.
[0130] At this point, the startup process of the secure virtual machine to be started that was created and started for the first time has been completed. As an optional implementation, the security coprocessor marks the secure virtual machine to be started as a waiting-to-start state during the process from sending the first notification command to starting the secure virtual machine to be started.
[0131] In summary, this embodiment provides a secure virtual machine startup method, which, based on the advantages of the startup method provided by the aforementioned embodiment, meets the actual application needs of creating and starting a secure virtual machine for the first time. At the same time, by establishing a binding relationship between a virtual machine key and a VMID and using the VMID as an index of operating environment information and other technical solutions, the efficiency and security of the secure virtual machine when it is restarted can be effectively improved.
[0132] It is understandable that the security virtual machine runs on the cloud platform, and the security and operating performance of the cloud platform have a direct impact on the safe and reliable operation of the security virtual machine, and naturally also affect the data security of the virtual machine user. Therefore, it is necessary for the virtual machine user to verify the relevant information of the cloud platform before applying for the right to use the security virtual machine. To this end, the present application provides a cloud platform performance verification method, which can be used in conjunction with the aforementioned embodiments. After the cloud platform is verified by the cloud platform performance verification method provided by this embodiment, the method provided by the aforementioned embodiment is applied to start the security virtual machine.
[0133] It should be noted that before providing virtual machine services to virtual machine users, the cloud platform loaded on the server is first started, and the first processor checks the cloud platform, for example, the platform certificate of the cloud platform is verified, and after the verification, the relevant information of the cloud platform in the certificate is checked to confirm the uniqueness of the cloud platform, the security of the state, and whether the resources are sufficient, etc. The cloud platform can be successfully started only after all the verifications are passed. The cloud platform verification method provided in this embodiment is intended to provide a method for verifying the cloud platform for virtual machine users. It is applied on the premise that the cloud platform is started and can provide secure virtual machine services. As for the verification process between the cloud platform and the first processor mentioned in the above content, it can be implemented with reference to relevant technologies, and this application does not limit this.
[0134] Based on the above, see Figure 5 , the cloud platform performance verification method provided in this embodiment includes the following steps.
[0135] S300: The user terminal sends a platform security verification request.
[0136] Combination Figure 1 As shown and the above content, the user terminal mentioned in this embodiment refers to the terminal used by the owner of the secure virtual machine to be started, and the terminal can interact with the cloud platform, specifically, it can interact with the application processor inside the system-on-chip in the server carrying the cloud platform. The virtual machine user sends a platform security verification request to the application processor through the user terminal.
[0137] S301: The application processor receives and sends a platform security verification request.
[0138] Since the user terminal cannot directly interact with the security coprocessor in this state, the security coprocessor needs to forward the received platform security verification request. In actual applications, the application processor can verify the legitimacy of the platform security verification request after receiving it, for example, verify whether the cloud platform indicated by the request is the cloud platform to which the secure virtual machine to be started belongs. Of course, other verifications that may affect the security of the cloud platform can also be performed, which will not be detailed here. After the verification is passed, the platform security verification request is forwarded to the security coprocessor.
[0139] S302 : The security coprocessor provides the cloud platform's verification certificate and channel key to the application processor in response to the platform's security verification request.
[0140] It should be noted that the cloud platform mentioned in this embodiment refers to the cloud platform to which the aforementioned secure virtual machine to be started belongs. Based on this, the verification certificate of the cloud platform is mainly used to verify the security and uniqueness of the cloud platform.
[0141] In an optional implementation, the verification certificate includes a platform unique certificate and a chip verification certificate.
[0142] When the cloud service provider starts the server for the first time or the server changes the cloud service provider, the server will restart and update the security firmware in the security coprocessor and all certificates and keys related to platform security during the restart. After the restart is completed, the cloud service provider configures the parameters for the cloud platform startup and performs initialization operations. Then the cloud platform applies to the security coprocessor for platform resource control authority. The cloud platform sends the cloud platform-related certificates to the security coprocessor. After both parties sign, the platform's unique certificate for verifying the cloud platform can be obtained.
[0143] Based on the above content, it can be known that the server includes a system on chip, which is the main carrier for carrying the cloud platform and controlling the operation of the cloud platform. The security of the system on chip is of vital importance. Therefore, the security coprocessor will also provide the virtual machine user with a chip verification certificate for verifying the system on chip.
[0144] Furthermore, the security coprocessor will also provide a channel key to the virtual machine user. In the scenario where the user terminal needs to directly interact with the security coprocessor, a secure channel between the security coprocessor and the user terminal can be established through the channel key. It should be noted that the secure channel is not used during the startup phase of the secure virtual machine. The specific application of the secure channel will be expanded in the subsequent content and will not be described in detail here.
[0145] S303: The application processor receives and forwards the verification certificate and the channel key.
[0146] The application processor forwards the obtained authentication certificate and channel key to the user terminal.
[0147] S304: The user terminal verifies the cloud platform based on the verification certificate.
[0148] Based on the foregoing, when the verification certificate includes a platform-only certificate and a chip verification certificate, the verification of the cloud platform by the virtual machine user is divided into two parts.
[0149] The user terminal displays the information recorded in the platform's unique certificate, and the virtual machine user verifies the information recorded in the platform's unique certificate one by one, such as the relevant qualifications of the cloud platform service provider, the registration and creation information of the cloud platform, and the signature verification information of the cloud platform, etc. Of course, in actual applications, other information about the cloud platform is also included, which will not be listed here one by one.
[0150] Furthermore, the virtual machine user verifies the information recorded in the chip verification certificate, such as the production batch, basic hardware information, manufacturer, etc. of the SoC chip. In an optional implementation, the virtual machine user can upload the chip verification certificate to a verification service platform provided by the manufacturer of the SoC, and verify the SoC through the verification service platform.
[0151] It should be noted that if after verification, the virtual machine user finds that there are security issues with the cloud platform, such as certain verification information does not match, the subsequent virtual machine startup operation can be terminated immediately.
[0152] S305: The user terminal sends a hardware performance query request.
[0153] After the virtual machine user has determined the security of the cloud platform through the aforementioned steps, the user further sends a hardware performance query request to the application processor through the user terminal, aiming to obtain the hardware performance information of the cloud platform through the request, such as whether the cloud platform has enabled the encryption security isolation function and whether sufficient resources are reserved to run the secure virtual machines to be started, etc. Of course, other relevant information can also be obtained through the hardware performance query request, which needs to be determined in combination with the actual verification needs of the virtual machine user, and this application does not make specific limitations on this.
[0154] S306. The application processor feeds back the hardware performance parameters of the cloud platform.
[0155] The application processor responds to the hardware performance query request and feeds back the hardware performance parameters of the cloud platform to the user terminal. It is understandable that the hardware performance parameters specifically fed back by the application processor correspond to the request items of the hardware performance query request, and will vary in actual applications due to different hardware performance query requests. In most cases, the hardware performance parameters fed back by the cloud platform include: whether the cloud platform has enabled the encryption security isolation function, the secure virtual machines on the cloud platform that are currently not assigned a VMID, and the hardware resources of the cloud platform (such as processor resources, storage space, and network resources, etc.).
[0156] In an optional implementation, the application processor also sends the hardware performance parameters to the security coprocessor at the same time, so that the security coprocessor can also understand the current static capabilities of the cloud platform.
[0157] The user terminal displays the hardware performance parameters fed back by the application processor. The virtual machine user verifies the obtained hardware performance parameters one by one to confirm whether the cloud platform misreports the static capabilities. Once it is confirmed that the cloud platform misreports the static capabilities, the subsequent virtual machine startup operations can also be terminated immediately.
[0158] S307: When confirming that the hardware performance parameters are normal, the user terminal establishes a secure channel with the security coprocessor based on the channel key.
[0159] In the present application, the channel key is used to establish a secure channel between the user terminal and the security coprocessor to meet the communication needs between the user terminal and the security coprocessor in certain situations. As for the specific implementation process of establishing a secure channel based on the channel key, it can be implemented by referring to the relevant technology, and this application does not limit it.
[0160] It should be noted that the secure channel is not used during the startup of the secure virtual machine. The use of the secure channel will be expanded in subsequent content and will not be described in detail here.
[0161] At this point, the cloud platform security verification process has been completed. Through the method provided in this embodiment, the security of the cloud platform can be verified, which helps to further improve the security of the secure virtual machine and the cloud platform.
[0162] In an optional embodiment, Figure 5 The verification process of the cloud platform shown is also the configuration process before the secure virtual machine is started. Based on this, after the secure channel is established, the security coprocessor marks the secure virtual machine to be started as a configuration state.
[0163] Based on the foregoing, it can be seen that the startup of a secure virtual machine may require multiple stages. Taking the first creation and startup of a secure virtual machine as an example, its startup process may include three stages: configuration, creation, and startup. In short, the main tasks of the configuration stage include: cloud platform security verification, cloud platform hardware performance verification, and establishing a secure channel between the user terminal and the security coprocessor; the main tasks of the creation stage include: parsing configuration information, storage of configuration information and VMID; the main tasks of the startup stage include: encryption of the secure virtual machine operating system files, creation of the secure virtual machine operating environment, and startup of the secure virtual machine.
[0164] It is understandable that the above-mentioned different stages are all subject to illegal attacks. Although the data security between secure virtual machines can be ensured to a certain extent through the hardware-level isolation environment, and the security of the secure virtual machine can be further improved through the startup method provided in this application, various security issues may still arise in the startup process of the secure virtual machine, resulting in the actual running secure virtual machine being tampered with by attackers, which deviates from user needs. Therefore, how to verify whether the cloud platform has securely started the secure virtual machine according to user requirements and further improve the security of the secure virtual machine startup process has become one of the technical problems that technical personnel in this field need to solve urgently.
[0165] To solve the above problems, the present application provides a secure virtual machine measurement method, which is applied to the server provided in the aforementioned embodiment, specifically to the security coprocessor in the server's on-chip system. After the secure virtual machine is started, the method provides a hash value obtained based on security configuration information to the user terminal. The user terminal verifies the status of the actually started secure virtual machine based on the obtained hash value, ensuring that the cloud platform safely starts the secure virtual machine according to user requirements, thereby improving the security of the secure virtual machine startup process.
[0166] See also Figure 6 , the secure virtual machine measurement method provided in this application includes the following steps.
[0167] S400: In response to a startup result of a target secure virtual machine, determine whether a preset virtual machine measurement condition is met.
[0168] First of all, it should be noted that the target secure virtual machine described in this embodiment is a secure virtual machine that needs to be measured after startup. It can be a secure virtual machine started according to the secure virtual machine startup method provided in the previous embodiment. Of course, it can also be a secure virtual machine started according to other methods. In short, any secure virtual machine that needs to be measured after startup can be used as the target secure virtual machine described in this embodiment.
[0169] Continuing with the relevant content of the aforementioned embodiment, in an optional implementation, after the application processor creates a secure virtual machine operating environment and starts a target secure virtual machine in the operating environment, the application processor will feedback the startup result of the target secure virtual machine to the security coprocessor. The startup result may include information related to the startup process of the target secure virtual machine, such as hardware resource information related to the target secure virtual machine and operating system status information of the target secure virtual machine, etc. Of course, other information may also be included, which will not be described in detail here. This application does not limit the specific information included in the startup result.
[0170] In an optional implementation, the security coprocessor performs information format verification on the obtained startup result. If the information format of the information included in the startup result is abnormal, the security coprocessor may terminate subsequent measurement operations and feedback abnormal alarm information to the user terminal through the aforementioned secure channel.
[0171] In response to the startup result fed back by the application processor, the security coprocessor first determines whether a preset virtual machine metric condition is currently met.
[0172] In an optional implementation, if the cloud platform to which the security coprocessor belongs is operating normally, the virtual machine manager corresponding to the target security virtual machine is in a working state, and the target security virtual machine is in a waiting state, it is determined that the preset virtual machine measurement condition is met; on the contrary, if the cloud platform operates abnormally, or the virtual machine manager is in a non-working state, or the target security virtual machine is not in a waiting state, it is determined that the preset virtual machine measurement condition is not met.
[0173] Specifically, after receiving the startup result of the target secure virtual machine, the security coprocessor first determines whether the cloud platform to which it belongs is running normally, including: checking the hardware security of the cloud platform, such as checking whether the cloud platform currently has hardware failures, checking the operating status of the hardware resources of the cloud platform, and of course, other checks on the hardware performance of the cloud platform. If there is a hardware anomaly, it is determined that the cloud platform is running abnormally. Of course, the software resources of the cloud platform can also be checked for security. In the case of software anomalies, it is also determined that the cloud platform is running abnormally.
[0174] When it is determined that the cloud platform is operating abnormally, the security coprocessor controls all security virtual machines loaded by the cloud platform to stop running and marks each security virtual machine as inactive.
[0175] Furthermore, after determining that the cloud platform is normal, the security coprocessor obtains the current working state of the virtual machine manager in the application processor, and if the virtual machine manager is in a non-working state, controls the virtual machine manager to run. Specifically, the security coprocessor initiates an activation request to the virtual machine manager, and the virtual machine manager responds to the activation request and adjusts its own state to a working state.
[0176] The security coprocessor further checks the current state of the target secure virtual machine. Based on the content of the aforementioned embodiment, it can be known that under normal circumstances, after the application processor starts the secure virtual machine, the security coprocessor marks the secure virtual machine as waiting to start, and then enters the measurement stage. Therefore, if the entire secure virtual machine startup process is normal, when executing this step, the target secure virtual machine application is in a waiting to start state. Based on this, if the target secure virtual machine is currently in a waiting to start state, it can be determined that the startup process is normal. On the contrary, if the target secure virtual machine is not currently in a waiting to start state, it means that there is an abnormality in the startup process. The security coprocessor immediately terminates the measurement process of the target secure virtual machine, and notifies the virtual machine manager in the application processor to check the complete startup process of the target secure virtual machine. At the same time, the user terminal is notified of the abnormal startup of the target secure virtual machine through a secure channel, so that the virtual machine user can take corresponding processing measures, such as checking the information in the configuration file or restarting the target secure virtual machine.
[0177] As mentioned above, the security coprocessor stores the configuration information of the security virtual machine, including the security configuration information therein. During the measurement of the target security virtual machine, the security coprocessor will also check the security configuration information corresponding to the target security virtual machine. In an optional implementation, the configuration items to be checked may include: whether the encryption isolation security function is enabled, whether the sharing policy meets the initial configuration requirements of the virtual machine user, whether the target security virtual machine is allowed to migrate, whether the target security virtual machine and other security virtual machines are allowed to perform cross-virtual machine sharing operations, etc. Of course, in actual applications, other security-related configuration items can also be checked according to the measurement requirements, which are not listed here one by one. It should be noted that the inspection of the security configuration information does not check the specific settings of a certain configuration item, such as checking whether the encryption isolation security function is configured to be enabled or disabled. The specific configuration of the configuration item is determined by the virtual machine user, and any selection is allowed. The security configuration information inspection described in this embodiment is mainly to check whether there are illegal parameters in each configuration item in the security configuration information, such as checking whether the value of a certain configuration item exceeds its preset value range, or whether the format of a certain configuration item is normal. This embodiment sets preset configuration rules in combination with the format requirements and value range of each configuration item in the security configuration information under normal circumstances. The rules include the correct format of each configuration item and the preset value range. Of course, other rules can also be set according to actual needs and the specific conditions of the configuration items. Then, the security coprocessor verifies whether each configuration item in the security configuration information meets its corresponding preset configuration rules. If there is at least one configuration item that does not meet the preset configuration rule, it is determined that the preset virtual machine measurement condition is not met. In the case of determining that the security configuration information is abnormal, the security coprocessor terminates the measurement process of the target secure virtual machine.
[0178] It should be noted that in actual applications, other virtual machine measurement conditions can also be set based on actual inspection requirements and measurement requirements of secure virtual machines. Without exceeding the core idea of this application, they also fall within the scope of protection of this application.
[0179] S401: If a preset virtual machine measurement condition is met, a hash value of a target configuration item of a target secure virtual machine is calculated.
[0180] After determining that the preset virtual machine measurement condition is met, the security coprocessor calculates a hash value of a target configuration item in the configuration information of the target secure virtual machine.
[0181] As mentioned above, there are many configuration items included in the security configuration information. In practical applications, all or part of the configuration items can be selected to calculate the hash value according to the actual measurement requirements. Of course, the selection of the target configuration item is based on the ability to comprehensively measure or judge whether the secure virtual machine is started according to the requirements of the virtual machine user, and the typical configuration items in the configuration information are selected as the target configuration items. In an optional implementation, the target configuration item includes the startup information of the secure virtual machine, the private data summary of the secure virtual machine, the version number of the secure firmware in the security coprocessor, the summary of the secure firmware, the random number generated by the secure firmware, and at least one of the transmission keys used to encrypt the configuration information. Of course, other configuration items can also be selected for calculating the hash value, which also falls within the scope of protection of this application without exceeding the core idea of the present application.
[0182] It should be noted that the above calculation process is to calculate a hash value for each target configuration item as a whole (for example, combined into a structure), not for each target configuration item. As for the hash algorithm used to calculate the hash value and the specific calculation process, it can be implemented with reference to the relevant technology, and this application does not limit this.
[0183] S402: Provide at least a hash value to a user terminal.
[0184] The security coprocessor feeds back the calculated hash value to the user terminal, and the user terminal verifies the obtained hash value to obtain the corresponding target configuration item. The specific implementation of the user terminal obtaining the target configuration item based on the hash value verification can refer to the relevant technology and will not be described in detail here.
[0185] In an optional implementation, the security coprocessor provides a hash value to the user terminal through the aforementioned secure channel. Based on the aforementioned content, it can be known that the secure channel is created based on the channel key, and both the user terminal and the security coprocessor hold the channel key. Based on this, the security coprocessor uses the channel key to encrypt the hash value before sending the hash value, and transmits the encrypted hash value through the secure channel. After the user terminal obtains the encrypted hash value, it uses the channel key it holds to decrypt the encrypted hash value, and then obtains the decrypted hash value. Further, the obtained hash value is signed to obtain the corresponding target configuration item, and by verifying the target configuration item, it is determined whether the cloud platform starts the target secure virtual machine as required.
[0186] In another optional implementation, the security coprocessor uses a pre-generated transmission key to encrypt the configuration information of the secure virtual machine and stores the configuration information of the secure virtual machine in ciphertext form. In this case, the security coprocessor needs to send the obtained hash value and the transmission key to the user terminal at the same time through a secure channel. Specifically, before sending the hash value, the security coprocessor uses the channel key to encrypt the hash value and the transmission key, and transmits the encrypted hash value and transmission key through a secure channel. After the user terminal obtains the encrypted hash value and the transmission key, it uses the channel key it holds to decrypt the encrypted hash value and the channel key, and then obtains the decrypted hash value and the transmission key. Furthermore, the user terminal verifies the signature of the obtained hash value to obtain the corresponding target configuration item ciphertext, and then uses the transmission key to decrypt the target configuration ciphertext to obtain the target configuration item plaintext, and determines whether the cloud platform starts the target secure virtual machine as required by verifying the target configuration item.
[0187] Based on the foregoing content, it can be known that the configuration of the secure virtual machine is determined by the virtual machine user, and its configuration file is initially provided by the user terminal. Therefore, the user terminal stores the initial configuration information of the target secure virtual machine. Based on this, after the user terminal obtains the target configuration item through the foregoing steps, the virtual machine user verifies each target configuration item based on the initial configuration information recorded in the configuration file, and can determine whether the cloud platform starts the target secure virtual machine according to the configuration file, that is, the user's requirement.
[0188] To summarize, in the secure virtual machine measurement method provided in this embodiment, the application processor determines whether a preset virtual machine measurement condition is met in response to the startup result of the target secure virtual machine. When the preset virtual machine measurement condition is met, the hash value of the target configuration item of the target secure virtual machine is calculated, and the obtained hash value is provided to at least the user terminal. The user terminal obtains the target configuration item based on the hash value, and verifies the target configuration item to determine whether the target secure virtual machine is started as required. Based on this, after the secure virtual machine is started, the method provides the user terminal with a hash value obtained based on the target configuration item. The user terminal verifies the actually started secure virtual machine according to the obtained hash value, thereby ensuring that the cloud platform safely starts the secure virtual machine according to user requirements and improving the security of the secure virtual machine startup process.
[0189] In an optional implementation, after completing the above operations, the security coprocessor marks the target secure virtual machine as a measurement state.
[0190] Further, in Figure 6 Based on the embodiment shown, the present application provides another secure virtual machine measurement method, combining Figure 7 As shown, the measurement method provided by this embodiment includes the following steps.
[0191] S500: In response to a startup result of a target secure virtual machine, determine whether a preset virtual machine measurement condition is met.
[0192] In an optional implementation, this step can refer to Figure 6 The implementation of the relevant contents of S400 in the illustrated embodiment will not be repeated here.
[0193] S501: If a preset virtual machine measurement condition is met, a hash value of a target configuration item of a target secure virtual machine is calculated.
[0194] In an optional implementation, this step can refer to Figure 6 The implementation of the relevant contents of S401 in the illustrated embodiment will not be repeated here.
[0195] S502: Provide at least a hash value to a user terminal.
[0196] In an optional implementation, this step can refer to Figure 6 The implementation of the relevant contents of S402 in the illustrated embodiment will not be repeated here. The virtual machine user determines whether the cloud platform starts the target secure virtual machine as required based on the obtained hash value.
[0197] S503: Obtain a disk encryption key.
[0198] If after the above steps, the virtual machine user confirms that the cloud platform has started the secure virtual machine according to its own requirements, a disk encryption key will be generated and injected into the secure virtual machine through the user terminal, and the security coprocessor will obtain the disk encryption key through a secure channel.
[0199] In an optional implementation, after the virtual machine user determines that the cloud platform starts the secure virtual machine according to the user's requirements, the user can feedback notification information to the cloud platform through the user terminal, indicating that the cloud platform has started the secure virtual machine as required.
[0200] S504: Mark the target secure virtual machine as being in disk encryption state.
[0201] After receiving the disk encryption key provided by the user terminal, the security coprocessor marks the target secure virtual machine as a disk encryption state.
[0202] S505: Encrypt the disk data of the target secure virtual machine based on the disk encryption key.
[0203] The security coprocessor further encrypts the disk data of the target secure virtual machine based on the disk encryption key. It should be noted that the disk data mentioned here mainly refers to the data in the storage space allocated to the target secure virtual machine in the external storage medium, that is, the disk encryption key is mainly used to encrypt the data in the external storage medium (such as a hard disk). Through encryption processing, the disk data of the target secure virtual machine is stored in the external storage medium in ciphertext form, and attackers cannot obtain the plaintext data in the valid disk, which significantly improves the data security of the secure virtual machine users.
[0204] S506: Mark the target secure virtual machine as activated.
[0205] After completing the disk data encryption of the target secure virtual machine, the security coprocessor marks the target secure virtual machine as activated. The activated secure virtual machine can provide corresponding cloud platform services to the virtual machine user, and the virtual machine user can access the platform resources provided by the cloud platform.
[0206] To sum up, the secure virtual machine measurement method provided in this embodiment can measure the secure virtual machine and verify whether the secure virtual machine is started according to the needs of the virtual machine user, and further encrypts the disk data of the secure virtual machine, which helps to further improve the reliability and security of the secure virtual machine.
[0207] The present application also provides a processor, which is configured to execute the secure virtual machine measurement method provided in any of the above embodiments.
[0208] Based on the above content, it can be known that after the security coprocessor marks the secure virtual machine as activated, the secure virtual machine can provide corresponding services to the virtual machine user. However, during the actual operation of the secure virtual machine, abnormal situations will inevitably occur, affecting the operating reliability and stability of the secure virtual machine. In this case, the secure virtual machine needs to be debugged. Therefore, how to debug the secure virtual machine to ensure the reliable operation of the secure virtual machine and then ensure the security of the trusted execution environment has become one of the technical problems that technical personnel in this field need to solve urgently.
[0209] To solve the above problems, based on the above embodiments, the present application provides a secure virtual machine debugging method, which is applied to the server mentioned in the above content, specifically to the system on chip of the server, specifically, the second processor sends a debugging request for the secure virtual machine to be debugged to the first processor, and the first processor responds to the debugging request, and accesses the private memory space corresponding to the secure virtual machine to be debugged based on the debugging request when the secure virtual machine to be debugged allows debugging and the debugging information meets the preset rules. Through this method, the private memory space corresponding to the secure virtual machine can be accessed, the data stored in the private memory space can be processed, and the debugging of the secure virtual machine can be implemented accordingly, so as to provide support for users to troubleshoot the abnormality of the secure virtual machine and improve the reliability and security of the secure virtual machine, which helps to improve the security of the trusted execution environment.
[0210] Based on the above, see Figure 8 The secure virtual machine debugging method provided in this embodiment includes the following steps.
[0211] S600: The application processor sends a debugging request for the secure virtual machine to be debugged.
[0212] In each secure virtual machine debugging method provided in the present application, the secure virtual machine that needs to be debugged is referred to as a secure virtual machine to be debugged. The secure virtual machine to be debugged can be any secure virtual machine that needs to be debugged among multiple secure virtual machines provided by the cloud platform. The present application does not limit the specific selection of the secure virtual machine to be debugged.
[0213] The debugging of the secure virtual machine mainly depends on the access to the private memory space of the secure virtual machine. By accessing the private memory space of the secure virtual machine, the debugging data is written into the private memory space, or the data stored in the private memory space is read, and the cause of the abnormal operation of the secure virtual machine is further determined based on the obtained memory data analysis. Therefore, the debugging request involved in this application includes a write memory request and a read memory request. In actual applications, the debugging information included in each debugging request is not the same. Therefore, there will be certain differences in the specific debugging process of the secure virtual machine. The specific debugging process for the write memory request and the read memory request will be respectively expanded in the subsequent content, which will not be described in detail here.
[0214] In the actual application of secure virtual machines, virtual machine users, as the owners and direct users of secure virtual machines, can often intuitively determine that there are abnormalities in the operation of secure virtual machines. Therefore, in an optional implementation, the debugging request for the secure virtual machine to be debugged is first initiated by the virtual machine user through the user terminal. Based on the foregoing content, it can be seen that the user terminal can directly interact with the application processor, that is, specifically interact with the virtual machine manager loaded by the application processor. Under this premise, the user terminal sends a debugging request to the application processor. After obtaining the debugging request from the user terminal for the secure virtual machine to be debugged, the application processor further forwards the debugging request to the security coprocessor.
[0215] S601: The security coprocessor determines whether the security virtual machine to be debugged allows debugging in response to a debugging request.
[0216] In an optional implementation, in order to ensure the reliable implementation of the debugging process, the secure virtual machine debugging method provided in the present application sets preset debugging conditions. After obtaining the debugging request of the secure virtual machine to be debugged, the security coprocessor first determines whether the preset debugging conditions are met. Only when the preset debugging conditions are met, it will further determine whether the secure virtual machine to be debugged is allowed to be debugged.
[0217] The judgment process of whether the preset debugging conditions are met can be: if the cloud platform to which the security coprocessor belongs is operating normally, the security virtual machine to be debugged is in an activated state, and the security virtual machine to be debugged is a currently running security virtual machine, then it is determined that the preset debugging conditions are met; on the contrary, if the cloud platform to which the security coprocessor belongs is operating abnormally, or the security virtual machine to be debugged is not in an activated state, or the security virtual machine to be debugged is not a currently running security virtual machine, then it is determined that the preset debugging conditions are not met.
[0218] Specifically, the security coprocessor responds to the debugging request and checks the hardware resources and hardware status of the cloud platform to which it belongs to ensure that there are no security issues or hardware failures. After completing the hardware resource check, the cloud platform's operating status will be further checked to confirm whether the cloud platform is in operation. If the cloud platform is not currently in operation, the security coprocessor will further notify the application processor to switch the cloud platform to operation. In short, if the cloud platform's hardware resources are normal and the cloud platform is in operation, it is confirmed that the cloud platform is operating normally. Otherwise, it is confirmed that the cloud platform is operating abnormally.
[0219] As mentioned above, after the virtual machine user determines that the measurement result is normal, the cloud platform starts the secure virtual machine as required, and the security coprocessor encrypts the disk data of the secure virtual machine, the security coprocessor will mark the state of the secure virtual machine as activated. The activation of the secure virtual machine is both a prerequisite for the virtual machine user to use the secure virtual machine and a prerequisite for debugging the secure virtual machine. Based on this, the security coprocessor further obtains the state of the secure virtual machine to be debugged, confirms whether the secure virtual machine to be debugged is in an activated state, and if the secure virtual machine to be debugged is not in an activated state, it is determined that the preset debugging conditions are not met.
[0220] In actual applications, only the secure virtual machines that are already running can be debugged. Based on this, the cloud platform provides multiple secure virtual machines at the same time, resulting in the possibility that the secure virtual machine to be debugged corresponding to the debugging request is not the currently running secure virtual machine. In this case, it is obviously impossible to debug the non-running secure virtual machine. Therefore, the security coprocessor determines whether the secure virtual machine to be debugged is the currently running secure virtual machine. If the secure virtual machine to be debugged is not the currently running secure virtual machine, it is determined that the preset debugging conditions are not met.
[0221] In another optional implementation, the security coprocessor may further check the configuration information of the security virtual machine to be debugged. As mentioned above, the security coprocessor stores the configuration information of the security virtual machine during the security virtual machine creation process. The configuration information records the initial configuration of the corresponding security coprocessor. Based on this, the security coprocessor obtains the current configuration information of the security virtual machine to be debugged. If the current configuration information is different from the configuration information of the security virtual machine to be debugged stored by the security coprocessor, it can also be determined that the preset debugging conditions are not met.
[0222] After checking the above information respectively, if all the information is normal, it is determined that the preset debugging conditions are met, and the security coprocessor further determines whether the security virtual machine to be debugged is allowed to be debugged. On the contrary, if it is determined that the preset debugging conditions are not met, the security coprocessor stops debugging the security virtual machine to be debugged and feeds back fault notification information to the user terminal through the aforementioned secure channel.
[0223] After determining that the preset debugging conditions are met, the security coprocessor further determines whether the security virtual machine to be debugged is allowed to be debugged. As mentioned above, the configuration information of the security virtual machine includes debugging configuration information related to the debugging process of the security virtual machine. The debugging configuration information records whether the security virtual machine to be debugged is allowed to be debugged. Based on this, the security coprocessor can determine whether it is allowed to be debugged by querying the debugging configuration information of the security virtual machine to be debugged.
[0224] In an optional implementation, the debugging request, in addition to including debugging information, also carries the VMID of the secure virtual machine to be debugged. The security coprocessor parses the obtained debugging request, extracts the VMID carried therein, and further determines the configuration information of the secure virtual machine to be debugged based on the obtained VMID, and then determines whether debugging of the secure virtual machine to be debugged is allowed based on the configuration information.
[0225] S602: If the secure virtual machine to be debugged allows debugging, the security coprocessor determines whether the debugging information in the debugging request satisfies a preset rule.
[0226] When the debugging of the secure virtual machine to be debugged is allowed, the secure coprocessor further determines whether the debugging information satisfies the preset rules. It is understandable that since the debugging of the secure virtual machine involves access to the private memory space of the secure virtual machine, the preset rules described in this application are usually set based on the memory access requirements. As mentioned above, the debugging information corresponding to the read memory request and the write memory request is not the same. Therefore, the judgment of whether the debugging information satisfies the preset rules will be separately expanded in the subsequent content and will not be described in detail here.
[0227] S603: If the debugging information satisfies a preset rule, the security coprocessor accesses the private memory space of the secure virtual machine to be debugged based on the debugging request.
[0228] When the debugging information meets the preset rules, the security coprocessor accesses the private memory space corresponding to the secure virtual machine to be debugged according to the debugging request, writes debugging data into the private memory space, repairs the corresponding exception, or reads the data stored in the private memory space, and further determines the cause of the abnormal operation of the secure virtual machine based on the obtained memory data analysis.
[0229] To sum up, through the secure virtual machine debugging method provided in this embodiment, the private memory space corresponding to the secure virtual machine can be accessed, the data stored in the private memory space can be processed, and the debugging of the secure virtual machine can be implemented accordingly, so as to provide support for users to troubleshoot secure virtual machine anomalies and improve the reliability and security of the secure virtual machine, thereby helping to improve the security of the trusted execution environment.
[0230] It should be noted that for a secure virtual machine that is created and started for the first time, before it is debugged, it must go through stages such as secure virtual machine configuration, secure virtual machine creation, secure virtual machine startup, and secure virtual machine measurement. The specific implementation methods of these stages can refer to the methods provided in the corresponding embodiments in the aforementioned content, and will not be repeated here.
[0231] The following describes the debugging process for the two cases of read memory request and write memory request respectively.
[0232] See also Fig. 9Another secure virtual machine debugging method provided by the present application includes the following steps.
[0233] S700: The user terminal sends a status query request.
[0234] The debugging of a secure virtual machine requires that the secure virtual machine is in an activated state, that is, a state in which it can truly provide virtual machine services to the virtual machine user. Therefore, as an optional implementation method, before starting the debugging of the secure virtual machine, the virtual machine user can first query the current state of the secure virtual machine to be debugged. Based on this, the user terminal sends a status query request to the security processor through the secure channel created during the startup phase of the secure virtual machine to be debugged.
[0235] S701: The security coprocessor responds to a status query request and feeds back a current status of the security virtual machine to be debugged.
[0236] The security coprocessor receives a status query request through a security channel, determines a current status of the security virtual machine to be debugged, and further feeds back the current status of the security virtual machine to be debugged through the security channel.
[0237] In an optional implementation, the status query request carries a VMID. After receiving the status query request, the security coprocessor extracts the VMID carried in the request, and can determine the security virtual machine to be debugged based on the obtained VMID, and then feedback the current state of the security virtual machine to be debugged. Of course, the user terminal can also indicate which specific security virtual machine is the security virtual machine to be debugged in other ways, which will not be elaborated here. Without exceeding the core idea of this application, it also falls within the scope of protection of this application.
[0238] As mentioned above, the debugging process of the secure virtual machine requires that the secure virtual machine is in an activated state. If the security coprocessor determines that the secure virtual machine to be debugged is not currently in an activated state, it will further feedback alarm information to the user terminal through the secure channel and terminate subsequent debugging operations.
[0239] S702: When the secure virtual machine to be debugged is in an activated state, the user terminal sends a memory read request.
[0240] After determining that the secure virtual machine to be debugged is in an activated state, the user terminal sends a memory read request to the application processor (specifically, a virtual machine manager running on the application processor).
[0241] S703: The application processor forwards the memory read request.
[0242] After receiving the read memory request, the application processor parses the read memory request and extracts the debugging information carried by the read memory request. In an optional implementation, the debugging information includes a source address and a data length. Among them, the source address is the starting address of the memory data in the memory space, and the data length is the data length of the memory data. In combination with the relevant technology, it can be known that when the source address and the data length are determined, the storage space of the memory data can be determined, and the memory data to be read is obtained by reading the data in the storage space. In another optional implementation, the debugging information includes a source address and an end address, and the end address is the last storage address corresponding to the memory data. The memory space between the source address and the end address is the memory space for storing the memory data, and the memory data to be read is obtained by reading the data in the memory space. Of course, the memory data to be read can also be indicated in other ways, which also fall within the scope of protection of this application without exceeding the core idea of this application.
[0243] In an optional implementation, the application processor further allocates a buffer storage area in the memory space to store memory data that needs to be interacted with during the debugging process. The specific application of the buffer storage area will be expanded in subsequent content and will not be described in detail here.
[0244] After the initial verification is completed, the read memory request is sent to the security processor.
[0245] S704: The security coprocessor determines whether the security virtual machine to be debugged is allowed to be debugged in response to the memory read request.
[0246] In an optional implementation, this step can refer to Figure 8 The implementation of S601 in the illustrated embodiment will not be repeated here.
[0247] S705: If the secure virtual machine to be debugged allows debugging, the security coprocessor determines whether the debugging information in the memory read request satisfies a preset rule.
[0248] When it is determined that the secure virtual machine to be debugged allows debugging, the security coprocessor further determines whether the debugging information in the read memory request satisfies preset rules. The preset rules described in this embodiment are set based on the address range of the private memory space of the secure virtual machine to be debugged and the memory access requirements.
[0249] In an optional implementation, the debugging information of the read memory request includes the source address and the data length. As mentioned above, each secure virtual machine corresponds to a corresponding private memory space. More importantly, the private memory spaces of each secure virtual machine are isolated from each other. Virtual machine users are prohibited from accessing the private memory spaces of other secure virtual machines other than their own secure virtual machines. Based on this, the security coprocessor first needs to determine whether the source address indicated by the current read memory request is the address of the private memory space corresponding to the secure virtual machine to be debugged. If the source address is not within the memory address range of the private memory space of the secure virtual machine to be debugged, it can be determined that the source address is an illegal address. The security coprocessor can terminate the current debugging operation and feedback the abnormal result to the virtual machine user.
[0250] Furthermore, the security coprocessor checks the data length. For example, based on the source address and the data length, the corresponding end address can be determined, and then it is determined whether the end address exceeds the address range of the private memory space of the aforementioned secure virtual machine to be debugged, or it can also be determined whether the data length satisfies the data format of the computer language. Of course, other checks can also be performed on the data length, which can be implemented with reference to relevant technologies. The specific verification process of the data length in this application is not limited.
[0251] When the debugging information includes other information, the security coprocessor also needs to be verified based on the specific circumstances of the debugging information. The general requirement is that the private memory space of other secure virtual machines cannot be accessed and the memory access requirements in the relevant technology must be met. This will not be elaborated here.
[0252] S706: If the debugging information meets the preset rules, the security coprocessor sends a debugging command to the application processor.
[0253] When it is determined that the debugging information meets the preset rules, the security coprocessor sends a debugging command to the application processor, notifying the application processor to debug the secure virtual machine to be debugged. It can be understood that in the aforementioned S703, the application processor has already obtained the debugging information in the memory read request, so the debugging command sent in this step is mainly used to trigger the application processor to execute S707.
[0254] In an optional implementation, the security coprocessor may also mark the security virtual machine to be debugged as being in a debugging state at this step.
[0255] S707: The application processor obtains memory data based on the memory read request in response to the debug command.
[0256] In response to the debug instruction, the application processor sends the debug information of the read memory request to the memory controller, and the memory controller determines the memory data based on the debug information. When the debug information includes the source address and the data length, the data in the corresponding memory space is read according to the data length starting from the source address, that is, the memory data corresponding to the debug request is determined. Of course, when the debug information includes other information that can indicate the memory data, there will be certain differences in the determination and reading of the memory data, which will not be described in detail here, and the specific implementation can be referred to the relevant technology.
[0257] As mentioned above, the memory data of the secure virtual machine is stored in the memory space in ciphertext form. Therefore, after determining the memory data to be read, the cryptographic engine first decrypts the memory data to be read based on the virtual machine key of the secure virtual machine to be debugged, and then feeds back the decrypted memory data to the application processor, and finally the application processor feeds back the decrypted memory data to the security processor.
[0258] In an optional implementation, the application processor creates a buffer storage area. When feeding back the decrypted memory data to the security processor, the decrypted memory data may be temporarily stored in the buffer storage area, and data interaction with the security processor is performed through the buffer storage area.
[0259] S708. The security coprocessor provides the decrypted memory data to the user terminal.
[0260] After obtaining the decrypted memory data, the security coprocessor sends the decrypted memory data to the user terminal through the aforementioned secure channel.
[0261] S709: The user terminal debugs the secure virtual machine to be debugged based on the decrypted memory data.
[0262] The user terminal analyzes the running process of the secure virtual machine to be debugged based on the decrypted memory data, determines the cause of the abnormality, and performs operations such as fault repair on the secure virtual machine to be debugged until the debugging operation of the secure virtual machine is completed and the secure virtual machine to be debugged returns to normal.
[0263] In an optional embodiment, when the application processor creates a buffer storage area, the security coprocessor may also check the address and capacity of the buffer storage area. If the check finds that the address or capacity of the buffer storage area may affect the security of the secure virtual machine to be debugged, the current debugging operation is terminated and an alarm message is sent to the user terminal through the security system.
[0264] In summary, through the debugging method provided in this embodiment, the memory data of the secure virtual machine to be debugged can be read, and the virtual machine user analyzes the cause of the failure of the secure virtual machine to be debugged based on the obtained memory data, thereby realizing the debugging of the secure virtual machine, providing support for users to troubleshoot secure virtual machine anomalies, and improving the reliability and security of the secure virtual machine, which helps to improve the security of the trusted execution environment.
[0265] See also Fig.10 Another secure virtual machine debugging method provided in this application includes the following steps.
[0266] S800: The user terminal sends a status query request.
[0267] In an optional implementation, this step can refer to Fig. 9 The implementation of S700 in the illustrated embodiment will not be repeated here.
[0268] S801. The security coprocessor responds to a status query request and feeds back a current status of the security virtual machine to be debugged.
[0269] In an optional implementation, this step can refer to Fig. 9 The implementation of S701 in the illustrated embodiment will not be repeated here.
[0270] S802: When the secure virtual machine to be debugged is in an activated state, the user terminal sends a memory write request.
[0271] After determining that the secure virtual machine to be debugged is in an activated state, the user terminal sends a memory write request to the application processor.
[0272] S803: The application processor forwards the memory write request.
[0273] After receiving the write memory request, the application processor parses the write memory request and extracts the debugging information carried by the write memory request. In an optional implementation, the debugging information includes target data and a target address. The target data is data that needs to be written into the private memory space of the secure virtual machine to be debugged, and the data can be used to repair the abnormal state of the secure virtual machine to be debugged, and the target address is the storage address of the target data in the private memory space of the secure virtual machine to be debugged.
[0274] In an optional implementation, the application processor further allocates a buffer storage area in the memory space to store memory data that needs to be interacted with during the debugging process. The specific application of the buffer storage area will be expanded in subsequent content and will not be described in detail here.
[0275] After preliminary verification, the application processor sends a write memory request to the security processor.
[0276] S804: The security coprocessor determines whether the secure virtual machine to be debugged is allowed to be debugged in response to the memory write request.
[0277] In an optional implementation, this step can refer to Fig. 9 The implementation of S704 in the illustrated embodiment will not be repeated here.
[0278] S805: If the secure virtual machine to be debugged allows debugging, the security coprocessor determines whether the debugging information in the write memory request satisfies a preset rule.
[0279] When it is determined that the secure virtual machine to be debugged allows debugging, the security coprocessor further determines whether the debugging information in the write memory request satisfies preset rules. The preset rules described in this embodiment are set based on the address range of the private memory space of the secure virtual machine to be debugged and the memory access requirements.
[0280] In an optional implementation, the debugging information of the write memory request includes target data and target address. As mentioned above, each secure virtual machine corresponds to a corresponding private memory space. More importantly, the private memory spaces of each secure virtual machine are isolated from each other. Virtual machine users are prohibited from accessing the private memory spaces of other secure virtual machines other than their own secure virtual machines. Based on this, the security coprocessor first needs to determine whether the target address indicated by the current write memory request is the address of the private memory space corresponding to the secure virtual machine to be debugged. If the target address is not within the memory address range of the private memory space of the secure virtual machine to be debugged, it can be determined that the target address is an illegal address. The security coprocessor can terminate the current debugging operation and feedback the abnormal result to the virtual machine user.
[0281] Furthermore, the security coprocessor checks the data length of the target data to ensure that when the target data is stored from the target address, the target data will not overflow, that is, occupy the memory space of other secure virtual machines, or it can also determine whether the data format of the target data is correct. Of course, other checks can also be performed on the target data, which can be implemented with reference to relevant technologies. The specific verification process of the target data of this application is not specifically limited.
[0282] When the debugging information includes other information, the security coprocessor also needs to be verified based on the specific circumstances of the debugging information. The general requirement is that the private memory space of other secure virtual machines cannot be accessed and the memory access requirements in the relevant technology must be met. This will not be elaborated here.
[0283] S806: If the debugging information meets the preset rules, the security coprocessor encrypts the target data to obtain the target data ciphertext.
[0284] As mentioned above, the relevant data of the secure virtual machine is stored in the memory space in ciphertext form. When the security protocol processor writes data to the memory, it first needs to encrypt the memory data. Based on this, when it is determined that the debugging information meets the preset rules, the security coprocessor encrypts the target data to obtain the target data ciphertext. In an optional implementation, the security coprocessor encrypts the target data using the virtual machine key generated during the creation of the secure virtual machine to be debugged. Based on the foregoing content, it can be seen that the secure virtual machine and the virtual machine key are in a one-to-one correspondence. Therefore, when encrypting the target data, the virtual machine key of the secure virtual machine to be debugged should be used to ensure data security.
[0285] In an optional implementation, if the application processor creates a buffer storage area during the process of forwarding the write memory request, the security coprocessor may store the target data ciphertext in the buffer storage area after encrypting the target data ciphertext.
[0286] In an optional implementation, the security coprocessor also notifies the secure virtual machine to be debugged to perform debugging at this step, so that the secure virtual machine to be debugged no longer executes kernel-related command operations, and marks the secure virtual machine to be debugged as a debugging state.
[0287] S807. The security processor stores the target data ciphertext into the private memory space corresponding to the secure virtual machine to be debugged according to the target address.
[0288] The security processor stores the target data ciphertext according to the target address to the private memory space corresponding to the security virtual machine to be debugged through the memory controller, and completes the memory write operation of the security virtual machine to be debugged to repair the abnormality of the security virtual machine to be debugged. As for the specific implementation method of the security processor accessing the memory space through the memory controller, it can be implemented with reference to the relevant technology, and this application does not limit this specific process.
[0289] In an optional embodiment, when the application processor creates a buffer storage area, the security coprocessor may also check the address and capacity of the buffer storage area. If the check finds that the address or capacity of the buffer storage area may affect the security of the secure virtual machine to be debugged, the current debugging operation is terminated and an alarm message is sent to the user terminal through the security system.
[0290] To sum up, through the debugging method provided in this embodiment, data can be written to the memory space of the secure virtual machine to be debugged, thereby realizing the debugging of the secure virtual machine, troubleshooting the secure virtual machine anomalies for users, improving the reliability of the secure virtual machine, and ensuring the security of the secure virtual machine, which helps to improve the security of the trusted execution environment.
[0291] The present application also provides a processor, which is configured to execute the steps performed by the security processor in the secure virtual machine debugging method provided in any of the above embodiments of the present application.
[0292] The present application also provides another processor, which is configured to execute the steps performed by the application processor in the secure virtual machine debugging method provided in any of the above embodiments of the present application.
[0293] The above technical solutions provided by this application cover multiple stages in the actual application process of the secure virtual machine, namely, secure virtual machine configuration, secure virtual machine creation, secure virtual machine startup, secure virtual machine measurement, and secure virtual machine debugging. The methods corresponding to each stage provided by this application can be used independently, and at the same time, they can also be used in combination with each other according to needs. Taking the aforementioned debugging method as an example, it can also be applied alone to the debugging of the secure virtual machine, and at the same time, it can also be used in conjunction with the aforementioned startup and measurement process, that is, after completing the startup of the secure virtual machine, the secure virtual machine is measured, and after determining that the started secure virtual machine meets the user's needs based on the measurement results, the secure virtual machine is further debugged. Of course, there are other different combined application methods, which will not be listed here one by one. Without exceeding the core idea of this application, they also fall within the scope of protection of this application.
[0294] As mentioned above, any virtual machine user can apply for a secure virtual machine from the cloud platform, or apply for multiple secure virtual machines from the cloud platform according to application requirements. When the virtual machine user needs to start multiple secure virtual machines he owns, he needs to check the startup process of the secure virtual machines one by one and confirm the measurement results of each secure virtual machine respectively. Obviously, this startup method has low startup efficiency, will take up a lot of time of virtual machine users, and the user experience is poor.
[0295] To solve the above problems, the present application provides another method for starting a secure virtual machine based on the above content, which is applied to the server provided in the above embodiment, and specifically to the system on chip in the server. The first processor and the second processor in the system on chip cooperate with each other to first start the main secure virtual machine. After starting the main secure virtual machine, the main secure virtual machine verifies the measurement results of subsequent slave secure virtual machines. Compared with the method in the prior art in which the virtual machine user verifies the measurement results of each secure virtual machine one by one, the startup efficiency of the secure virtual machine can be greatly improved. At the same time, a lot of time of the virtual machine user can be saved and the user experience of the virtual machine user can be improved.
[0296] Combination Fig.11 As shown, the secure virtual machine startup method provided by the present application includes the following steps.
[0297] S900: The application processor parses the configuration file to obtain configuration information recorded in the configuration file.
[0298] As mentioned above, in order to meet the needs of different virtual machine users, the cloud platform supports virtual machine users to configure the secure virtual machines they rent, and then enjoy personalized customized services. Virtual machine users can send configuration requirements to the cloud platform, that is, to the application processor, through the user terminal.
[0299] In an optional implementation, the configuration requirements of the virtual machine user for the secure virtual machine are carried in the form of a configuration file, that is, the configuration file records all configuration information related to the secure virtual machine. After receiving the configuration file provided by the virtual machine user through the user terminal, the application processor parses the configuration file to obtain the configuration information therein.
[0300] It should be noted that, compared with the secure virtual machine startup method provided in the previous embodiment, the configuration file provided in this embodiment includes not only the configuration information of the master secure virtual machine, but also the configuration information of at least one slave secure virtual machine, that is, through one configuration file, the configuration information of all secure virtual machines of the virtual machine user is carried. Such a setting can avoid the virtual machine user from uploading the configuration files of each secure virtual machine one by one when starting multiple secure virtual machines at the same time, saving the user a lot of time.
[0301] Furthermore, in terms of the selection of the master secure virtual machine and the slave secure virtual machine, any one of the multiple secure virtual machines can be used as the master virtual machine, and correspondingly, other secure virtual machines owned by the virtual machine user can be used as slave secure virtual machines.
[0302] The startup order of the main safety virtual machine and the slave safety virtual machine can be set by setting a configuration file to record the configuration information. For example, the configuration information of the main safety virtual machine is used as the information that the security coprocessor reads first in the subsequent process, and the configuration information of the slave safety virtual machine is recorded in the configuration information of the main safety virtual machine in the form of sub-information. Of course, other forms can also be used to record the configuration information of each safety virtual machine. As long as it can ensure that the security coprocessor can first read the configuration information of the main safety virtual machine, and then read the configuration information of each slave safety virtual machine one by one, this loading method is optional and also falls within the scope of protection of this application.
[0303] Of course, the configuration information of the primary safety virtual machine and the secondary safety virtual machine can also be distinguished by other methods. For example, labels can be added to the configuration information, with the primary safety virtual machine corresponding to the first label and the secondary safety virtual machine corresponding to the second label, etc. These will not be listed one by one here. As long as they do not exceed the core idea of this application, they are also within the scope of protection of this application.
[0304] It should also be noted that both the configuration information of the main security virtual machine and the configuration information of the slave security virtual machine include the startup configuration information, debugging configuration information and security configuration information mentioned in the aforementioned embodiments. The role of each type of configuration information can be referred to the aforementioned related content and will not be repeated here.
[0305] S901. The application processor provides configuration information to the security coprocessor.
[0306] After parsing all the configuration information, the application processor sends the configuration information to the security coprocessor. It should be noted that the application processor itself does not store any parsed configuration information. Therefore, in the subsequent steps, the security coprocessor needs to provide the application processor with relevant configuration information according to the task requirements. The details will be expanded in the subsequent content and will not be described in detail here.
[0307] S902: The security coprocessor obtains configuration information and encrypts the first operating system file.
[0308] The security coprocessor starts the boot process of the main security virtual machine in response to the obtained configuration information.
[0309] First, as an optional implementation, the security coprocessor stores configuration information in the form of a security virtual machine structure. In this case, the security coprocessor creates a security virtual machine structure of the main security virtual machine, and stores the configuration information of the main security virtual machine in the security virtual machine structure. At the same time, the life cycle of the main security virtual machine is also recorded. As for the specific implementation method of the security coprocessor creating the security virtual machine structure of the main security virtual machine and the specific form of the security virtual machine structure, they can all be implemented with reference to relevant technologies, and this application does not limit this.
[0310] Then, the security coprocessor encrypts the operating system file loaded by the main security virtual machine. For ease of description, this embodiment defines the operating system file of the operating system loaded by the main security virtual machine as the first operating system file.
[0311] As an optional implementation, the security coprocessor sends a third notification command to the application processor, and the application processor allocates a VMID to the primary security virtual machine in response to the third notification command. As mentioned above, the present application uniquely characterizes the security virtual machine by VMID, so it is necessary to allocate a VMID to the security virtual machine during the security virtual machine creation process. In response to the third notification command, the application processor selects an unused VMID from the VMID set, allocates it to the primary security virtual machine, and feeds back the allocation result to the security coprocessor.
[0312] The security coprocessor stores the VMID of the primary security virtual machine in the security virtual machine structure and sends a first notification command, which instructs the application processor to load the first operating system file of the primary security virtual machine into the memory. As an optional implementation, the specific implementation of the security coprocessor sending the first notification command can be referred to Figure 3 The relevant contents of S101 in the illustrated embodiment will not be repeated here.
[0313] Furthermore, the security coprocessor generates a virtual machine key for the primary security virtual machine, and establishes a binding relationship between the virtual machine key of the primary security virtual machine and the virtual machine key of the primary security virtual machine. The process of generating the virtual machine key can be implemented with reference to the relevant content in the aforementioned embodiment, and will not be repeated here. In an optional implementation, after obtaining the virtual machine key, the security coprocessor will also store the virtual machine key in the key slot of the cryptographic engine in the memory controller for subsequent use in encrypting and decrypting memory data.
[0314] After the virtual machine key of the primary secure virtual machine is generated, the security coprocessor encrypts the first operating system file of the primary secure virtual machine based on the virtual machine key.
[0315] It is understandable that by encrypting the operating system files, the security of the operating system files can be significantly improved, preventing external attacks from easily attacking the operating system of the secure virtual machine, thereby improving the security of the secure virtual machine. Furthermore, since the virtual machine keys used by each secure virtual machine are different, encrypting the operating system files can also prevent a secure virtual machine from using or changing the operating system of other secure virtual machines, which helps to improve the isolation and security between secure virtual machines.
[0316] S903. The security coprocessor sends the startup configuration information in the configuration information of the main security virtual machine to the application processor.
[0317] As mentioned above, the configuration information of the main security virtual machine includes startup configuration information. Figure 3 The secure virtual machine startup method provided in the illustrated embodiment is that after the security coprocessor encrypts the first operating system file of the main secure virtual machine, it further sends the startup configuration information of the main secure virtual machine to the application processor, so that the application processor creates the operating environment of the main secure virtual machine.
[0318] As an optional implementation, the security coprocessor generates a second notification command including the startup configuration information of the primary security virtual machine, and sends the second notification command to the application processor. As for the specific implementation of the second notification command, reference may be made to the relevant content in the aforementioned embodiment, which will not be repeated here.
[0319] S904: The application processor starts the main secure virtual machine based on the startup configuration information of the main secure virtual machine and the encrypted first operating system file.
[0320] The application processor creates an operating environment for the primary security virtual machine based on the startup configuration information provided by the security coprocessor. When the security coprocessor transmits the startup configuration information of the primary security virtual machine through the second notification command, the application processor first parses the obtained second notification command and further obtains the startup configuration information related to the primary security virtual machine included in the command.
[0321] Furthermore, the application processor creates the operating environment information of the primary security virtual machine based on the startup configuration information of the primary security virtual machine, for example, sets the initial register information based on the startup configuration information, and determines the private memory space of the primary security virtual machine, etc. Then, the application processor uses the VMID of the aforementioned primary security virtual machine as the index of the operating environment information of the primary security virtual machine, so that the startup configuration information of the primary security virtual machine corresponds to the same VMID, which facilitates the determination of the corresponding operating environment information when the primary security virtual machine is started again.
[0322] After creating the operating environment information based on the startup configuration information, the application processor creates the operating environment of the primary secure virtual machine based on the operating environment information, and runs the encrypted first operating system file in the operating environment of the primary secure virtual machine to start the primary secure virtual machine. As for other related operations of starting the primary secure virtual machine, such as setting the primary secure virtual machine to a waiting-to-start state, etc., all can refer to the relevant contents of the aforementioned embodiment, which will not be repeated here.
[0323] After starting the main secure virtual machine, the subsequent S905 can be executed to start the startup process of the secondary secure virtual machine. However, based on the above content, it can be seen that whether the cloud platform starts the secure virtual machine according to the requirements of the virtual machine user is extremely important for both the usage requirements of the virtual machine user and the reliability and security of the secure virtual machine. Therefore, as a preferred implementation, after starting the main secure virtual machine, the application processor feeds back the startup result of the main secure virtual machine to the security coprocessor, and the security coprocessor measures the main secure virtual machine in response to the startup result of the main secure virtual machine.
[0324] Specifically, referring to the foregoing content, the security coprocessor first determines whether the preset virtual machine measurement conditions are met. In an optional implementation, if the cloud platform to which the security coprocessor belongs is operating normally, the virtual machine manager corresponding to the security virtual machine is in a working state, and the main security virtual machine is in a waiting state, it is determined that the preset virtual machine measurement conditions are met. On the contrary, if the cloud platform operates abnormally, or the virtual machine manager is in a non-working state, or the main security virtual machine is not in a waiting state, it is determined that the preset virtual machine measurement conditions are not met. In the case of determining that the preset virtual machine measurement conditions are not met, the security coprocessor may terminate the subsequent startup process and notify the virtual machine user of the abnormal results. It should be noted that in actual applications, other virtual machine measurement conditions can also be set based on actual inspection requirements and measurement requirements of the security virtual machine. Without exceeding the core idea of the present application, they also fall within the scope of protection of the present application.
[0325] After determining that the preset virtual machine measurement condition is met, the security coprocessor calculates the hash value of the target configuration item in the configuration information of the primary security virtual machine. As for the selection of the target configuration item, reference may be made to the relevant content in the aforementioned embodiment, which will not be repeated here.
[0326] In an optional implementation, the security coprocessor uses a pre-generated transmission key to encrypt the configuration information of the secure virtual machine and stores the configuration information of the secure virtual machine in ciphertext form. In this case, the security coprocessor needs to send the obtained hash value and the transmission key to the user terminal at the same time through a secure channel. Specifically, before sending the hash value, the security coprocessor uses the channel key to encrypt the hash value and the transmission key, and transmits the encrypted hash value and transmission key through a secure channel. After the user terminal obtains the encrypted hash value and the transmission key, it uses the channel key it holds to decrypt the encrypted hash value and the channel key, and then obtains the decrypted hash value and the transmission key. Furthermore, the user terminal verifies the signature of the obtained hash value to obtain the corresponding target configuration item ciphertext, and then uses the transmission key to decrypt the target configuration ciphertext to obtain the target configuration item plaintext, and determines whether the cloud platform starts the target secure virtual machine as required by verifying the target configuration item. As mentioned above, the user terminal stores the configuration information of each secure virtual machine. After the user terminal obtains the target configuration item in plain text through the above steps, the virtual machine user verifies each target configuration item based on the initial configuration information recorded in the configuration file, and can determine whether the cloud platform starts the main secure virtual machine according to the configuration file, that is, the user's request. If the virtual machine user determines that the cloud platform does not start the main secure virtual machine according to the configuration file, the user terminal notifies the security coprocessor of the startup error, and the security coprocessor terminates the subsequent startup process and marks the main secure virtual machine as waiting for startup.
[0327] It should be noted that the confirmation of the measurement results of the main security virtual machine still requires the participation of the virtual machine user, and the subsequent confirmation of the measurement results of the slave security virtual machine will be completed by the main security virtual machine based on the SDK file. Therefore, compared with the existing technology, the time for starting the virtual machine can be greatly saved.
[0328] In an optional implementation, before measuring the main secure virtual machine, the security coprocessor may also check the entire startup process of the main secure virtual machine, and if a security problem is found in the startup process, the subsequent startup process may be terminated.
[0329] Further, after the virtual machine user confirms that the measurement result of the primary secure virtual machine is correct, the second disk encryption key is sent to the security coprocessor through the secure channel created during the process of starting the primary secure virtual machine, and the security coprocessor encrypts the disk data of the primary secure virtual machine based on the second disk encryption key. Further, the security coprocessor marks the primary secure virtual machine as activated, and the primary secure virtual machine completes the entire startup process.
[0330] Afterwards, the security coprocessor uses each of the at least one slave security virtual machine as a target slave security virtual machine, and starts the target slave security virtual machine according to subsequent steps.
[0331] S905: The security coprocessor encrypts the second operating system file, and sends the startup configuration information of the target from the configuration information of the secure virtual machine to the application processor.
[0332] First of all, it should be noted that the second operating system file mentioned in this embodiment refers to the operating system file loaded by the target from the secure virtual machine. The encryption process of the second operating system file by the security coprocessor is similar to the process of encrypting the first operating system file mentioned above. This step briefly introduces the execution process of encrypting the second operating system file. For the parts that are not expanded in detail, you can refer to the related content mentioned above, which will not be described in detail here.
[0333] First, when the security coprocessor stores configuration information in the form of a security virtual machine structure, the security coprocessor creates a security virtual machine structure of the target slave security virtual machine, and stores the configuration information of the target slave security virtual machine in its corresponding security virtual machine structure, and at the same time, it also records the life cycle of the target slave security virtual machine. As for the specific implementation method of the security coprocessor creating the security virtual machine structure of the target slave security virtual machine and the specific form of the security virtual machine structure, they can all be implemented with reference to the relevant technology, and this application does not limit this.
[0334] Further, the security coprocessor notifies the application processor to allocate a VMID for the target slave security virtual machine. The application processor selects an unused VMID from the VMID set, allocates it to the target slave security virtual machine, and feeds back the allocation result to the security coprocessor. The security coprocessor checks the legitimacy of the VMID allocated to the target slave security virtual machine to confirm whether it is within the secure VMID range. The security coprocessor stores the VMID of the target slave security virtual machine in the secure virtual machine structure corresponding to the target slave security virtual machine, and sends a first notification command, instructing the application processor to load the second operating system file into the memory through the first notification command.
[0335] The security coprocessor generates a virtual machine key of the target slave security virtual machine, and establishes a binding relationship between the virtual machine key of the target slave security virtual machine and the virtual machine key of the target slave security virtual machine. The process of generating the virtual machine key can be implemented with reference to the relevant content in the aforementioned embodiment, and will not be repeated here. After generating the virtual machine key of the target slave security virtual machine, the security coprocessor encrypts the second operating system file based on the virtual machine key.
[0336] Further, as described above, the security coprocessor stores configuration information of the master security virtual machine and each slave security virtual machine, based on which, after encrypting the second operating system file, the security coprocessor sends the startup configuration information of the target slave security virtual machine to the application processor. As an optional implementation, the security coprocessor generates a second notification command including the startup configuration information of the target slave security virtual machine, and sends the second notification command to the application processor.
[0337] S906: The application processor starts the target slave secure virtual machine based on the startup configuration information of the target slave secure virtual machine and the second operating system file encrypted by the security coprocessor.
[0338] The application processor obtains the startup configuration information of the target slave secure virtual machine provided by the security coprocessor, and creates a running environment of the target slave secure virtual machine based on the obtained startup configuration information.
[0339] Referring to the startup process of the aforementioned master secure virtual machine, first, the application processor creates the target slave secure virtual machine's operating environment information based on the startup configuration information of the target slave secure virtual machine, and then the application processor uses the VMID of the aforementioned target slave secure virtual machine as the index of the target slave secure virtual machine's operating environment information, so as to facilitate the determination of the corresponding operating environment information when the target slave secure virtual machine is started again. After creating the operating environment information, the application processor creates the operating environment of the target slave secure virtual machine based on the operating environment information.
[0340] Further, the application processor runs the encrypted second operating system file in the operating environment of the target slave secure virtual machine to start the target slave secure virtual machine. As for other related operations of starting the target slave secure virtual machine, such as setting the target slave secure virtual machine to a waiting-to-start state, etc., reference can be made to the relevant contents of the aforementioned embodiment, which will not be repeated here.
[0341] S907: The application processor provides the security coprocessor with a result of starting the target from the secure virtual machine.
[0342] After starting the target slave secure virtual machine, the application processor further provides the secure coprocessor with the startup result of the target slave secure virtual machine. The startup result may include information related to the startup process of the target slave secure virtual machine, such as hardware resource information related to the target slave secure virtual machine and operating system status information of the target slave secure virtual machine, etc. Of course, other information may also be included, which will not be described in detail here, and this application does not limit the specific information included in the startup result.
[0343] S908: The security coprocessor measures the target slave security virtual machine in response to the startup result of the target slave security virtual machine.
[0344] After the security coprocessor obtains the startup result of the target from the secure virtual machine, the security coprocessor can also verify the obtained startup result, for example, confirm whether the information format of the information included in the startup result is abnormal, whether the startup result includes information that may affect security, etc. If it is determined that the startup result is abnormal, the security coprocessor can terminate subsequent measurement operations and feedback abnormal alarm information to the user terminal through the aforementioned secure channel.
[0345] Before measuring the target slave secure virtual machine, the security coprocessor may also check the entire boot process of the target slave secure virtual machine, and if a security problem is found in the boot process, the subsequent boot process may be terminated.
[0346] Further, referring to the foregoing content, before measuring the target slave security virtual machine, the security coprocessor first determines whether the preset virtual machine measurement condition is met. In an optional implementation, if the cloud platform to which the security coprocessor belongs is operating normally, the virtual machine manager corresponding to the target slave security virtual machine is in a working state, and the target slave security virtual machine is in a waiting state to start, it is determined that the preset virtual machine measurement condition is met. On the contrary, if the cloud platform operates abnormally, or the virtual machine manager is in a non-working state, or the target slave security virtual machine is not in a waiting state to start, it is determined that the preset virtual machine measurement condition is not met. It should be noted that in actual applications, other virtual machine measurement conditions can also be set based on actual inspection requirements and measurement requirements of security virtual machines. Without exceeding the core idea of this application, they also fall within the scope of protection of this application.
[0347] After determining that the preset virtual machine measurement conditions are met, the security coprocessor calculates the hash value of the target configuration item in the configuration information of the target slave security virtual machine. As mentioned above, there are many configuration items included in the configuration information of the target slave security processor. In practical applications, all or part of the configuration items can be selected according to the actual measurement requirements to calculate the hash value. Of course, the selection of the target configuration item is based on the ability to comprehensively measure or judge whether the security virtual machine is started according to the requirements of the virtual machine user, and the typical configuration items in the configuration information are selected as the target configuration items. In an optional embodiment, the target configuration item includes the startup information of the target slave security virtual machine, the private data summary of the target slave security virtual machine, the version number of the security firmware in the security coprocessor, the summary of the security firmware, the random number generated by the security firmware, and at least one of the transmission keys used to encrypt the configuration information. Of course, other configuration items can also be selected for calculating the hash value, which also belongs to the scope of protection of this application without exceeding the core idea of the present application.
[0348] S909. The security coprocessor sends the verification benchmark information and the measurement result of the target slave security virtual machine to the master security virtual machine.
[0349] The security coprocessor calculates the hash value obtained according to the above steps, which is the measurement result of the target slave security virtual machine. The security coprocessor sends the measurement result of the target slave security virtual machine to the main security virtual machine. On this basis, the security coprocessor will further send the verification benchmark information corresponding to the target slave security virtual machine to the main virtual machine.
[0350] It should be noted that, in this embodiment, the verification benchmark information is used to verify the measurement results of the target slave security virtual machine. In combination with the verification process of the measurement results of the aforementioned master security virtual machine, it can be seen that the user terminal determines whether the cloud platform starts the master security virtual machine according to the configuration file by comparing the difference between the initial configuration information recorded in the configuration file and the corresponding target configuration item. It can be understood that since the master security virtual machine does not store the configuration files of all security virtual machines like the user terminal, and can obtain the initial configuration information of the security virtual machine based on the configuration file, the security coprocessor needs to provide this information to the master security virtual machine for use when the master security virtual machine verifies the target slave security virtual machine. Therefore, the verification benchmark information described in this embodiment includes the initial configuration information of each target configuration item used to calculate the hash value of the target slave security virtual machine.
[0351] S910. The master security virtual machine verifies the measurement result of the target slave security virtual machine based on the security configuration information of the target slave security virtual machine.
[0352] After obtaining the verification benchmark information and the measurement result of the target slave security virtual machine, that is, the hash value, the master security virtual machine verifies the obtained hash value to obtain the plain text of the target configuration item, and then compares and verifies each target configuration item based on the verification benchmark information. If the two are consistent, it can be determined that the target slave security virtual machine is started according to the configuration file. Otherwise, it can be determined that the target slave security virtual machine is not started according to the configuration file.
[0353] From the above content, it can be seen that the confirmation of the measurement results of the target slave security virtual machine is completed by the main security virtual machine, and no longer requires the participation of the virtual machine user. Therefore, compared with the existing technology, the startup time of the virtual machine can be greatly saved.
[0354] It should be noted that the security configuration information provided by the security coprocessor to the main security virtual machine is encrypted by the virtual machine key of the main security virtual machine. After obtaining the ciphertext of the security configuration information, the main security virtual machine can directly use its own virtual machine key to decrypt it, and then obtain the corresponding plaintext of the security configuration information. Since the virtual machine key required for decryption can be directly used by the main security virtual machine, and the decryption process is performed by the main security virtual machine, the decryption process is not only sufficiently secure but also efficient.
[0355] Further, after determining that the measurement result of the target slave security virtual machine is normal, the master security virtual machine provides the first disk encryption key to the security coprocessor, and the security coprocessor obtains the first disk encryption key and encrypts the disk data of the target slave security virtual machine based on the first disk encryption key. Afterwards, the security coprocessor marks the target slave security virtual machine as activated, and at this point, the target slave security virtual machine completes the entire startup process.
[0356] To sum up, the secure virtual machine startup method provided in the present application, after starting the main secure virtual machine, the main secure virtual machine verifies the measurement results of each subsequent slave secure virtual machine. Compared with the method in the prior art in which the virtual machine user verifies the measurement results of each secure virtual machine one by one, the startup efficiency of the secure virtual machine can be greatly improved. At the same time, it saves a lot of time for virtual machine users and improves the user experience of virtual machine users.
[0357] Furthermore, by recording the configuration information of all secure virtual machines in one configuration file, it is possible to avoid the virtual machine user from uploading the configuration files of each secure virtual machine one by one, thereby further saving the time of the virtual machine user.
[0358] Refer to the above Figure 5 In the embodiment shown, according to Fig.11 The virtual machine startup method provided in the illustrated embodiment can also verify the performance of the cloud platform before starting the secure virtual machine.
[0359] First, the virtual machine user sends a platform security verification request to the application processor through the user terminal. After receiving the platform security verification request, the application processor verifies the legitimacy of the request and forwards the platform security verification request to the security coprocessor after the verification passes.
[0360] The security coprocessor responds to the platform security verification request and provides the cloud platform's verification certificate and channel key to the application processor. The application processor receives and forwards the verification certificate and channel key to the user terminal. The user terminal verifies the cloud platform based on the verification certificate. If after verification, the virtual machine user finds that there are security issues with the cloud platform, such as some verification information does not match, the subsequent virtual machine startup operation can be terminated immediately.
[0361] In an optional implementation, the user terminal may also initiate a hardware performance query request to the application processor, aiming to obtain the hardware performance information of the cloud platform through the request, such as whether the cloud platform has enabled the encryption and security isolation function and whether sufficient resources are reserved to run the secure virtual machine to be started, etc. Of course, other relevant information may also be obtained through the hardware performance query request, which needs to be determined in combination with the actual verification requirements of the virtual machine user, and this application does not make specific restrictions on this. The application processor responds to the hardware performance query request and feeds back the hardware performance parameters of the cloud platform to the user terminal. In this embodiment, the hardware performance parameters fed back by the cloud platform may include: whether the cloud platform has enabled the encryption and security isolation function, the secure virtual machines on the cloud platform that are currently not assigned a VMID, and the hardware resources of the cloud platform (such as processor resources, storage space, and network resources, etc.). As an optional implementation, the application processor will also send the hardware performance parameters to the security coprocessor at the same time, so that the security coprocessor can also understand the current static capabilities of the cloud platform.
[0362] The user terminal displays the hardware performance parameters fed back by the application processor. The virtual machine user verifies the obtained hardware performance parameters one by one to confirm whether the cloud platform misreports the static capabilities. Once it is confirmed that the cloud platform misreports the static capabilities, the subsequent virtual machine startup operations can also be terminated immediately.
[0363] In another possible implementation, the user terminal may also initiate a software performance query request, and the application processor responds to the software performance query request and feeds back to the user terminal the target software configuration of the cloud platform, where the target software configuration is used to indicate whether the cloud platform supports the elastic startup method of first starting the master security virtual machine and then starting each slave security virtual machine respectively provided in this embodiment. It is understandable that only when the target software configuration indicates that the cloud platform supports elastic startup, can the aforementioned method be further implemented. Fig.11The embodiment shown starts each secure virtual machine. On the contrary, if the target software configuration indicates that the cloud platform does not support elastic startup, the subsequent elastic startup process is terminated. Of course, the aforementioned Figure 3 or Figure 4 The illustrated embodiment starts each secure virtual machine in sequence.
[0364] Furthermore, after the aforementioned steps to determine the cloud platform security and software / hardware performance, the user terminal establishes a secure channel with the security coprocessor based on the channel key provided by the security coprocessor to meet the communication needs between the user terminal and the security coprocessor in certain situations. Fig.11 The method shown starts each secure virtual machine.
[0365] To sum up, the method provided in this embodiment can effectively improve the startup efficiency of multiple secure virtual machines and save a lot of time for virtual machine users. It can also verify the security and performance of the cloud platform, which helps to further improve the security of secure virtual machines and cloud platforms.
[0366] Furthermore, the present application also provides a processor, which is configured to execute Fig.11 The illustrated embodiment provides method steps executed by a security processor in a secure virtual machine startup method.
[0367] Furthermore, the present application also provides a processor, which is configured to execute Fig.11 The illustrated embodiment provides method steps for application processor execution in a secure virtual machine startup method.
[0368] In some embodiments, this embodiment further provides a computer-readable storage medium, such as a floppy disk, an optical disk, a hard disk, a flash memory, a U disk, an SD (Secure Digital Memory Card) card, an MMC (Multimedia Card) card, etc., in which one or more instructions for implementing the above steps are stored. When the one or more instructions are executed by one or more processors, the processors execute the secure virtual machine startup method, secure virtual machine measurement method, or secure virtual machine debugging method described above. For the relevant specific implementation, please refer to the above description, which will not be repeated here.
[0369] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions. When the computer program instructions are executed by a processor, the processor executes the steps in the secure virtual machine debugging method, secure virtual machine measurement method, or secure virtual machine startup method according to various embodiments of the present application described in the above content of this specification.
[0370] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0371] Those skilled in the art will appreciate that the contents disclosed in this disclosure may be subject to various modifications and improvements. For example, the various devices or components described above may be implemented by hardware, or by software, firmware, or a combination of some or all of the three.
[0372] In addition, although the present disclosure makes various references to certain units in the system according to embodiments of the present disclosure, any number of different units can be used and run on the client and / or server. The units are only illustrative, and different aspects of the system and method can use different units.
[0373] Flowcharts are used in this disclosure to illustrate the steps of the method according to the embodiments of the present disclosure. It should be understood that the preceding or following steps are not necessarily performed precisely in order. On the contrary, various steps may be processed in reverse order or simultaneously. At the same time, other operations may also be added to these processes.
[0374] Those skilled in the art will appreciate that all or part of the steps in the above method can be completed by commanding the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, such as a read-only memory, etc. Optionally, all or part of the steps in the above embodiment can also be implemented using one or more integrated circuits. Accordingly, each module / unit in the above embodiment can be implemented in the form of hardware or in the form of a software functional module. The present disclosure is not limited to any particular form of combination of hardware and software.
[0375] Unless otherwise defined, all terms used herein have the same meaning as commonly understood by those of ordinary skill in the art to which the present disclosure belongs. It should also be understood that terms such as those defined in common dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant technology, and should not be interpreted in an idealized or highly formal sense, unless explicitly defined as such herein.
[0376] The above is an explanation of the present disclosure and should not be considered as a limitation thereof. Although several exemplary embodiments of the present disclosure are described, it will be readily understood by those skilled in the art that many modifications may be made to the exemplary embodiments without departing from the novel teachings and advantages of the present disclosure. Therefore, all such modifications are intended to be included within the scope of the present disclosure as defined in the claims. It should be understood that the above is an explanation of the present disclosure and should not be considered to be limited to the specific embodiments disclosed, and modifications to the disclosed embodiments and other embodiments are intended to be included within the scope of the appended claims. The present disclosure is defined by the claims and their equivalents.
Claims
1. A secure virtual machine measurement method, characterized in that: Applied to a first processor, the method comprises: In response to the startup result of the target secure virtual machine, determining whether a preset virtual machine measurement condition is met; If the preset virtual machine measurement condition is met, calculating a hash value of a target configuration item in the configuration information of the target secure virtual machine; At least the hash value is provided to a user terminal, and the user terminal obtains the target configuration item based on the hash value and verifies the target configuration item.
2. The method according to claim 1, characterized in that: The determining whether a preset virtual machine measurement condition is met includes: If the cloud platform to which the first processor belongs is operating normally, the virtual machine manager corresponding to the target secure virtual machine is in a working state, the target secure virtual machine is in a waiting state for startup, and the security configuration information in the configuration information of the target secure virtual machine meets the preset configuration rules, it is determined that the preset virtual machine measurement condition is met; If the cloud platform operates abnormally, or the virtual machine manager is in a non-working state, or the target secure virtual machine is not in the waiting-to-start state, or at least one configuration item in the security configuration information does not comply with the preset configuration rule, it is determined that the preset virtual machine measurement condition is not met.
3. The method according to claim 2, characterized in that Also includes: If the cloud platform runs abnormally, all the secure virtual machines of the cloud platform are controlled to stop running, and each of the secure virtual machines is marked as inactive; If the virtual machine manager is in a non-working state, controlling the virtual machine manager to run; If the target secure virtual machine is not in the waiting-to-start state, terminating the measurement process of the target secure virtual machine, and notifying the user terminal that the target secure virtual machine is started abnormally; If at least one configuration item in the security configuration information does not comply with the preset configuration rule, the measurement process of the target secure virtual machine is terminated.
4. The method according to claim 1, characterized in that: The target configuration item includes at least one of the startup information of the secure virtual machine, the private data summary of the secure virtual machine, the version number of the secure firmware in the first processor, the summary of the secure firmware, a random number generated by the secure firmware, and a transmission key used to encrypt configuration information.
5. The method according to claim 1, characterized in that The at least providing the hash value to the user terminal includes: Sending the hash value and the transmission key to the user terminal via a secure channel; Among them, the secure channel is created based on the channel key generated by the first processor during the process of starting the target secure virtual machine, the user terminal obtains the ciphertext of the target configuration item based on the hash value, decrypts the ciphertext based on the transmission key, and verifies the plaintext of the obtained target configuration item.
6. The method according to claim 1, characterized in that Also includes: Obtaining a disk encryption key, where the disk encryption key is provided by the user terminal after determining that the target secure virtual machine measurement result is normal; The disk data of the target secure virtual machine is encrypted based on the disk encryption key.
7. The method according to claim 6, characterized in that Before encrypting the disk data of the target secure virtual machine based on the disk encryption key, marking the target secure virtual machine as a disk encryption state; After encrypting the disk data of the target secure virtual machine based on the disk encryption key, marking the target secure virtual machine as an activated state.
8. A processor, characterized in that: The processor is configured to execute the secure virtual machine measurement method according to any one of claims 1 to 7.
9. A system on chip, characterized in that: comprising a second processor and the first processor as claimed in claim 8, wherein: The second processor is communicatively connected to the first processor; The second processor is used to start the secure virtual machine and send a start result of the secure virtual machine to the first processor.
10. The system on chip according to claim 9, characterized in that: The second processor is further configured to: during the secure virtual machine measurement process, check a startup process of a secure virtual machine that is not in a startup waiting state.
11. A server, characterized in that: The method comprises the system on chip, memory and peripheral device as claimed in claim 9 or 10, wherein: The system on chip is communicatively connected with the memory and the peripheral device respectively.
12. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed, the secure virtual machine measurement method according to any one of claims 1 to 7 is implemented.
