A method for creating an encrypted disk, a method for persistently storing data, and a device

By creating encrypted disk blocks in the TEE's Guest VM and implementing Luks encrypted disk blocks using the cryptsetup tool and the dm-crypt kernel module, the data security and volatility issues in large model applications are resolved, and data persistent storage and security are improved.

CN120449219BActive Publication Date: 2025-09-26HUAKONG TSINGJIAO INFORMATION SCI BEIJING LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510947337.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-09-26
Estimated Expiration
2045-07-09

AI Technical Summary

Technical Problem

The existing technology has low data security for large model applications and data storage volatility issues, especially in cloud-native deployment environments where shared storage is prone to theft. TEE confidential container technology has memory capacity limitations and storage volatility issues.

Method used

Deploy a confidential container in the TEE's Guest VM, create a virtual disk block in the disk block directory by starting the module, use the key management service to obtain the device access key to encrypt the data encryption master key, and store it in the disk block header. Use the cryptsetup tool and the dm-crypt kernel module to implement the creation of Luks encrypted disk blocks and data persistent storage.

Benefits of technology

It realizes persistent data storage based on TEE confidential container, improves the security and reliability of data storage, prevents data loss when the confidential container is restarted, and enhances the security of data storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120449219B_ABST
    Figure CN120449219B_ABST
Patent Text Reader

Abstract

The present application discloses a method for creating an encrypted disk, a method for persistent data storage, and a device, which relate to the fields of multi-party secure computing technology and privacy computing technology, including: creating a virtual disk block in the disk block directory of the disk block mounted on the confidential container; obtaining the device access key from the KMS module, the KMS module is located in another confidential container, and the other confidential container is located in another Guest VM of the TEE; encrypting the generated data encryption master key based on the device access key, and storing the encrypted data encryption master key ciphertext in the disk block header of the disk block to obtain an encrypted disk block; using the device access key, decrypting the data encryption master key ciphertext read from the disk block header of the encrypted disk block to obtain the data encryption master key, and loading it into the memory. By adopting this solution, data persistent storage based on the TEE confidential container is realized, and data persistent storage in the encrypted disk block is realized, thereby improving the security of data storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of multi-party secure computing technology and privacy computing technology, and in particular to a method for creating an encrypted disk for a confidential container, and a method and device for persistent data storage. Background Art

[0002] Large language models (LLMs) and their applications in artificial intelligence have become a global research hotspot. Large language models are deep learning models trained on massive amounts of text data. They not only generate natural language text but also deeply understand its meaning and handle various natural language tasks, such as text summarization, question-answering, and translation. Integrating large models with their businesses has become a social trend for various companies.

[0003] However, with the rapid evolution of large-scale model technology, the scale of its parameters continues to increase, and the size of models and the number of training operations continue to climb. Enterprises face severe hardware resource costs and data security risks when applying large models. For example, traditional cloud-native deployment environments can use shared storage to solve problems such as loading large model files and massive training data, and persisting training results. However, this shared storage approach is easily accessible to theft and access, and data security is not protected.

[0004] Although TEE (Trusted Execution Environment) confidential container technology can be used to protect large model training and inference processes, confidential container technology is a hardware isolation method based on memory encryption, which also has memory capacity limitations and storage volatility issues. Summary of the Invention

[0005] The embodiments of the present application provide an encrypted disk creation method, a data persistent storage method and device, to solve the problems of low data security and volatility of data storage for large model applications in the prior art.

[0006] An embodiment of the present application provides a method for creating an encrypted disk for a confidential container, which is applied to a startup module of a confidential container. The confidential container is located in a guest VM of a trusted execution environment (TEE). The method includes:

[0007] Create a virtual disk block in the disk block directory of the disk block mounted by the confidential container;

[0008] Obtain the device access key from the Key Management Service (KMS) module, which is located in another confidential container in another guest VM of the TEE.

[0009] Encrypting the generated data encryption master key based on the device access key, and storing the encrypted data encryption master key ciphertext in the disk block header of the disk block to obtain an encrypted disk block;

[0010] The device access key is used to decrypt the data encryption master key ciphertext read from the disk block header of the encrypted disk block to obtain the data encryption master key and load it into the memory.

[0011] Furthermore, the confidential container to which the startup module belongs is installed with a cryptsetup tool, and the kernel of the Guest VM in which the confidential container is located has a dm-crypt kernel module;

[0012] The method of encrypting the data encryption master key generated based on the device access key and storing the encrypted data encryption master key ciphertext in the disk block header of the disk block to obtain an encrypted disk block includes:

[0013] Initializing the disk block by inputting the device access key into the cryptsetup tool, so that the cryptsetup tool calls the dm-crypt kernel module to randomly generate a data encryption master key, the dm-crypt kernel module encrypts the generated data encryption master key using the device access key, and stores the encrypted data encryption master key ciphertext in the disk block header of the disk block, thereby obtaining a Luks encrypted disk block;

