Confidential container creation method, electronic device, storage medium, and computer program product
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-17
- Publication Date
- 2026-08-11
AI Technical Summary
相关技术中的机密容器方案多采用基于机密虚拟机(cVM,confidential VirtualMachine)的架构实现,虽在一定程度上强化了隔离能力,但仍存在显著技术局限:每次创建机密容器时均需在机密虚拟机中重新拉取镜像,这一过程需要消耗不少时间,导致创建机密容器的时间长,效率低
[0006]本申请实施例还提供一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述机密容器创建方法任一方法的步骤。
Smart Images

Figure CN122547460A_ABST
Abstract
Description
Technical Field
[0001] This application relates to cloud computing technology, and more particularly to a method for creating confidential containers, electronic devices, storage media, and computer program products. Background Technology
[0002] With the widespread adoption of cloud computing and containerization technologies, containers have become an important form of cloud-native application deployment. To protect the integrity and security of user container images in multi-tenant environments, Confidential Containers (COCO) technology, based on a Trusted Execution Environment (TEE), has emerged. Most confidential container solutions in related technologies adopt an architecture based on a confidential Virtual Machine (cVM). While this enhances isolation capabilities to some extent, it still has significant technical limitations: each time a confidential container is created, the image must be pulled again from the confidential virtual machine, a process that consumes considerable time, resulting in long creation times and low efficiency. Summary of the Invention
[0003] This application provides a method for creating a confidential container, an electronic device, a storage medium, and a computer program product.
[0004] This application provides a method for creating a confidential container, the method comprising: The receiving terminal sends a first request, which is used to request the creation of a first container; When the first virtual machine is created and started, the first persistent storage volume corresponding to the metric value of the first virtual machine is obtained. One metric value corresponds to one persistent storage volume, and the persistent storage volume is used to store container image data. The first container is created in the first virtual machine based on the container image data stored in the first persistent storage volume.
[0005] This application also provides an electronic device, including a processor and a memory for storing a computer program capable of running on the processor. When the processor runs the computer program, it executes any of the steps of the above-described confidential container creation method.
[0006] This application also provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of any of the above-described confidential container creation methods.
[0007] This application provides a computer program product, including a computer program or computer executable instructions, which, when executed by a processor, implement the steps of any of the above-described confidential container creation methods.
[0008] The confidential container creation method, electronic device, storage medium, and computer program product provided in this application embodiment receive a first request sent by a terminal, the first request being used to request the creation of a first container; when a first virtual machine is created and started, a first persistent storage volume (PV) corresponding to the metric value of the first virtual machine is obtained, one metric value corresponds to one persistent storage volume, and the persistent storage volume is used to store container image data; based on the container image data stored in the first persistent storage volume, the first container is created in the first virtual machine. In the above scheme, by obtaining the first persistent storage volume corresponding to the metric value of the first virtual machine, and creating the first container in the first virtual machine based on the container image data stored in the first persistent storage volume, the container image data stored in the persistent storage volume can be reused, avoiding repeatedly pulling the same container image data from a remote end, reducing the time for obtaining container image data, thereby reducing the time for creating the container and improving the efficiency of container creation. Attached Figure Description
[0009] Figure 1 This is a schematic diagram of the architecture of a confidential container creation system provided by related technologies; Figure 2 This is a schematic diagram of the architecture of the confidential container creation system provided in the embodiments of this application; Figure 3 This is a first flowchart illustrating the confidential container creation method provided in this application embodiment; Figure 4 This is a second flowchart illustrating the confidential container creation method provided in this application embodiment; Figure 5 This is a schematic diagram of the third process of the confidential container creation method provided in the embodiments of this application; Figure 6 This is a schematic diagram of the fourth process of the confidential container creation method provided in the embodiments of this application; Figure 7 This is a schematic diagram of the confidential container creation apparatus provided in the embodiments of this application; Figure 8 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application.
[0010] It should be noted that the terms "first", "second", "third", and "fourth" mentioned above are only used to distinguish different options and do not represent the degree of superiority or inferiority of the options or their priority in the implementation process. Detailed Implementation
[0011] Confidential computing protects data in use by performing computational tasks in a hardware-based, certified TEE.
[0012] The basic idea of a TEE (Transmission over Execution Environment) is to allocate a separate, isolated region within the Central Processing Unit (CPU) and memory for computations involving sensitive data. Hardware-based encryption protects this region from access by other parts of the CPU. The three key characteristics of a TEE are: data confidentiality, data integrity, and code integrity. Unauthorized entities cannot view or tamper with the data being used within the TEE, nor can they modify the code running within it. In addition, attestability is also an important feature of most TEEs. This refers to the TEE providing evidence or metrics about its origin and current state, allowing third parties to verify and determine whether the code running within the TEE can be trusted. TEEs are typically supported and implemented by CPU hardware manufacturers. Common TEEs include Advanced Micro Devices Secure Encrypted Virtualization (AMDSEV), Intel Software Guard Extensions (Intel SGX), Intel Trusted Domain Extensions (TDX), China Secure Virtualization (CSV) from Hygon, and Kunpeng TrustZone.
[0013] Confidential Containers is a sandbox project under the Cloud Native Computing Foundation (CNCF) open-source community. Its goal is to combine Container Execution Environments (TEEs) with cloud-native technologies to provide cloud-native confidential computing. Most TEEs choose to use the boundary of the kernel-based virtual machine (KVM) between the host and the virtual machine as the TEE boundary, encrypting or providing security protection for the entire virtual machine. Therefore, Confidential Containers also provides a virtual machine-based architecture. In this architecture, the confidential virtual machine acts as a container group (Pod) of the Kubernetes cluster, where user workloads are created and run. To ensure the confidentiality of user container images and prevent image tampering, Confidential Containers provides an image management component that pulls container images from the confidential virtual machine and performs decryption or signature verification. In contrast, ordinary secure containers, such as Kata, pull container images to the host and then share them within the virtual machine via a virtual file system.
[0014] A proposal for improving image management has been released in the COCO community. This proposal builds a new architecture based on the existing container runtime's remote snapshotter program. The remote snapshotter and the in-virtual machine's image management module work together to manage container images. The remote snapshotter determines the download location of image blocks (host or virtual machine), while the image management module is responsible for mounting the container's root file system within the virtual machine.
[0015] However, confidential container technology solutions in related fields require, to ensure the integrity and security of user container images, to re-pull the image into a confidential virtual machine and perform signature verification or decryption operations every time a new container is created. This solution has the following main problems: 1. Significantly increased startup time for recreating containers: Regardless of whether the same image has been pulled before, each container creation requires repeatedly pulling the complete image and performing verification or decryption processes. This process consumes considerable time, especially when dealing with large-capacity images or creating multiple Pods concurrently on a large scale, further exacerbating the latency issue and impacting business elasticity and efficiency.
[0016] 2. Low resource utilization, resulting in wasted storage resources: Each confidential virtual machine needs to download a complete container image containing all layers, which leads to the storage of a large amount of duplicate data and reduces the efficiency of storage resource utilization.
[0017] Based on this, in various embodiments of this application, by obtaining the first persistent storage volume corresponding to the metric value of the first virtual machine, and creating the first container in the first virtual machine based on the container image data stored in the first persistent storage volume, the container image data stored in the persistent storage volume can be reused, avoiding repeatedly pulling the same container image data from the remote end, reducing the time to obtain container image data, thereby reducing the time to create the container and improving the efficiency of creating the container.
[0018] Figure 1 This demonstrates a confidential container architecture design based on virtual machines in related technologies, including key process steps in container creation. The following section introduces... Figure 1 Each component: Kubernetes Bare Metal Node: A Kubernetes node that runs directly on a bare metal server.
[0019] kubelet: The core proxy component that runs on each Kubernetes node and is responsible for managing the Pod lifecycle and performing container operations.
[0020] The container runtime (containerd) implements the Container Runtime Interface (CRI) and interfaces with the underlying container runtime through the Open Container Initiative (OCI) specification.
[0021] Kata runtime: An OCI-compliant container runtime that allows the creation of secure containers within lightweight virtual machines.
[0022] KVM: A virtualization module built into the Linux kernel that supports TEEs such as SEV, TDX, and CSV for creating confidential virtual machines.
[0023] cVM: A confidential virtual machine created based on TEE.
[0024] Kata Agent: A lightweight daemon running within the VM, responsible for managing container lifecycles and handling requests from the kata-runtime.
[0025] Image Management (Image Mgmt): The image management module included in the Kata Agent is responsible for pulling images from VMs and verifying signatures or decrypting images according to configuration.
[0026] The Attestation Agent is responsible for collecting evidence within the TEE and sending it to the Key Broker Service (KBS) for authentication. This evidence proves whether the TEE is a trusted confidential execution environment; it can include at least: virtual machine metrics and hardware information supporting the TEE. This hardware information can include: the TEE model, compatibility information between the TEE and the host hardware, and hardware-level security verification records. After authentication, the Key Broker Service (KBS) can request relevant confidential information from the Key Management Service (KMS), such as keys for verifying signatures or decrypting images.
[0027] Key Broker Service: As the relying party, it receives evidence from the attester and forwards it to the Attestation Service (AS) for verification. It applies an evaluation strategy to the verification results to assess the attester's trustworthiness. Upon successful verification, it interacts with the Key Management System (KMS) to obtain the keys and returns them to the attester.
[0028] Attestation Service: Acts as a verifier to verify evidence from the TEE.
[0029] Key Management Service: Securely stores, manages, and backs up encryption keys used by applications and users. All three components (KBS, AS, and KMS) need to run within a TEE to protect sensitive data.
[0030] Container Image Registry: Stores and manages encrypted or signed container images.
[0031] Container Images: Container images pulled into a confidential virtual machine.
[0032] Host Kernel: The operating system kernel that runs on the physical machine.
[0033] Guest Kernel: An operating system kernel that runs inside the virtual machine and is independent of the host kernel, providing kernel support for the virtual machine.
[0034] Figure 2This paper presents an optimized virtual machine-based confidential container architecture diagram provided by an embodiment of the present application. A decision module, Persistent Volume Orchestrator (PVO), and a Secure Image Orchestrator (SIO), are added to both the kata-runtime and kata-agent, respectively. These modules are responsible for coordinating related operations, securely saving container image data to persistent storage volumes (PVs), and ensuring the security of subsequent use.
[0035] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0036] This application provides a method for creating a confidential container, applicable to electronic devices, including but not limited to one or more of the following: K8s Bare Metal Node, node devices, and servers. Figure 3 As shown, the method includes: Step 301: Receive a first request sent by the terminal, the first request being used to request the creation of a first container; Step 302: When the first virtual machine is created and started, obtain the first persistent storage volume corresponding to the metric value of the first virtual machine. One metric value corresponds to one persistent storage volume, and the persistent storage volume is used to store container image data. Step 303: Based on the container image data stored in the first persistent storage volume, create the first container in the first virtual machine.
[0037] Here, the electronic device receives a first request sent by the terminal, which may include various electronic devices used by the user. The first request carries at least one or more container names and container image addresses, and may also carry an identifier indicating whether confidential computing is enabled. If the first request carries an identifier indicating that confidential computing is enabled, it indicates that the container to be created is a confidential container; if the first request carries an identifier indicating that confidential computing is not enabled, it indicates that the container to be created is a non-confidential container. The first request is used to request the creation of a first container. The first container can be a confidential container; a confidential container can be understood as a container running in a hardware-based TEE.
[0038] In practical applications, taking the request to create the first container on a Kubernetes cluster as an example, the user sends the first request to the Kubernetes Application Programming Interface Server (kube-apiserver) of the Kubernetes cluster through the Kubernetes command-line tool (kubectl, Kubernetes Control), console, etc. The Kubernetes scheduler (kube-scheduler, Kubernetes Scheduler) selects one node from all nodes in the cluster as the node to create the first container and informs the kube-apiserver. The kubelet of each node listens to the kube-apiserver to determine whether the first container needs to be created locally.
[0039] After receiving the first request, the electronic device creates and starts the first virtual machine in the second TEE of the electronic device. The first virtual machine can be a confidential virtual machine. The confidential virtual machine is a secure virtual machine based on a hardware trusted execution environment that encrypts and isolates the virtual machine's memory and running state, so that the host machine cannot snoop on or tamper with its runtime data. The first virtual machine provides a secure running environment for the first container.
[0040] When a first virtual machine is created and started, the metric value of the first virtual machine is obtained, and the first persistent storage volume corresponding to the metric value of the first virtual machine is also obtained. The electronic device stores a persistent storage volume pool, which contains the metric value and the persistent storage volume corresponding to the metric value; when the first virtual machine is created and started, the first persistent storage volume is obtained from the persistent storage volume pool based on the metric value of the first virtual machine.
[0041] One metric corresponds to one persistent storage volume. The metric is a hash value calculated based on the underlying TEE support, obtained by analyzing relevant information required to start the virtual machine (such as the kernel, kernel command-line parameters, and initial RAM disk image). It is used to prove that the virtual machine environment has not been tampered with. Different virtual machines can have the same metric, and virtual machines with the same metric can share the same persistent storage volume. The persistent storage volume is a storage medium that can store data for a long time. The persistent storage volume is used to store container image data. The container image data is a complete package of data containing the programs, dependencies, configurations, and file systems required for container operation, used to create containers. The container image data corresponding to different containers can be completely the same, partially the same, or completely different.
[0042] After obtaining the first persistent storage volume corresponding to the metric value of the first virtual machine, the first container is created in the first virtual machine based on the container image data stored in the first persistent storage volume. It can be understood that if the first persistent storage volume stores all the container image data required for the first container, the first container can be created in the first virtual machine based solely on the container image data stored in the first persistent storage volume. If the first persistent storage volume stores only a portion of the container image data required for the first container, the first container needs to be created in the first virtual machine based on both the container image data stored in the first persistent storage volume and the container image data in the image repository. For example, the partial container image data required for creating the first container can be obtained from the first persistent storage volume, and the remaining container image data not stored in the first persistent storage volume for creating the first container can be downloaded from the image repository. The first container is then created in the first virtual machine based on these two portions of container image data.
[0043] In this embodiment, a first request is sent by the receiving terminal, which requests the creation of a first container. If a first virtual machine is created and started, a first persistent storage volume corresponding to the metric value of the first virtual machine is obtained. One metric value corresponds to one persistent storage volume, which is used to store container image data. Based on the container image data stored in the first persistent storage volume, the first container is created in the first virtual machine. In this scheme, by obtaining the first persistent storage volume corresponding to the metric value of the first virtual machine and creating the first container in the first virtual machine based on the container image data stored in the first persistent storage volume, the container image data stored in the persistent storage volume can be reused. This avoids repeatedly pulling the same container image data from a remote location, reducing the time spent obtaining container image data, thereby reducing the time spent creating the container and improving the efficiency of container creation.
[0044] In an optional embodiment, obtaining the first persistent storage volume corresponding to the metric value of the first virtual machine includes: If the first virtual machine is started, obtain the measurement value of the first virtual machine; Based on the metric value of the first virtual machine, obtain the first persistent storage volume corresponding to the metric value of the first virtual machine.
[0045] Here, when starting the first virtual machine, based on the underlying support of the TEE where the first virtual machine resides, and by calculating the relevant information required to start the virtual machine, the metric value of the first virtual machine is obtained. This relevant information may include one or more of the following: the kernel required to start the virtual machine, kernel command-line parameters, and the initrd image. After calculating the metric value of the first virtual machine, the metric value and the unique identifier of the first virtual machine can also be stored in an electronic device so that the stored metric value can be directly read later.
[0046] When obtaining the metric value of the first virtual machine, modifying any input information, such as changing command-line parameters or replacing the initrd image, can generate different metric values for different users and associate them with different persistent storage volumes. In this way, confidential virtual machines with the same metric value can share the same persistent storage volume, thereby isolating different users in a multi-tenant scenario and allowing confidential containers of the same user to share container image data. Of course, all virtual machines of the same user can also be grouped, allowing confidential virtual machines in the same group to have the same metric value, enabling confidential containers of the same user to share container image data on demand; for example, the user can specify a group identifier in the first request, and the electronic device generates a common metric value for the group of confidential virtual machines based on the group identifier.
[0047] After obtaining the metric value of the first virtual machine, based on the correspondence between the metric value and the persistent storage volume, the persistent storage volume corresponding to the metric value of the first virtual machine is searched in the persistent storage volume pool. If a persistent storage volume matching the metric value of the first virtual machine is found in the persistent storage volume pool, then the persistent storage volume is the first persistent storage volume. If no persistent storage volume matching the metric value of the first virtual machine is found in the persistent storage volume pool, then the first persistent storage volume corresponding to the metric value of the first virtual machine does not exist in the persistent storage volume pool, and the first persistent storage volume corresponding to the metric value of the first virtual machine is created.
[0048] In this embodiment, when a first virtual machine is started, its metric value is obtained; based on the metric value of the first virtual machine, the first persistent storage volume corresponding to the metric value of the first virtual machine is obtained. In this way, since multiple virtual machines can have the same metric value, and one metric value corresponds to one persistent storage volume, determining the persistent storage volume corresponding to the metric value allows containers in different virtual machines to share container image data in the same persistent storage volume, achieving container image data reuse. Furthermore, the same container image data corresponding to containers in different virtual machines will only be stored once in the shared persistent storage volume. Compared to the solution where each virtual machine needs to download a complete container image containing all layers, resulting in electronic devices storing a large amount of duplicate data, this improves the efficiency of storage resource utilization.
[0049] In an optional embodiment, obtaining the first persistent storage volume corresponding to the metric value of the first virtual machine based on the metric value of the first virtual machine includes: Based on the metric value of the first virtual machine, the first persistent storage volume corresponding to the metric value of the first virtual machine is searched in the persistent storage volume pool. The persistent storage volume pool stores one or more persistent storage volumes corresponding to metric values; or If the first persistent storage volume does not exist in the persistent storage volume pool, then the first persistent storage volume corresponding to the metric value of the first virtual machine is created.
[0050] Here, the electronic device maintains a persistent storage volume pool, which stores persistent storage volumes corresponding to one or more metrics. When the metric of the first virtual machine is obtained, the persistent storage volume pool can be traversed based on the metric. If a metric matching the metric of the first virtual machine is found, the persistent storage volume corresponding to that metric is designated as the first persistent storage volume, and the first persistent storage volume can be mounted to the first virtual machine. If no metric matching the metric of the first virtual machine is found in the persistent storage volume pool, indicating that the first persistent storage volume does not exist in the pool, the first persistent storage volume corresponding to the metric of the first virtual machine is created, and the metric of the first virtual machine and the corresponding first persistent storage volume are saved to the persistent storage volume pool.
[0051] The first persistent storage volume corresponding to the metric value of the first virtual machine can include: creating the first persistent storage volume based on the set storage capacity and access mode; the storage capacity and access mode can be understood as the configuration information of the persistent storage volume, which can be determined according to the actual situation and is not limited here.
[0052] Of course, creating the first persistent storage volume corresponding to the metric value of the first virtual machine may also include: the electronic device pre-creating one or more persistent storage volumes based on the set storage capacity and access mode; when there is no first persistent storage volume in the persistent storage volume pool, a persistent volume is selected from the pre-created persistent volumes as the first persistent storage volume corresponding to the metric value of the first virtual machine.
[0053] In practical applications, such as Figure 4 As shown, the step of obtaining the persistent storage volume corresponding to the virtual machine's metric value for each virtual machine can be achieved through PVO in the confidential container creation system. The architecture diagram of the confidential container creation system can be seen as follows: Figure 2 As shown.
[0054] Step 401: Start the virtual machine.
[0055] Step 402: PVO obtains the virtual machine's metrics through KVM.
[0056] Step 403: Determine whether there is a PV in the PV pool that corresponds to the virtual machine's metric value. If yes, proceed to step 404; otherwise, proceed to steps 405 and 406.
[0057] Step 404: Mount an existing PV from the PV pool to the virtual machine.
[0058] Step 405: Create the PV corresponding to the virtual machine's metric.
[0059] Step 406: Mount the created PV to the virtual machine.
[0060] In this embodiment, based on the metric value of the first virtual machine, a first persistent storage volume corresponding to the metric value of the first virtual machine is searched in the persistent storage volume pool. The persistent storage volume pool stores one or more persistent storage volumes corresponding to the metric values. Alternatively, if the first persistent storage volume does not exist in the persistent storage volume pool, a first persistent storage volume corresponding to the metric value of the first virtual machine is created. Thus, if a first persistent storage volume corresponding to the metric value of the first virtual machine exists in the persistent storage volume pool, it indicates that the first persistent storage volume has been used by other virtual machines. The first virtual machine can share the container image data stored in the first persistent storage volume by other virtual machines, and prioritize creating containers based on the container image data in the first persistent storage volume, reducing the time spent repeatedly pulling the same container image data. If a first persistent storage volume corresponding to the metric value of the first virtual machine does not exist in the persistent storage volume pool, a first persistent storage volume corresponding to the metric value of the first virtual machine will be created. The created first persistent storage volume will be stored in the persistent storage volume pool so that other virtual machines with the same metric value can share the container image data in the first persistent storage volume, avoiding the download of duplicate container image data from a remote location when creating containers in other virtual machines, thereby saving resources.
[0061] In an optional embodiment, creating the first container in the first virtual machine based on the container image data stored in the first persistent storage volume includes: Obtain first container image data for creating the first container from the first persistent storage volume; and / or, pull second container image data for creating the first container from the image repository and store the second container image data into the first persistent storage volume; The first container is created in the first virtual machine based on the first container image data and / or the second container image data.
[0062] Here, if the first persistent storage volume stores all the container image data required to create the first container, then all the container image data used to create the first container can be obtained from the first persistent storage volume, and the first container can be created in the first virtual machine based on the obtained container image data; at this time, the first container image data is all the container image data required to create the first container. The step of determining whether the first persistent storage volume contains all the container image data required to create the first container includes: based on the relevant information of the container image data required to create the first container, traversing the relevant information of all container image data stored in the first persistent storage volume; if relevant information consistent with the relevant information of the container image data required to create the first container is found, then it can be determined that the first persistent storage volume contains all the container image data required to create the first container; the relevant information may include image addresses.
[0063] If the first persistent storage volume contains some container image data required to create the first container, the first container image data for creating the first container can be obtained from the first persistent storage volume; second container image data other than the first container image data can be pulled from the image repository; and the first container can be created in the first virtual machine based on the first container image data and the second container image data; the first container image data and the second container image data together constitute all the container image data required to create the first container. The step of determining whether the first persistent storage volume contains only some container image data required to create the first container includes: obtaining an image manifest file of the container image data based on the relevant information of the container image data required to create the first container; the image manifest file contains hash values of all layers of the container image data; obtaining hash values of all layers of the container image data based on the manifest file; for each layer, determining whether the container image data of that layer already exists in the first persistent storage volume based on the hash value; if it exists, the image layer corresponding to the hash value is used as one layer in the first container image data; if it does not exist, the image layer corresponding to the hash value is used as one layer in the second container image data to be pulled from the image repository; wherein, the relevant information may include the image address.
[0064] If the first persistent storage volume does not contain all the container image data required to create the first container, the second container image data for creating the first container can be pulled from the image repository, and the first container can be created in the first virtual machine based on the second container image data; at this time, the second container image data contains all the container image data required to create the first container.
[0065] In this embodiment, first container image data for creating the first container is obtained from the first persistent storage volume; and / or, second container image data for creating the first container is pulled from an image repository and stored in the first persistent storage volume; based on the first container image data and / or the second container image data, the first container is created in the first virtual machine. Thus, when the first persistent storage volume contains all or part of the container image data required to create the first container, prioritizing the reuse of container image data in the persistent volume avoids repeatedly pulling the same container image data from the image repository, thereby saving network bandwidth and storage space, and reducing container creation time; storing the second container image data for creating the first container from the image repository into the first persistent storage volume facilitates subsequent reuse of the second container image data, avoiding the download of duplicate container image data from a remote location when creating containers in other virtual machines, thus saving resources.
[0066] To ensure the security of container image data stored in the persistent storage volume, the persistent storage volume needs to be encrypted. Therefore, in an optional embodiment, after creating the first persistent storage volume corresponding to the metric value of the first virtual machine, the method further includes: Generate the first key within the first virtual machine; The first persistent storage volume is encrypted using the first key; The metric value of the first virtual machine and the first key are associated and hosted in the first Trusted Execution Environment (TEE).
[0067] Here, when creating the first persistent storage volume corresponding to the metric value of the first virtual machine, since this is the first time the first persistent storage volume is created, a key for encrypting the first persistent storage volume needs to be generated. Therefore, the first key is generated within the first virtual machine. In practical applications, the first key can be generated based on the encryption method supported by the first persistent storage volume. For example, the first key can be generated based on a symmetric encryption algorithm, where the symmetric encryption algorithm can be Advanced Encryption Standard (AES), Data Encryption Standard (DES), etc.
[0068] Once a first key is generated, it is used to encrypt the first persistent storage volume. It is understood that encrypting the persistent storage volume prevents unauthorized access, tampering, or leakage of container image data within it.
[0069] In the case of generating the first key, the metric value of the first virtual machine and the first key can also be associated and hosted in the first TEE.
[0070] Associating the first virtual machine's metric value and the first key with a TEE can be implemented in at least two ways: For example, the metric value of the first virtual machine and the corresponding first key are associated and saved to the first TEE. Another example is generating the storage path of the first key using the metric value of the first virtual machine; according to the storage path of the first key, the first key is hosted in the first TEE. The first TEE is used to host the key and includes components such as KBS, KMS, and AS; the first TEE can run on a remote device capable of communicating with electronic devices.
[0071] In practical applications, associating the first virtual machine's metric value and the first key with a TEE can be achieved through SIO in a confidential container creation system. A schematic diagram of the confidential container creation system's architecture can be shown below. Figure 2 As shown.
[0072] In this embodiment, after creating the first persistent storage volume corresponding to the metric value of the first virtual machine, a first key is generated within the first virtual machine; the first key is used to encrypt the first persistent storage volume; and the metric value and the first key of the first virtual machine are associated and hosted on the first TEE. In this way, generating the first key within the first virtual machine prevents the first key from being illegally obtained by the host machine, improving the security of the first key itself; encrypting the first persistent storage volume with the first key prevents unauthorized access, tampering, or leakage of container image data in the persistent storage volume; and through the association between the metric value and the key, it can be ensured that virtual machines with different metric values cannot obtain each other's keys, thereby achieving secure isolation between virtual machines with different metric values.
[0073] In an optional embodiment, before creating the first container in the first virtual machine based on the container image data stored in the first persistent storage volume, the method further includes: When the first virtual machine is started, obtain the first key corresponding to the metric value of the first virtual machine from the first TEE; The first persistent storage volume is decrypted using the first key, and the decrypted first persistent storage volume is mounted to the first virtual machine.
[0074] Here, when the first virtual machine is started, the metric value of the first virtual machine can be obtained; based on the metric value of the first virtual machine, the first persistent storage volume corresponding to the metric value of the first virtual machine is searched in the persistent storage volume pool; if the first persistent storage volume is found, it indicates that the first persistent storage volume is not created for the first time, and the first key corresponding to the metric value of the first virtual machine needs to be obtained from the first TEE.
[0075] With the first TEE storing the measurement value and corresponding first key of the first virtual machine, the electronic device can send the measurement value of the first virtual machine to the first TEE. The Key Management Service (KMS) in the first TEE determines the first key corresponding to the measurement value of the first virtual machine based on the correspondence between the measurement value and the key, and sends the first key to the electronic device or the first virtual machine in the electronic device through the Key Broker Service (KBS) in the first TEE. The first TEE can run on a remote device; that is, the remote device can determine the first key corresponding to the measurement value of the first virtual machine based on the correspondence between the measurement value and the key, and send the first key to the electronic device or the first virtual machine in the electronic device.
[0076] When the storage path of the first key is associated with the metric value of the first virtual machine, the storage path of the first key is generated based on the metric value of the first virtual machine; a second request is sent to the first TEE, the second request being used to obtain the first key corresponding to the metric value of the first virtual machine, the second request carrying at least the storage path of the first key. The Key Management Service (KMS) in the first TEE obtains the first key according to the storage path of the first key, and sends the first key to the electronic device or the first virtual machine in the electronic device through the Key Broker Service (KBS) in the first TEE.
[0077] Once the electronic device obtains the first key, it uses the first key to decrypt the first persistent storage volume; then it mounts the decrypted first persistent storage volume to the first virtual machine.
[0078] In practical applications, obtaining the first key corresponding to the metric value of the first virtual machine from the first TEE can be achieved through the Attestation Agent in the confidential container creation system. The architecture diagram of the confidential container creation system can be shown as follows: Figure 2 As shown.
[0079] In this embodiment, based on the container image data stored in the first persistent storage volume, before creating the first container in the first virtual machine, while the first virtual machine is running, a first key corresponding to the metric value of the first virtual machine is obtained from the first TEE; the first key is used to decrypt the first persistent storage volume, and the decrypted first persistent storage volume is mounted to the first virtual machine. Here, only by obtaining the first key corresponding to the metric value of the first virtual machine can the first persistent storage volume be mounted and the container image data therein be accessed, thus improving the integrity and security of the container image data.
[0080] In an optional embodiment, obtaining the first key corresponding to the metric value of the first virtual machine from the TEE includes: When the first virtual machine is started, first information of the second TEE where the first virtual machine is located is obtained. The first information represents evidence about the origin and current state of the second TEE, and the first information includes the measurement value of the first virtual machine. Transmit the first information to the Key Broker Service (KBS) in the first TEE; The first key returned by the KBS is received; the first key is obtained by the KBS from the Key Management Service (KMS) in the first TEE based on the metric value of the first virtual machine, after the authentication service in the first TEE verifies the first information sent by the KBS.
[0081] Here, when the first virtual machine is started, the electronic device collects first information; the first information represents evidence about the origin and current state of the second TEE where the first virtual machine is located; the evidence may include at least: the virtual machine's measurement value and hardware-related information supporting the TEE, which may include: the TEE's model, the TEE's compatibility information with the host hardware, hardware-level security verification records, etc.; the evidence is used to prove whether the TEE is a trusted confidential execution environment; the second TEE can be understood as the TEE where the first virtual machine is located.
[0082] The electronic device establishes a secure transmission channel with the KBS located in the first TEE and transmits the first information to the KBS through the secure transmission channel; the KBS in the first TEE sends the first information to the authentication service in the first TEE, the authentication service verifies the received first information and sends the verification result to the KBS.
[0083] If the verification result indicates successful verification, the KBS in the first TEE requests the first key from the KMS in the first TEE based on the metric value of the first virtual machine. The KMS receives the request and returns the first key to the KBS. For example, the KBS sends a third request to the KMS, which carries at least the metric value of the first virtual machine. The KMS receives the third request, retrieves the corresponding first key based on the metric value of the first virtual machine in the third request, and returns the first key to the KBS. As another example, the KBS sends a third request to the KMS, which carries at least the metric value of the first virtual machine. The KMS receives the third request, determines the storage path of the first key based on the metric value of the first virtual machine in the third request, retrieves the first key based on the storage path, and returns the first key to the KBS.
[0084] If the KBS in the first TEE receives the first key returned by the KMS in the first TEE, the KBS in the first TEE will return the first key to the electronic device.
[0085] If the verification result indicates that the verification failed, the KBS in the first TEE will return an indication message to the electronic device that the acquisition of the first key failed.
[0086] In practical applications, the electronic device can be a K8s Bare Metal Node.
[0087] The Attestation Agent of the electronic device collects the first information of the second TEE and sends the first information to the KBS running in the first TEE; The KBS in the first TEE sends the first information to the Atttestation Service in the first TEE for verification. If the Atttestation Service in the first TEE verifies the information, the KBS in the first TEE requests the first key from the KMS in the first TEE based on the metric value in the first information. The KMS in the first TEE sends the first key to the Atttestation Agent of the electronic device. The Atttestation Agent forwards the first key to the SIO of the electronic device. The SIO of the electronic device uses the first key to decrypt the first persistent storage volume and mounts the decrypted first persistent storage volume to the first virtual machine.
[0088] Among them, Attestation Agent, SIO and the first virtual machine run in the second TEE of the electronic device; KBS, AS and KMS run in the first TEE of the remote device.
[0089] In this embodiment, when the first virtual machine is started, first information of the second TEE is obtained. This first information represents evidence regarding the origin and current state of the second TEE, and includes a metric value of the first virtual machine. The first information is then transmitted to the Key Broker Service (KBS) in the first TEE. A first key returned by the KBS is received. This first key is obtained by the KBS from the Key Management Service (KMS) in the first TEE based on the metric value of the first virtual machine, provided that the authentication service in the first TEE verifies the first information sent by the KBS. This allows the KMS to centrally store the key, facilitating key management. The first key can only be obtained when the first information of the second TEE containing the first virtual machine is verified by the authentication service. Since the first key cannot be obtained outside the second TEE, even if the first persistent storage volume is held, the container image data within it cannot be tampered with, ensuring the integrity and security of the container image data.
[0090] In practical applications, such as Figure 5 As shown, the step of obtaining the first key corresponding to the metric value of the first virtual machine from the first TEE can be implemented through SIO in the confidential container creation system. The architecture diagram of the confidential container creation system can be seen as follows. Figure 2 As shown. Figure 5 The workflow of SIO in this application is illustrated, including the following steps: Step 501: Determine whether the first persistent storage volume is being used for the first time.
[0091] Here, if the metric value of the first virtual machine does not exist in the persistent storage volume pool, then PVO can determine that the first persistent storage volume is being used for the first time, and SIO can receive the message sent by PVO indicating that the first persistent storage volume is being used for the first time. If it is determined that the first persistent storage volume is being used for the first time, steps 502-506 and 511 are executed. If the metric value of the first virtual machine exists in the persistent storage volume pool, then PVO can determine that the first persistent storage volume is not being used for the first time, and SIO can receive the message sent by PVO indicating that the first persistent storage volume is not being used for the first time. If it is determined that the first persistent storage volume is not being used for the first time, steps 507-511 are executed.
[0092] Step 502: Generate the first key.
[0093] Here, SIO can generate the first key based on a symmetric encryption algorithm.
[0094] Step 503: Encrypt the first persistent storage volume.
[0095] Here, SIO can use the first key to encrypt the first persistent storage volume.
[0096] Step 504: Save the first key to KMS via KBS.
[0097] Here, SIO can generate a storage path for storing the first key based on the metric value of the first virtual machine; SIO establishes a secure transmission channel with KBS and sends the first key and the corresponding storage path to KBS through the secure transmission channel; KBS saves the first key to KMS according to the storage path.
[0098] Step 505: Trigger Image Mgmt to pull the second container image data from the image repository. Here, SIO calls Image Mgmt to pull the second container image data from the image repository. The second container image data can be all or part of the container image data used to create the first container.
[0099] Step 506: Process the second container image data and store it in the first persistent storage volume. Here, SIO can process the second container image data and store it in the first persistent storage volume according to the encryption method of the first persistent storage volume; the encryption method can include full-disk encryption and file-level encryption. For example, when using full-disk encryption, the second container image data can be decompressed and written to the first persistent storage volume, or the second container image data can be written directly to the first persistent storage volume. As another example, when using file-level encryption, the second container image data is encrypted and written to the first persistent volume, where the first key used to encrypt the first persistent storage volume can be used to encrypt the second container image data.
[0100] Step 507: Request the first key from KBS. Here, SIO calls the Attestation Agent to request the first key from KBS.
[0101] Step 508: Decrypt the first persistent storage volume using the first key.
[0102] Step 509: Determine whether the container image data in the first persistent storage volume is all the container image data required to create the first container. If yes, proceed to step 510; otherwise, proceed to step 505.
[0103] Step 510: Reuse the container image data in the first persistent storage volume.
[0104] Step 511: Create and run the first container. Figure 6 A flowchart illustrating another confidential container creation method in this application is shown.
[0105] based on Figure 2 In this application example, the method for creating confidential containers for electronic devices, based on the system architecture, includes the following steps: Step 601: Kata-runtime receives the request to create a Pod and begins creating the Pod Sandbox. Creating the Pod is a sub-step of creating the first container, which runs within a Pod in the Pod Sandbox. The Pod Sandbox can be understood as the first virtual machine.
[0106] Here, Pod is the smallest scheduling unit in Kubernetes; Pod Sandbox is a runtime sandbox that provides an isolated environment for Pod. For ordinary containers, it can be understood as namespace isolation, and for confidential containers, it can be understood as a confidential virtual machine based on TEE.
[0107] In practical applications, users send a request to the kube-apiserver of the Kubernetes cluster to create the first container via kubectl, the console, etc. The kube-scheduler selects one node from all nodes in the cluster as the node to create the first container and informs the kube-apiserver. The kubelet of each node listens to the kube-apiserver to determine whether the first container needs to be created locally.
[0108] When the kubelet on a node receives a request to create the first container, it sends a request to kata-runtime via containerd to create a Pod for the first container; upon receiving the request to create the Pod, kata-runtime begins creating the PodSandbox.
[0109] Step 602: KVM creates and starts the confidential virtual machine corresponding to the underlying TEE based on the kata configuration. The kata configuration can be understood as the core configuration file that defines the runtime parameters of the confidential virtual machine.
[0110] Here, kata-runtime calls KVM to create and start the confidential virtual machine corresponding to the underlying TEE; KVM creates and starts the confidential virtual machine corresponding to the underlying TEE according to the kata configuration.
[0111] Step 603: PVO requests metrics from the virtual machine via KVM. Here, PVO resides in the kata-runtime.
[0112] Step 604: PVO mounts the PV corresponding to the returned metric value to the virtual machine.
[0113] Here, PVO, having obtained the virtual machine's metric value, can iterate through the persistent storage volume pool based on the virtual machine's metric value. If a metric value that matches the virtual machine's metric value is found, the persistent storage volume corresponding to the metric value will be mounted to the virtual machine.
[0114] Step 605: The Kata Agent receives a request to create a container.
[0115] Here, PVO sends a request to the kata Agent to create a container; the kata Agent receives the request to create a container.
[0116] Step 606: The Attestation Agent collects evidence and sends it to KBS.
[0117] Here, SIO, located in the kata Agent, calls the Attestation Agent; the Attestation Agent collects evidence of the TEE where the virtual machine resides and sends it to the KBS.
[0118] Step 607: KBS sends the evidence to Attestation Service for verification.
[0119] Here, the Attestation Agent establishes a secure transmission channel with the KBS and sends evidence to the KBS through the secure transmission channel; the KBS then sends the evidence to the Attestation Service for verification.
[0120] Step 608: After the evidence is verified, KBS requests the first key corresponding to the metric value from KMS based on the metric value in the evidence.
[0121] Here, after the evidence is verified, KBS requests the first key from KMS based on the metric value in the evidence; the first key is the key associated with the metric value and is used to decrypt the persistent storage volume corresponding to the virtual machine.
[0122] Step 609: KBS returns the first key to the Attestation Agent.
[0123] Here, after KBS obtains the first key from KMS, it returns the first key to Attestation Agent.
[0124] Step 610: SIO decrypts PV using the first key.
[0125] Here, the Attestation Agent sends the first key it has obtained to the SIO; the SIO uses the first key to decrypt the PV and mounts the decrypted PV to the virtual machine.
[0126] Step 611: The kata Agent creates and runs a container using the container image data already present in the PV.
[0127] Compared to the image management solution based on containerd remote snapshotter in the COCO community, the solution in this application has the following advantages: 1. The confidential container creation system provided in this application has a simplified architecture and is relatively easy to implement. Community solutions require coordination and modification of multiple open-source components such as containerd, Nydus, and kata. This application only involves modifications to the Image Mgmt module of kata and COCO, resulting in lower implementation complexity.
[0128] 2. The community-based solution is deeply coupled with containerd and cannot be adapted to other container runtimes such as the Container Runtime Interface-Open Container Initiative (CRI-O). The embodiments in this application do not depend on any specific container runtime.
[0129] 3. The embodiments of this application utilize a confidential computing authentication mechanism to manage related keys, which is more flexible.
[0130] 4. In this application, different integrity verification and encryption technologies can be selected to protect the container image data in the PV, and the optimal balance between security and performance can be made according to the actual scenario.
[0131] To implement the confidential container creation method of this application embodiment, this application embodiment also provides a confidential container creation device, which is installed on an electronic device, such as... Figure 7As shown, the device includes: The receiving unit 701 is used to receive a first request sent by the terminal, the first request being used to request the creation of a first container; The acquisition unit 702 is used to acquire the first persistent storage volume corresponding to the metric value of the first virtual machine when the first virtual machine is created and started. One metric value corresponds to one persistent storage volume, and the persistent storage volume is used to store container image data. Creation unit 703 is used to create the first container in the first virtual machine based on the container image data stored in the first persistent storage volume.
[0132] In an optional embodiment, the acquisition unit 702 is further configured to: If the first virtual machine is started, obtain the measurement value of the first virtual machine; Based on the metric value of the first virtual machine, obtain the first persistent storage volume corresponding to the metric value of the first virtual machine.
[0133] In an optional embodiment, the apparatus further includes a processing unit, the processing unit comprising: Based on the metric value of the first virtual machine, the first persistent storage volume corresponding to the metric value of the first virtual machine is searched in the persistent storage volume pool. The persistent storage volume pool stores one or more persistent storage volumes corresponding to metric values; or If the first persistent storage volume does not exist in the persistent storage volume pool, then the first persistent storage volume corresponding to the metric value of the first virtual machine is created.
[0134] In an optional embodiment, the creation unit 703 is further configured to: Obtain first container image data for creating the first container from the first persistent storage volume; and / or, pull second container image data for creating the first container from the image repository and store the second container image data into the first persistent storage volume; The first container is created in the first virtual machine based on the first container image data and / or the second container image data.
[0135] In an optional embodiment, the apparatus further includes an encryption unit, the encryption unit being used for: Generate the first key within the first virtual machine; The first persistent storage volume is encrypted using the first key; The metric value of the first virtual machine and the first key are associated and hosted in the first TEE.
[0136] In an optional embodiment, the device further includes a mounting unit for: When the first virtual machine is started, obtain the first key corresponding to the metric value of the first virtual machine from the first TEE; The first persistent storage volume is decrypted using the first key, and the decrypted first persistent storage volume is mounted to the first virtual machine.
[0137] In an optional embodiment, the encryption unit is further configured to: When the first virtual machine is started, first information of the second TEE where the first virtual machine is located is obtained. The first information represents evidence about the origin and current state of the second TEE, and the first information includes the measurement value of the first virtual machine. Transmit the first information to the Key Broker Service (KBS) in the first TEE; The first key returned by the KBS is received; the first key is obtained by the KBS from the Key Management Service (KMS) in the first TEE based on the metric value of the first virtual machine, after the authentication service in the first TEE verifies the first information sent by the KBS.
[0138] In practical applications, the acquisition unit 702, the creation unit 703, and the processing unit can be implemented by the processor in the confidential container creation device, and the receiving unit 701, the encryption unit, and the mounting unit can be implemented by the processor in the confidential container creation device in combination with the communication interface.
[0139] It should be noted that the confidential container creation apparatus provided in the above embodiments is only illustrated by the division of the above-described program units when creating confidential containers. In practical applications, the above processing can be assigned to different program units as needed, that is, the internal structure of the apparatus can be divided into different program units to complete all or part of the processing described above. In addition, the confidential container creation apparatus and the confidential container creation method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0140] Based on the hardware implementation of the above program units, and in order to implement the method of the embodiments of this application, the embodiments of this application also provide an electronic device, such as... Figure 8 As shown, the electronic device 800 includes: The communication interface 801 is capable of exchanging information with terminals and / or remote devices; The processor 802 is connected to the communication interface 801 to enable information interaction with the terminal and / or remote device, and when running a computer program, executes the methods provided by one or more technical solutions on the electronic device side. The computer program is stored in memory 803.
[0141] Specifically, the communication interface 801 is used to receive a first request sent by the terminal, the first request being used to request the creation of a first container; Processor 802, used for: When the first virtual machine is created and started, the first persistent storage volume corresponding to the metric value of the first virtual machine is obtained. One metric value corresponds to one persistent storage volume, and the persistent storage volume is used to store container image data. The first container is created in the first virtual machine based on the container image data stored in the first persistent storage volume.
[0142] In an optional embodiment, the processor 802 is further configured to: If the first virtual machine is started, obtain the measurement value of the first virtual machine; Based on the metric value of the first virtual machine, obtain the first persistent storage volume corresponding to the metric value of the first virtual machine.
[0143] In an optional embodiment, the processor 802 is further configured to: Based on the metric value of the first virtual machine, the first persistent storage volume corresponding to the metric value of the first virtual machine is searched in the persistent storage volume pool. The persistent storage volume pool stores one or more persistent storage volumes corresponding to metric values; or If the first persistent storage volume does not exist in the persistent storage volume pool, then the first persistent storage volume corresponding to the metric value of the first virtual machine is created.
[0144] In an optional embodiment, the processor 802 is further configured to: Obtain first container image data for creating the first container from the first persistent storage volume; and / or, pull second container image data for creating the first container from the image repository and store the second container image data into the first persistent storage volume; The first container is created in the first virtual machine based on the first container image data and / or the second container image data.
[0145] In an optional embodiment, the processor 802 is further configured to: Generate the first key within the first virtual machine; The first persistent storage volume is encrypted using the first key; The communication interface 801 is also used to associate the metric value of the first virtual machine and the first key with the first TEE.
[0146] In an optional embodiment, the communication interface 801 is further configured to obtain a first key corresponding to the metric value of the first virtual machine from the first TEE when the first virtual machine is started. The processor 802 is further configured to decrypt the first persistent storage volume using the first key, and mount the decrypted first persistent storage volume to the first virtual machine.
[0147] In an optional embodiment, the processor 802 is further configured to, when the first virtual machine is started, obtain first information about the second TEE where the first virtual machine is located, the first information representing evidence about the origin and current state of the second TEE, the first information including a metric value of the first virtual machine; The communication interface 801 is also used to transmit the first information to the key broker service KBS in the first TEE; The first key returned by the KBS is received; the first key is obtained by the KBS from the Key Management Service (KMS) in the first TEE based on the metric value of the first virtual machine, after the authentication service in the first TEE verifies the first information sent by the KBS.
[0148] Of course, in practical applications, the various components in electronic device 800 are coupled together through bus system 804. It can be understood that bus system 804 is used to realize the connection and communication between these components. In addition to a data bus, bus system 804 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in... Figure 8 The general labeled all buses as Bus System 804.
[0149] The memory 803 in this embodiment is used to store various types of data to support the operation of the electronic device 800. Examples of such data include any computer program used to operate on the electronic device 800.
[0150] The methods disclosed in the embodiments of this application can be applied to, or implemented by, the processor 802. The processor 802 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by the integrated logic circuitry of the hardware in the processor 802 or by instructions in software form. The processor 802 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 802 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, specifically in memory 803. The processor 802 reads information from memory 803 and, in conjunction with its hardware, completes the steps of the aforementioned method.
[0151] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned method.
[0152] It is understood that the memory 803 in this embodiment can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memories described in the embodiments of this application are intended to include, but are not limited to, these and any other suitable types of memories.
[0153] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a memory 803 storing a computer program, which can be executed by the processor 802 of the electronic device 800 to complete the steps described in the aforementioned method. The computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.
[0154] For example, embodiments of this application also provide a computer program product, including a computer program that can be executed by a processor 802 of an electronic device 800 to perform the steps described in the foregoing method.
[0155] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. A method of creating a confidential container, characterized by, The method includes: The receiving terminal sends a first request, which is used to request the creation of a first container; When the first virtual machine is created and started, the first persistent storage volume corresponding to the metric value of the first virtual machine is obtained. One metric value corresponds to one persistent storage volume, and the persistent storage volume is used to store container image data. The first container is created in the first virtual machine based on the container image data stored in the first persistent storage volume.
2. The method of claim 1, wherein, The step of obtaining the first persistent storage volume corresponding to the metric value of the first virtual machine includes: If the first virtual machine is started, obtain the measurement value of the first virtual machine; Based on the metric value of the first virtual machine, obtain the first persistent storage volume corresponding to the metric value of the first virtual machine.
3. The method of claim 2, wherein, The step of obtaining the first persistent storage volume corresponding to the metric value of the first virtual machine based on the metric value of the first virtual machine includes: Based on the metric value of the first virtual machine, the first persistent storage volume corresponding to the metric value of the first virtual machine is searched in the persistent storage volume pool. The persistent storage volume pool stores one or more persistent storage volumes corresponding to metric values; or If the first persistent storage volume does not exist in the persistent storage volume pool, then the first persistent storage volume corresponding to the metric value of the first virtual machine is created.
4. The method of claim 1, wherein, The step of creating the first container in the first virtual machine based on the container image data stored in the first persistent storage volume includes: Obtain first container image data for creating the first container from the first persistent storage volume; and / or, pull second container image data for creating the first container from the image repository and store the second container image data into the first persistent storage volume; The first container is created in the first virtual machine based on the first container image data and / or the second container image data.
5. The method of claim 3, wherein, After creating the first persistent storage volume corresponding to the metric value of the first virtual machine, the method further includes: Generate the first key within the first virtual machine; The first persistent storage volume is encrypted using the first key; The metric value of the first virtual machine and the first key are associated and hosted in the first Trusted Execution Environment (TEE).
6. The method according to any one of claims 1 to 5, characterized in that, Before creating the first container in the first virtual machine based on the container image data stored in the first persistent storage volume, the method further includes: When the first virtual machine is started, obtain the first key corresponding to the metric value of the first virtual machine from the first TEE; The first persistent storage volume is decrypted using the first key, and the decrypted first persistent storage volume is mounted to the first virtual machine.
7. The method of claim 6, wherein, The step of obtaining the first key corresponding to the metric value of the first virtual machine from the first TEE includes: When the first virtual machine is started, first information of the second TEE where the first virtual machine is located is obtained. The first information represents evidence about the origin and current state of the second TEE, and the first information includes the measurement value of the first virtual machine. Transmit the first information to the Key Broker Service (KBS) in the first TEE; The first key returned by the KBS is received; the first key is obtained by the KBS from the Key Management Service (KMS) in the first TEE based on the metric value of the first virtual machine, after the authentication service in the first TEE verifies the first information sent by the KBS.
8. An electronic device, comprising: This includes a processor and memory for storing computer programs that can run on the processor. When the processor is used to run the computer program, it performs the steps of the method according to any one of claims 1 to 7.
9. A storage medium having stored thereon a computer program, characterized in that When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer program product comprising a computer program or computer-executable instructions, characterized in that, When the computer program or computer-executable instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 7.