[0014] The method of using the device access key to decrypt the data encryption master key ciphertext read from the disk block header of the encrypted disk block to obtain the data encryption master key and load the key into the memory includes:

[0015] The Luks encrypted disk block is unlocked by inputting the device access key into the cryptsetup tool, so that the cryptsetup tool calls the dm-crypt kernel module to read the data encryption master key ciphertext from the disk block header of the Luks encrypted disk block, uses the device access key to decrypt the data encryption master key ciphertext, obtains the data encryption master key, and loads it into the memory.

[0016] Furthermore, it also includes:

[0017] Initialize the file system of the Luks encrypted disk block to a format that can be recognized by the operating system;

[0018] The initialized file system of the Luks encrypted disk block is mounted to the file directory of the operating system.

[0019] Furthermore, it also includes:

[0020] Notify the large model in the confidential container of the directory location of the Luks encrypted disk blocks.

[0021] An embodiment of the present application further provides a data persistence storage method for a confidential container, which is applied to a large model application in a confidential container. The confidential container is located in a guest VM of a trusted execution environment (TEE). The confidential container is mounted with an encrypted disk block. The disk block header of the encrypted disk block stores a data encryption master key ciphertext. The data encryption master key ciphertext is obtained by encrypting a generated data encryption master key using a device access key. The device access key is obtained from a key management service (KMS) module. The KMS module is located in another confidential container. The other confidential container is located in another guest VM of the TEE. The data encryption master key is loaded into memory. The method includes:

[0022] Get the file data to be stored;

[0023] Encrypting the file data in the memory using the data encryption master key, and storing the obtained file data ciphertext in the encrypted disk block;

[0024] The file data ciphertext is read from the encrypted disk block, and the file data ciphertext is decrypted in the memory using the data encryption master key to obtain the decrypted file data.

[0025] Furthermore, the kernel of the Guest VM where the confidential container is located has a dm-crypt kernel module, and the encrypted disk block is a Luks encrypted disk block;

[0026] The step of encrypting the file data in the memory using the data encryption master key and storing the obtained ciphertext of the file data in the encrypted disk block includes:

[0027] Based on the known directory location of the Luks encrypted disk block, executing an operation of writing the file data into the directory of the Luks encrypted disk block, so that the dm-crypt kernel module encrypts the file data using the data encryption master key in the memory and stores the obtained ciphertext of the file data into the Luks encrypted disk block;

[0028] The step of reading the file data ciphertext from the encrypted disk block and decrypting the file data ciphertext in the memory using the data encryption master key to obtain the decrypted file data includes:

[0029] Based on the known directory location of the Luks encrypted disk block, an operation of reading the file data from the directory of the Luks encrypted disk block is performed, so that the dm-crypt kernel module reads the file data ciphertext from the Luks encrypted disk block, and decrypts the file data ciphertext in the memory using the data encryption master key to obtain the decrypted file data.

[0030] The present application also provides an encrypted disk creation device for a confidential container, which is applied to a startup module of a confidential container. The confidential container is located in a guest VM of a trusted execution environment (TEE). The device includes:

[0031] a virtual disk creation unit, configured to create a virtual disk block in a disk block directory of a disk block mounted on the confidential container;

[0032] A key acquisition unit, configured to acquire a device access key from a key management service (KMS) module, wherein the KMS module is located in another confidential container, which is located in another guest VM of the TEE;

[0033] a key encryption unit, configured to encrypt a data encryption master key generated based on the device access key, and store the encrypted data encryption master key ciphertext in a disk block header of the disk block to obtain an encrypted disk block;

[0034] A key loading unit is used to use the device access key to decrypt the data encryption master key ciphertext read from the disk block header of the encrypted disk block, obtain the data encryption master key, and load it into the memory.

[0035] Furthermore, the confidential container to which the startup module belongs is installed with a cryptsetup tool, and the kernel of the Guest VM in which the confidential container is located has a dm-crypt kernel module;

[0036] The key encryption unit is specifically configured to initialize the disk block by inputting the device access key into the cryptsetup tool, so that the cryptsetup tool calls the dm-crypt kernel module to randomly generate a data encryption master key, the dm-crypt kernel module encrypts the generated data encryption master key using the device access key, and stores the encrypted data encryption master key ciphertext in the disk block header of the disk block to obtain a Luks encrypted disk block;

[0037] The key loading unit is specifically used to unlock the Luks encrypted disk block by inputting the device access key into the cryptsetup tool, so that the cryptsetup tool calls the dm-crypt kernel module to read the data encryption master key ciphertext from the disk block header of the Luks encrypted disk block, decrypt the data encryption master key ciphertext using the device access key, obtain the data encryption master key, and load it into the memory.

[0038] Furthermore, it also includes:

[0039] A file system processing unit is used to initialize the file system of the Luks encrypted disk block into a format recognizable by the operating system; and mount the initialized file system of the Luks encrypted disk block to a file directory of the operating system.

[0040] Furthermore, it also includes:

[0041] A directory location notification unit is used to notify the large model in the confidential container of the directory location of the Luks encrypted disk block.

[0042] An embodiment of the present application further provides a data persistent storage device for a confidential container, which is applied to a large model application in a confidential container. The confidential container is located in a guest VM of a trusted execution environment (TEE). The confidential container is mounted with an encrypted disk block. The disk block header of the encrypted disk block stores a data encryption master key ciphertext. The data encryption master key ciphertext is obtained by encrypting a generated data encryption master key using a device access key. The device access key is obtained from a key management service (KMS) module. The KMS module is located in another confidential container. The other confidential container is located in another guest VM of the TEE. The data encryption master key is loaded into memory. The device includes:

[0043] A data acquisition unit, used to acquire file data to be stored;

[0044] a data encryption unit, configured to encrypt the file data in a memory using the data encryption master key, and store the obtained ciphertext of the file data in the encrypted disk block;

[0045] The data decryption unit is used to read the file data ciphertext from the encrypted disk block and decrypt the file data ciphertext in the memory using the data encryption master key to obtain the decrypted file data.

[0046] Furthermore, the kernel of the Guest VM where the confidential container is located has a dm-crypt kernel module, and the encrypted disk block is a Luks encrypted disk block;

[0047] The data encryption unit is specifically configured to write the file data into the directory of the Luks encrypted disk block based on the directory location of the Luks encrypted disk block, so that the dm-crypt kernel module encrypts the file data in the memory using the data encryption master key, and stores the obtained ciphertext of the file data into the Luks encrypted disk block;

[0048] The data decryption unit is specifically used to execute the operation of reading the file data from the directory of the Luks encrypted disk block based on the known directory location of the Luks encrypted disk block, so that the dm-crypt kernel module reads the file data ciphertext from the Luks encrypted disk block, and decrypts the file data ciphertext in the memory using the data encryption master key to obtain the decrypted file data.

[0049] An embodiment of the present application also provides an electronic device, including a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to: implement any of the above-mentioned methods for creating an encrypted disk for a confidential container, or implement any of the above-mentioned methods for persistent data storage of a confidential container.

[0050] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements any of the above-mentioned methods for creating an encrypted disk for a confidential container, or implements any of the above-mentioned methods for persistent data storage of a confidential container.

[0051] An embodiment of the present application also provides a computer program product containing instructions, which, when run on a computer, enables the computer to execute any of the above-mentioned methods for creating an encrypted disk for a confidential container, or execute any of the above-mentioned methods for persistent data storage of a confidential container.

[0052] The beneficial effects of this application include:

[0053] In the method provided by the embodiment of the present application, a confidential container is deployed in the guest VM of the TEE. During the startup of the confidential container, a startup module creates a virtual disk block in the disk block directory of the mounted disk block, obtains a device access key from the KMS module, encrypts the generated data encryption master key based on the device access key, and stores the encrypted data encryption master key ciphertext in the disk block header of the disk block to obtain an encrypted disk block. The device access key is used to decrypt the data encryption master key ciphertext read from the disk block header of the encrypted disk block to obtain the data encryption master key, which is loaded into the memory to achieve the creation of an encrypted disk. When the large model application in the confidential container needs to persist file data, the file data is encrypted in the memory using the data encryption master key, and the obtained file data ciphertext is stored in the encrypted disk block. When the stored file data needs to be read, the file data ciphertext is read from the encrypted disk block and decrypted in the memory using the data encryption master key to obtain the decrypted file data. This achieves data persistent storage based on the TEE confidential container and persistent data storage in the encrypted disk block, improving the security of data storage.

[0054] Other features and advantages of the present application will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present application. The purposes and other advantages of the present application can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The accompanying drawings are used to provide a further understanding of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings:

[0056] Figure 1 A flowchart of a method for creating an encrypted disk for a confidential container provided in an embodiment of the present application;

[0057] Figure 2 A flowchart of a data persistent storage method for a confidential container provided in an embodiment of the present application;

[0058] Figure 3 This is a system architecture diagram for implementing the encrypted disk creation method and data persistent storage method in the embodiments of the present application;

[0059] Figure 4 A flowchart of a method for creating an encrypted disk for a confidential container provided in another embodiment of the present application;

[0060] Figure 5 A flowchart of a method for persistent data storage of a confidential container provided in another embodiment of the present application;

[0061] Figure 6 A schematic diagram of the structure of an apparatus for creating an encrypted disk for a confidential container provided in an embodiment of the present application;

[0062] Figure 7 A schematic diagram of the structure of an encrypted disk creation device for a confidential container provided in another embodiment of the present application;

[0063] Figure 8 A schematic diagram of the structure of a data persistent storage device for a confidential container provided in an embodiment of the present application;

[0064] Figure 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0065] In order to provide an implementation scheme for improving data storage security and data persistence for large model applications, the embodiments of the present application provide a method for creating an encrypted disk, a method for persistent data storage, and an apparatus. The preferred embodiments of the present application are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application and are not intended to limit the present application. Furthermore, the embodiments and features of the embodiments of the present application may be combined with each other unless they conflict.

[0066] The embodiment of the present application provides a method for creating an encrypted disk of a confidential container, which is applied to the startup module of the confidential container. The confidential container is located in the Guest VM (customer virtual machine) of the TEE, such as Figure 1 As shown, including:

[0067] Step 11: Create a virtual disk block in the disk block directory of the disk block mounted by the confidential container;

[0068] Step 12: Get the device access key from the KMS (Key Management Service) module. The KMS module is located in another confidential container, which is located in another guest VM of the TEE.

[0069] Step 13: Encrypt the generated data encryption master key based on the device access key, and store the encrypted data encryption master key ciphertext in the disk block header of the disk block to obtain an encrypted disk block;

[0070] Step 14: Use the device access key to decrypt the data encryption master key ciphertext read from the disk block header of the encrypted disk block to obtain the data encryption master key and load it into the memory.

[0071] Correspondingly, the embodiment of the present application also provides a data persistence storage method for a confidential container, which is applied to a large model application in a confidential container. The confidential container is located in the Guest VM of the TEE. The confidential container is mounted with an encrypted disk block. The disk block header of the encrypted disk block stores a data encryption master key ciphertext. The data encryption master key ciphertext is obtained by encrypting the generated data encryption master key using the device access key. The device access key is obtained from the KMS module. The KMS module is located in another confidential container. The other confidential container is located in another Guest VM of the TEE. The data encryption master key is loaded into the memory, such as Figure 2 As shown, including:

[0072] Step 21: Obtain the file data to be stored;

[0073] Step 22: Encrypt the file data in the memory using the data encryption master key, and store the obtained file data ciphertext in the encrypted disk block;

[0074] Step 23: Read the file data ciphertext from the encrypted disk block, and decrypt the file data ciphertext in the memory using the data encryption master key to obtain the decrypted file data.

[0075] Using the above method provided by the embodiment of the present application, a confidential container is deployed in the Guest VM of the TEE. During the startup of the confidential container, a virtual disk block is created in the disk block directory of the mounted disk block by the startup module, the device access key is obtained from the KMS module, the generated data encryption master key is encrypted based on the device access key, and the encrypted data encryption master key ciphertext is stored in the disk block header of the disk block to obtain an encrypted disk block, and the device access key is used to decrypt the data encryption master key ciphertext read from the disk block header of the encrypted disk block to obtain the data encryption master key and load it into the memory to achieve the creation of an encrypted disk. When the large model application in the confidential container needs to persist file data, the file data is encrypted in the memory using the data encryption master key, and the obtained file data ciphertext is stored in the encrypted disk block. When the stored file data needs to be read, the file data ciphertext is read from the encrypted disk block and the file data ciphertext is decrypted in the memory using the data encryption master key to obtain the decrypted file data. Thus, data persistent storage based on the TEE confidential container is achieved, and data persistent storage in the encrypted disk block is achieved, thereby improving the security of data storage.

[0076] In addition, the startup module and the large model application are located in the same confidential container, the KMS module is located in another confidential container, and these two confidential containers are located in different Guest VMs. Different Guest VMs have different kernels, which further improves the security of data storage.

[0077] The method provided in this application is described in detail below with reference to specific embodiments in conjunction with the accompanying drawings.

[0078] The system architecture of the embodiment of the present application is implemented as follows: Figure 3 As shown, a TEE (Trusted Execution Environment) is deployed on the host machine, and at least two Guest VMs (Customer Virtual Machines) are deployed in the TEE. The two Guest VMs each have an independent kernel and are independent of the host kernel. A confidential container is deployed in each of the two Guest VMs.

[0079] like Figure 3 As shown, one of the confidential containers has a startup module for creating an encrypted disk after the confidential container is started. Furthermore, in order to create Luks encrypted disk blocks, the confidential container is also installed with a cryptsetup tool, and the kernel of the Guest VM where the confidential container is located is also deployed with a dm-crypt kernel module. After completing the creation of the encrypted disk, the startup module can also start a large model application in the confidential container. The large model application can be a large model training application or a large model inference application. The large model application can realize persistent storage of data in the Luks encrypted disk block through the dm-crypt kernel module.

[0080] Luks (Linux Unified Key Setup) is a disk encryption technology widely used in Linux systems. It allows users to encrypt storage devices (such as hard disk partitions or entire disks) to improve data security. It is a disk encryption standard based on the dm-crypt kernel module in Linux systems.

[0081] The dm-crypt kernel module is a block device encryption tool provided by the Linux kernel. It protects disk data security through transparent encryption technology. Its front-end cryptsetup tool simplifies the creation and management of encrypted devices.

[0082] Cryptsetup is a disk encryption tool for Linux systems. It implements transparent encryption based on the dm-crypt kernel module. It supports the Luks standardized encryption format and can protect disks, partitions, or virtual disk files with passwords or key files.

[0083] like Figure 3As shown, a KMS module is deployed in another confidential container, which is directly connected to the TPM (Trusted Platform Module) hardware, thereby realizing the management of the keys in the TPM hardware. In the embodiment of the present application, the KMS module can request the device access key ack from the TPM hardware and inform the startup module of the device access key ack through a secure channel with the startup module, wherein the device access key ack can be a derived key generated by confusing the hardware trusted root with the confidential container ID, thereby preventing unauthenticated access.

[0084] Based on the above Figure 3 The system architecture shown in the embodiment of the present application provides a method for creating an encrypted disk of a confidential container, such as Figure 4 As shown, including:

[0085] Step 41: When the confidential container is started, the startup module creates a virtual disk block in the disk block directory of the disk block mounted by the confidential container.

[0086] Step 42: The startup module requests to obtain the device access key ack from the KMS module.

[0087] Step 43: After receiving the request sent by the startup module, the KMS module obtains the device access key ack from the TPM hardware directly connected to the confidential container. The device access key ack can be a derived key generated by the TPM hardware based on the hardware trusted root and the confidential container ID of the confidential container.

[0088] After obtaining the device access key ack, the KMS module sends the device access key ack to the startup module through the secure channel between the KMS module and the startup module, thereby improving the security of the device access key ack transmission.

[0089] Step 44 : After obtaining the device access key ack, the startup module initializes the disk block by inputting the device access key ack into the cryptsetup tool.

[0090] This step triggers the cryptsetup tool to call the dm-crypt kernel module to execute step 45 below.

[0091] Step 45: The dm-crypt kernel module performs disk encryption operations.

[0092] Specifically, in this step, the dm-crypt kernel module randomly generates a data encryption master key mk, encrypts the generated data encryption master key mk using the device access key ack, and stores the encrypted data encryption master key ciphertext mk` in the disk block header of the disk block to obtain the Luks encrypted disk block.

[0093] Step 46: The startup module unlocks the Luks encrypted disk block by inputting the device access key ack into the cryptsetup tool.

[0094] This step triggers the cryptsetup tool to call the dm-crypt kernel module to execute step 47 below.

[0095] Step 47: The dm-crypt kernel module reads the data encryption master key ciphertext mk` from the disk block header of the Luks encrypted disk block, decrypts the data encryption master key ciphertext mk` using the device access key ack, obtains the data encryption master key mk, and loads the data encryption master key mk into memory.

[0096] After the Luks encrypted disk block is created through the above steps 41 to 47, in order to subsequently implement persistent data storage, the following steps may be further included:

[0097] Step 48: The startup module initializes the file system of the Luks encrypted disk block to a format that can be recognized by the operating system.

[0098] Step 49: The startup module mounts the initialized Luks encrypted disk block file system to the file directory of the operating system.

[0099] Step 410: The startup module notifies the large model in the confidential container of the directory location of the Luks encrypted disk block.

[0100] In an embodiment of the present application, the large model application located in the same confidential container as the startup module can be started by the startup module.

[0101] Based on the above Figure 4 After the method shown creates an encrypted disk, the embodiment of the present application also provides a data persistent storage method for a confidential container, such as Figure 5 As shown, including:

[0102] Step 51: The large model application obtains the file data to be stored.

[0103] The file data to be stored is data generated during the operation of a large model application, or received data. Whether it needs to be persistently stored in an encrypted disk can be flexibly selected based on the actual application needs.

[0104] Step 52: The large model application executes an operation of writing the file data into the directory of the Luks encrypted disk block based on the known directory location of the Luks encrypted disk block.

[0105] This step will trigger the dm-crypt kernel module to execute the following step 53.

[0106] Step 53: The dm-crypt kernel module uses the data encryption master key mk in the memory to encrypt the file data, and stores the obtained file data ciphertext in the Luks encrypted disk block.

[0107] Step 54: When data needs to be read from the Luks encrypted disk block, the large model application performs an operation of reading file data from the directory of the Luks encrypted disk block based on the known directory location of the Luks encrypted disk block.

[0108] This step will trigger the dm-crypt kernel module to execute the following step 55.

[0109] Step 55: The dm-crypt kernel module reads the file data ciphertext from the Luks encrypted disk block and decrypts the file data ciphertext using the data encryption master key mk in the memory to obtain the decrypted file data.

[0110] Using the above-mentioned embodiment provided in this application Figure 4 and Figure 5 The method shown in the figure can normally access the file system of the encrypted disk within the confidential container, but outside the confidential container, only the virtual disk files can be seen. Since there is no access key to the encrypted disk (i.e., the device access key ack), there is no permission to access its internal file system, and it is impossible to steal data. This improves the security of data storage on the basis of being able to store data persistently. In addition, compared with storing data in memory, the storage space of the encrypted disk is larger and more convenient to use.

[0111] In this embodiment of the present application, multiple confidential containers can be deployed on the same cloud server with a trusted execution environment, and different model applications can be deployed on different confidential containers. The trusted execution environment's confidential containers prohibit any access to the container, and the cloud server's IT administrators / operators have no access to the data, models, and code in the confidential containers.

[0112] In the embodiments of the present application, information and data can be exchanged between the cloud server and the client, between the cloud server and the model provider, and between different confidential containers through secure channels. Different secure channels use different session keys. The memory of the confidential container is hardware-encrypted and isolated. Moreover, the client or model provider outside the cloud server can verify whether the confidential container is running in a trusted execution environment through remote authentication, thereby further improving the security of data persistence storage for large model applications.

[0113] Thanks to persistent storage, even if the confidential container is restarted, the archived model training parameters, gradients, and other information can still be read to continue model training. Model aggregation results can also be persistently stored on encrypted disk to prevent the loss of trained models due to confidential container restarts.

[0114] Similarly, you can load the data and model required for model inference into a confidential container, complete model inference within the container, and persist information such as inference session records during the inference process to an encrypted disk to prevent loss of inference session records due to an abnormal restart of the confidential container. Even after the confidential container restarts, you can read the stored inference session records to quickly restore the session and continue the previous inference.

[0115] Based on the same inventive concept, according to the method for creating an encrypted disk for a confidential container provided in the above embodiment of the present application, another embodiment of the present application also provides an encrypted disk creation device for a confidential container, which is applied to the startup module of the confidential container. The confidential container is located in the guest VM of the trusted execution environment TEE, and its structural diagram is as shown in FIG. Figure 6 As shown, specifically including:

[0116] A virtual disk creation unit 61 is configured to create a virtual disk block in a disk block directory of a disk block mounted on the confidential container;

[0117] A key acquisition unit 62 is configured to acquire a device access key from a key management service (KMS) module, where the KMS module is located in another confidential container, which is located in another guest VM of the TEE.

[0118] a key encryption unit 63 configured to encrypt the generated data encryption master key based on the device access key, and store the encrypted data encryption master key ciphertext in the disk block header of the disk block to obtain an encrypted disk block;

[0119] The key loading unit 64 is configured to use the device access key to decrypt the data encryption master key ciphertext read from the disk block header of the encrypted disk block, obtain the data encryption master key, and load the key into the memory.

[0120] Furthermore, the confidential container to which the startup module belongs is installed with a cryptsetup tool, and the kernel of the Guest VM in which the confidential container is located has a dm-crypt kernel module;

[0121] The key encryption unit is specifically configured to initialize the disk block by inputting the device access key into the cryptsetup tool, so that the cryptsetup tool calls the dm-crypt kernel module to randomly generate a data encryption master key, the dm-crypt kernel module encrypts the generated data encryption master key using the device access key, and stores the encrypted data encryption master key ciphertext in the disk block header of the disk block to obtain a Luks encrypted disk block;

[0122] The key loading unit is specifically used to unlock the Luks encrypted disk block by inputting the device access key into the cryptsetup tool, so that the cryptsetup tool calls the dm-crypt kernel module to read the data encryption master key ciphertext from the disk block header of the Luks encrypted disk block, decrypt the data encryption master key ciphertext using the device access key, obtain the data encryption master key, and load it into the memory.

[0123] Further, such as Figure 7 As shown, it may also include:

[0124] The file system processing unit 65 is configured to initialize the file system of the Luks encrypted disk block into a format recognizable by the operating system; and to mount the initialized file system of the Luks encrypted disk block to a file directory of the operating system.

[0125] Further, such as Figure 7 As shown, it may also include:

[0126] The directory location notification unit 66 is used to notify the large model in the confidential container of the directory location of the Luks encrypted disk block.

[0127] Based on the same inventive concept, according to the data persistence storage method of the confidential container provided in the above embodiment of the present application, accordingly, another embodiment of the present application also provides a data persistence storage device for a confidential container, which is applied to a large model application in a confidential container, and the confidential container is located in the client virtual machine Guest VM of the trusted execution environment TEE, and the confidential container is mounted with an encrypted disk block, and the disk block header of the encrypted disk block stores a data encryption master key ciphertext, and the data encryption master key ciphertext is obtained by encrypting the generated data encryption master key using the device access key, and the device access key is obtained from the key management service KMS module, and the KMS module is located in another confidential container, and the other confidential container is located in another Guest VM of the TEE, and the data encryption master key is loaded into the memory, and its structural diagram is as shown in the figure. Figure 8 As shown, specifically including:

[0128] A data acquisition unit 81 is used to acquire file data to be stored;

[0129] A data encryption unit 82 is configured to encrypt the file data in a memory using the data encryption master key and store the obtained ciphertext of the file data in the encrypted disk block;

[0130] The data decryption unit 83 is configured to read the file data ciphertext from the encrypted disk block and decrypt the file data ciphertext using the data encryption master key in the memory to obtain the decrypted file data.

[0131] Furthermore, the kernel of the Guest VM where the confidential container is located has a dm-crypt kernel module, and the encrypted disk block is a Luks encrypted disk block;

[0132] The data encryption unit 82 is specifically configured to write the file data into the directory of the Luks encrypted disk block based on the directory location of the Luks encrypted disk block, so that the dm-crypt kernel module encrypts the file data using the data encryption master key in the memory and stores the obtained ciphertext of the file data into the Luks encrypted disk block;

[0133] The data decryption unit 83 is specifically used to execute the operation of reading the file data from the directory of the Luks encrypted disk block based on the known directory location of the Luks encrypted disk block, so that the dm-crypt kernel module reads the file data ciphertext from the Luks encrypted disk block and decrypts the file data ciphertext in the memory using the data encryption master key to obtain the decrypted file data.

[0134] The functions of the above modules can correspond to Figures 1 to 5 The corresponding processing steps in the shown process will not be repeated here.

[0135] The encrypted disk creation device and data persistent storage device provided in the embodiments of the present application can be implemented via a computer program. Those skilled in the art should understand that the aforementioned module division is only one of many module division methods, and that other module divisions or no module divisions, as long as the encrypted disk creation device and data persistent storage device have the aforementioned functions, are within the scope of protection of the present application.

[0136] The present application also provides an electronic device, such as Figure 9As shown, it includes a processor 91 and a machine-readable storage medium 92, and the machine-readable storage medium 92 stores machine-executable instructions that can be executed by the processor 91. The processor 91 is prompted by the machine-executable instructions to: implement any of the above-mentioned methods for creating an encrypted disk for a confidential container, or implement any of the above-mentioned methods for persistent data storage of a confidential container.

[0137] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements any of the above-mentioned methods for creating an encrypted disk for a confidential container, or implements any of the above-mentioned methods for persistent data storage of a confidential container.

[0138] An embodiment of the present application also provides a computer program product containing instructions, which, when run on a computer, enables the computer to execute any of the above-mentioned methods for creating an encrypted disk for a confidential container, or execute any of the above-mentioned methods for persistent data storage of a confidential container.

[0139] The machine-readable storage medium in the electronic device may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Alternatively, the memory may be at least one storage device located remotely from the processor.

[0140] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0141] Each embodiment in this specification is described in a related manner. Similar portions between the various embodiments can be referenced to each other. Each embodiment focuses on the differences between the other embodiments. In particular, the device, electronic device, computer-readable storage medium, and computer program product embodiments are generally similar to the method embodiments, so their descriptions are relatively simple. For related portions, reference can be made to the descriptions of the method embodiments.

[0142] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0143] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0144] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0145] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0146] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.

Claims

1. A method for creating an encrypted disk of a confidential container, characterized in that: A startup module applied to a confidential container, wherein the confidential container is located in a guest VM of a trusted execution environment (TEE), and the method includes: Create a virtual disk block in the disk block directory of the disk block mounted by the confidential container; Obtain the device access key from the Key Management Service (KMS) module, which is located in another confidential container in another Guest VM of the TEE. The KMS module obtains the device access key by requesting the Trusted Platform Module (TPM) hardware directly from the confidential container. The device access key is a derived key generated by obfuscating the hardware root of trust and the confidential container ID. Encrypting the generated data encryption master key based on the device access key, and storing the encrypted data encryption master key ciphertext in the disk block header of the disk block to obtain an encrypted disk block; The device access key is used to decrypt the data encryption master key ciphertext read from the disk block header of the encrypted disk block to obtain the data encryption master key and load it into the memory.

2. The method according to claim 1, wherein The confidential container to which the startup module belongs is installed with a cryptsetup tool, and the kernel of the Guest VM where the confidential container is located has a dm-crypt kernel module; The method of encrypting the data encryption master key generated based on the device access key and storing the encrypted data encryption master key ciphertext in the disk block header of the disk block to obtain an encrypted disk block includes: Initializing the disk block by inputting the device access key into the cryptsetup tool, so that the cryptsetup tool calls the dm-crypt kernel module to randomly generate a data encryption master key, the dm-crypt kernel module encrypts the generated data encryption master key using the device access key, and stores the encrypted data encryption master key ciphertext in the disk block header of the disk block, thereby obtaining a Luks encrypted disk block; The method of using the device access key to decrypt the data encryption master key ciphertext read from the disk block header of the encrypted disk block to obtain the data encryption master key and load the key into the memory includes: The Luks encrypted disk block is unlocked by inputting the device access key into the cryptsetup tool, so that the cryptsetup tool calls the dm-crypt kernel module to read the data encryption master key ciphertext from the disk block header of the Luks encrypted disk block, uses the device access key to decrypt the data encryption master key ciphertext, obtains the data encryption master key, and loads it into the memory.

3. The method according to claim 2, wherein Also includes: Initialize the file system of the Luks encrypted disk block to a format that can be recognized by the operating system; The initialized file system of the Luks encrypted disk block is mounted to the file directory of the operating system.

4. The method according to claim 3, wherein Also includes: Notify the large model in the confidential container of the directory location of the Luks encrypted disk blocks.

5. A data persistent storage method for a confidential container, characterized in that: A large model application is applied to a confidential container, wherein the confidential container is located in a guest VM of a trusted execution environment (TEE), the confidential container is mounted with an encrypted disk block, the disk block header of the encrypted disk block stores a data encryption master key ciphertext, the data encryption master key ciphertext is obtained by encrypting the generated data encryption master key using a device access key, the device access key is obtained from a key management service (KMS) module, the KMS module is located in another confidential container, the other confidential container is located in another guest VM of the TEE, the device access key is obtained by the KMS module from a trusted platform module (TPM) hardware request directly passed through the other confidential container, the device access key is a derived key generated by confusing a hardware trusted root with a confidential container ID, the data encryption master key is loaded into memory, and the method includes: Get the file data to be stored; Encrypting the file data in the memory using the data encryption master key, and storing the obtained file data ciphertext in the encrypted disk block; The file data ciphertext is read from the encrypted disk block, and the file data ciphertext is decrypted in the memory using the data encryption master key to obtain the decrypted file data.

6. The method according to claim 5, wherein The kernel of the Guest VM where the confidential container is located has a dm-crypt kernel module, and the encrypted disk block is a Luks encrypted disk block; The step of encrypting the file data in the memory using the data encryption master key and storing the obtained ciphertext of the file data in the encrypted disk block includes: Based on the known directory location of the Luks encrypted disk block, executing an operation of writing the file data into the directory of the Luks encrypted disk block, so that the dm-crypt kernel module encrypts the file data using the data encryption master key in the memory and stores the obtained ciphertext of the file data into the Luks encrypted disk block; The step of reading the file data ciphertext from the encrypted disk block and decrypting the file data ciphertext in the memory using the data encryption master key to obtain the decrypted file data includes: Based on the known directory location of the Luks encrypted disk block, an operation of reading the file data from the directory of the Luks encrypted disk block is performed, so that the dm-crypt kernel module reads the file data ciphertext from the Luks encrypted disk block, and decrypts the file data ciphertext in the memory using the data encryption master key to obtain the decrypted file data.

7. A device for creating an encrypted disk of a confidential container, characterized in that: A startup module applied to a confidential container, wherein the confidential container is located in a guest VM of a trusted execution environment (TEE), and the device includes: a virtual disk creation unit, configured to create a virtual disk block in a disk block directory of a disk block mounted on the confidential container; A key acquisition unit is configured to obtain a device access key from a key management service (KMS) module. The KMS module is located in another confidential container, which is located in another guest VM of the TEE. The device access key is obtained by the KMS module through a hardware request from a trusted platform module (TPM) directly connected to the confidential container. The device access key is a derived key generated by obfuscating the hardware root of trust and the confidential container ID. a key encryption unit, configured to encrypt a data encryption master key generated based on the device access key, and store the encrypted data encryption master key ciphertext in a disk block header of the disk block to obtain an encrypted disk block; A key loading module is used to use the device access key to decrypt the data encryption master key ciphertext read from the disk block header of the encrypted disk block, obtain the data encryption master key, and load it into the memory.

8. A data persistent storage device for a confidential container, characterized in that: A large model application is applied to a confidential container, wherein the confidential container is located in a guest VM of a trusted execution environment (TEE), the confidential container is mounted with an encrypted disk block, the disk block header of the encrypted disk block stores a data encryption master key ciphertext, the data encryption master key ciphertext is obtained by encrypting the generated data encryption master key using a device access key, the device access key is obtained from a key management service (KMS) module, the KMS module is located in another confidential container, the other confidential container is located in another guest VM of the TEE, the device access key is obtained by the KMS module from a trusted platform module (TPM) hardware request directly passed through the other confidential container, the device access key is a derived key generated by confusing a hardware trusted root with a confidential container ID, the data encryption master key is loaded into memory, and the apparatus comprises: A data acquisition unit, used to acquire file data to be stored; a data encryption unit, configured to encrypt the file data in a memory using the data encryption master key, and store the obtained ciphertext of the file data in the encrypted disk block; The data decryption unit is used to read the file data ciphertext from the encrypted disk block and decrypt the file data ciphertext in the memory using the data encryption master key to obtain the decrypted file data.

9. An electronic device, characterized in that: The method comprises a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to implement the method described in any one of claims 1 to 4, or to implement the method described in any one of claims 5 to 6.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented, or the method according to any one of claims 5 to 6 is implemented.

Citation Information

Patent Citations

  • File encryption system oriented to confidential container scene

    CN119004512A

  • Disk decryption method, encryption system and computing device

    CN119622777A