File encryption system oriented to confidential container scene
By designing an encrypted file system based on mirror cascade in a confidential container scenario, providing block-level data protection and file system-level protection, optimizing cache and mirror construction, the inefficiency problem in the existing technology is solved and efficient data protection is achieved. Container startup performance.
Patent Information
- Application Number
- CN202411173118.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-08-26
AI Technical Summary
The encrypted file systems of existing confidential containers lack block-level data protection, file system-level protection, cache optimization and mirror construction efficiency, resulting in inefficient operation and security risks in TEE scenarios.
Using a mirror-based stacking structure, different encryption mirror formats are designed for read-only and writable layers, providing data block-level encryption and decryption and key management, optimizing the cache mechanism and directory entry index, using AES-GCM and SHA3- 256 algorithm, independent encryption mirror building program to improve construction efficiency.
It realizes the deep combination of block-level data protection capabilities and file system structure, improves the adaptability and efficiency of confidential container file systems, reduces memory copy and system calls, and improves container startup delay and security.
Smart Images

Figure CN119004512A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of combining a trusted computing system with a file system, and in particular relates to an encrypted file system for a confidential container scenario. Background Art
[0002] In recent years, computer technology has advanced rapidly, the Internet industry has developed rapidly, and cloud computing has been widely used, but it has also generated many security issues. The complex architecture, numerous deployment scenarios, and wide range of software sources make it difficult for cloud computing to maintain its security capabilities as it continues to expand through traditional security prevention capabilities such as resource isolation and permission authentication. In this context, hardware manufacturers have launched hardware support for trusted execution environments (TEEs). TEEs use hardware to run private programs and private data in an isolated environment, effectively blocking external access and tampering.
[0003] Confidential container technology was born in the context of TEE. It attempts to combine TEE technology with container technology, and use the existing container operation framework to deploy user applications in the TEE environment in a simple, fast and efficient manner under the premise of complying with existing container standards (such as OCI, etc.). The operation of containers often requires the stacking of multiple layers of container images into one layer through layered file systems such as overlayfs for use in the container environment, which facilitates the creation and management of containers. At the same time, in the TEE scenario, since any data inside the TEE should be protected from external access, the data generated in the TEE generally needs to be encrypted before it can be stored on the disk, and the data read from the external disk or image also needs to be decrypted accordingly before it can be accessed and processed in the TEE, which generally requires the TEE runtime to provide the function of an encrypted file system. Then in the confidential container scenario, the load container needs to have the support of both capabilities at the same time to run without destroying the TEE threat model. At present, there are few encrypted file systems designed specifically for confidential container scenarios, and the encrypted file systems actually used in confidential container scenarios have not been deeply adapted to this scenario.
[0004] The technical disadvantages of the encrypted file systems used by existing confidential containers are as follows: 1) Block-level data protection is not supported. Some encrypted file systems for TEE only provide file-level encryption protection, that is, using the same key or limited keys for the entire file, such as Graphene-SGX, which will greatly reduce the protection capabilities of encrypted files: if the key is accidentally leaked due to human reasons or side channels, the attacker can obtain the ciphertext of the file. In addition, the encrypted file systems used in most TEE scenarios do not use data structures such as hash trees to implement fast integrity verification functions. Either the integrity verification is completely missing, or the integrity verification unit is too large (such as file level), making the delay efficiency of opening files very low.
[0005] 2) File system-level protection is not supported. The encrypted file systems currently used in TEE scenarios generally lack file system-level protection capabilities, that is, embedding keys into the file system structure, treating different data types or different data structures of the file system differently, and forming a more efficient metadata and data management mechanism. For example, the common LibOS Occlum uses the built-in SEFS encrypted file system to provide data sealing capabilities for Occlum loads, but the implementation of SEFS is completely based on the encrypted file function of Intel SGX SDK. Although the latter implements block-level data protection and fast integrity verification functions, because SEFS is superimposed on it, different data structures of the file system are not distinguished during encryption protection, and the efficiency is low.
[0006] 3) No cache or inefficient cache. Current encrypted file systems often lack plaintext cache (such as Graphene-SGX) or use general cache capabilities for the scenario in which they are used. For example, Occlum's SEFS uses the encrypted file cache of the SDX SDK, and confidential virtual machine scenarios often use the general buffer cache provided by the Linux kernel. These implementations can only meet the basic needs of caching and are not optimized for TEE and confidential container scenarios. For example, the encrypted file function of the SGX SDK uses a 48-block cache for each file, without considering the actual size of the protected object, which is prone to large idle space and increases TCB, leading to security risks; the hash tree it implements lacks a specific cache algorithm, which is prone to cache overflow.
[0007] 4) The local image building process is not optimized. The container building problem in the confidential container scenario lacks special optimization in the existing confidential container solutions. For example, the image building process of Occlum's SEFS simply creates an empty image and then copies the image content into it according to the process of writing to the file system. During this process, the corresponding space allocation algorithm will be used, resulting in repeated modifications to the same data structure. These unnecessary accesses will generate additional system calls. In TEE scenarios, especially SGX scenarios, IO-type system calls will cause additional memory copies to ensure security, thereby reducing efficiency.
[0008] In summary, there are many issues that need to be addressed in the encrypted file system of confidential containers, and the industry needs more efficient and dedicated support for confidential container data sealing. Summary of the invention
[0009] In view of the above, an object of the present invention is to provide an encrypted file system for confidential container scenarios to address the technical shortcomings of the encrypted file system used in the above-mentioned existing confidential containers.
[0010] To achieve the above-mentioned purpose of the invention, an embodiment provides an encrypted file system for confidential container scenarios, including: Provides a cascading structure based on image layer stacking, and uses different encrypted image formats for read-only layers and writable layers to support multi-layer encrypted image stacking; Encryption and decryption are performed in data blocks, and encryption and decryption keys are managed hierarchically, that is, the encryption and decryption keys for each layer of the data structure are reflected in the logical upper layer data structure, and the final key of the top layer is saved by the image owner of the encrypted file system; Provide a caching mechanism to maintain the plaintext cache inside the trusted execution environment; Use independent encrypted image building programs to build encrypted images for read-only and writable layers to ensure efficient and reliable building time and space; Optimize the space and time efficiency of the directory entry table index.
[0011] Preferably, a compact encrypted image format is used for the read-only layer, leaving no free area, and starting from offset 0, it is the super block, inode table, directory entry table, long path table and file data area in sequence; The super block is the metadata area of the encrypted file system, storing meta information for the encrypted file system; The inode table is a collection of file system objects. The representation size of file system objects in the read-only layer is inconsistent, and the byte offset method is needed to determine the position; The directory entry table stores all directory entries. Its size is uniform, and the directory entries of the same directory are continuous in the table. The directory inode only needs to store the actual offset and number. The long path table stores long path names that cannot be placed in the reserved location, including the names of soft links and directory entries. The strings in the table are not aligned and have no trailing zeros. The inode needs to record the exact starting position and byte length. The file data area stores file data in random order and requires a starting position to be specified in the inode.
[0012] Preferably, a sparse encrypted image format is used for the writable layer to provide space for the allocation algorithm to be easily expanded and contracted. Each data structure unit can represent file content data, inode table, directory entry table of each directory, super block or bitmap data. Each data structure unit is presented as an encrypted file on the host side. All encrypted files are placed in the same directory, representing a writable layer. The super block is the metadata area of the encrypted file system, which stores the meta information of the encrypted file system, and appends an inode bitmap area after the super block file to record the allocation of the inode table. The inode table is a collection of file system objects. In the writable layer, the inode size is consistent and the specific location is determined by number offset. The directory entry table of each directory is regarded as the data of the inode and is stored separately in an encrypted file like the file data area.
[0013] Preferably, when encryption and decryption are performed in units of data blocks, the AES-GCM algorithm is used for encryption and decryption.
[0014] Preferably, when integrity verification is performed in units of data blocks, a SHA3-256 algorithm is used to obtain a hash value.
[0015] Preferably, the encryption and decryption keys for each layer of the data structure are reflected in the logical upper layer data structure, and the final key of the uppermost layer is saved by the image owner of the encrypted file system, including: Except for the super block or the encrypted file, all structures are wrapped with a hash tree. The expansion of the hash tree can be directly appended to the end of the encrypted file, and the contraction of the hash tree truncates the end of the encrypted file. For ordinary data blocks and index blocks of hash trees, the key is located in the parent node of the hash tree; for the root node of the hash tree, the key is located in the corresponding inode. If it is the file system metadata part, the key is located in the super block; the key of the super block is kept by the mirror owner of the encrypted file system.
[0016] Preferably, a cache mechanism is provided, and a plaintext cache within the trusted execution environment is maintained through the cache mechanism, including: The cache types in the provided cache mechanism include data block cache, inode cache and path cache. The cache contains plaintext data and occupies the private memory of the trusted execution environment. The cache mechanism is a dynamic mechanism. When opening a file, the cache is increased or decreased based on the existing cache and the size of the file to be opened, so as to minimize the TCB. The cache threshold and ratio can be set manually at startup.
[0017] Preferably, it also includes providing a cache mechanism for the hash tree write-back operation, specifically: The cache provided for the hash tree write-back operation is a dynamic key temporary storage area, in which the key to be updated is temporarily stored, suppressing continuous key cache write-back operations and maintaining stable performance.
[0018] Preferably, the method further comprises: adopting an inline data structure at multiple locations, wherein the data adopting the inline data structure comprises file data, a directory entry table, and a soft link path.
[0019] Preferably, an independent encrypted image building program is used to build encrypted images for the read-only layer and the writable layer, including: The additional independent encrypted image builder analyzes the characteristic indicators of the target file tree, including the number of files, the number of directories, the file tree depth, and the file size, and writes the encrypted data into the encrypted image file at one time without causing additional input and output, so as to reduce unnecessary memory copies in the trusted execution environment.
[0020] Preferably, the space and time efficiency of the index of the directory entry table is optimized, including: For the read-only layer, the directory entry tables of all directories are connected into one table. Each directory inode needs to record its starting position and length. The inode of the read-only layer stores a limited number of index entries. When searching for a directory entry, the encrypted file system first calculates the minor hash of the path, searches for the index entry based on the minor hash, determines the segment where the target directory entry exists based on the index entry, and then performs a traversal search. The segment length pointed to by the index entry has a constant upper limit to reduce the number of search traversals. The construction of the index entry is completed by the encrypted image construction program. During the construction, the appropriate index segment is selected according to the number of directory entries. When there are fewer directory entries, the index has at most one layer. For the writable layer, the directory entry table is split up and its parts are indexed in the same way as for the read-only layer.
[0021] Compared with the prior art, the present invention has the following beneficial effects: The present invention provides block-level data protection capabilities, which are deeply integrated with the file system structure, and is supplemented by multiple optimizations such as algorithm optimization, cache optimization, and image building optimization, to improve the adaptability and efficiency of the confidential container file system. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 It is a schematic diagram of an improved process of an encrypted file system provided in an embodiment; Figure 2 is a read-only layer image format diagram provided by an embodiment; Figure 3is a writable layer image format diagram provided by an embodiment; Figure 4 It is an operation flow chart of basic file operations of the encrypted file system provided by the embodiment. DETAILED DESCRIPTION
[0024] To make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific implementation methods described herein are only used to explain the present invention and do not limit the scope of protection of the present invention.
[0025] After analysis, the present invention believes that in the confidential container scenario, the encrypted file system needs to make the following adaptations and optimizations to improve the efficiency and adaptability of the encrypted file system: 1) It can encrypt and decrypt data blocks using different and randomly generated keys. Generally, symmetric encryption algorithms can be used to obtain more ideal and stable performance.
[0026] 2) Provide data sealing function at the encrypted file system level, treat the metadata of each part of the file system separately, and modify the format of the encrypted file system image to support encryption protection function. The keys of the data structures of each level of the encrypted file system, such as the key, should be reflected in the logical upper data structure level by level, and finally the security protection of the entire file system should be reflected in the top-level key level by level, and this key will be kept by the file system image owner.
[0027] 3) Provide a certain degree of caching mechanism for encrypted data. Since the encryption and decryption process will seriously slow down the IO performance of TEE, the file system needs to maintain the ciphertext cache inside the TEE to help the load program maintain a reasonable performance overhead.
[0028] 4) Provide support for overlay-like cascaded file systems. Container images in confidential container scenarios often follow the OCI standard and require stacking multiple layers of encrypted images to form the final container rootfs. Therefore, an encrypted file system is required in confidential containers to support stacking multiple layers of encrypted images.
[0029] 5) Provide an efficient encrypted local image building program. Since the image of the confidential container cannot be read and accessed by TEE external software, it is necessary to convert the OCI encryption format into the image format of the local encrypted file system when pulling the image to facilitate local operation. Since the IO performance of TEE is limited by encryption and decryption, the local image building program needs to reduce the number of IO as much as possible, thereby reducing the container startup delay.
[0030] Based on the above analysis, the encrypted file system for confidential container scenarios provided in the embodiment provides block-level data protection capabilities, is deeply integrated with the file system structure, and is supplemented by algorithm optimization, cache optimization, image building optimization and other optimizations to improve the adaptability and efficiency of the confidential container file system. Figure 1 As shown, specifically including: The encrypted file system of the present invention provides a stacked structure based on image layer coverage, and adopts different encrypted image formats for the read-only layer and the writable layer, so as to support multi-layer encrypted image stacking.
[0031] Specifically, compared to common containers, only the top layer is writable and the remaining layers are read-only. Since the content of the read-only layer will not change, in order to improve efficiency and save space, the present invention separates the formats of the read-only layer and the writable layer, and supports stacking of multiple layers of encrypted images to form a layered structure.
[0032] like Figure 2 As shown in the figure, a compact encrypted image format is used for the read-only layer, and no free area is left as far as possible. Starting from offset 0, there are superblocks, inode tables, directory entry tables, long path tables, and file data areas. Among them, the superblock is the metadata area of the encrypted file system, which stores meta information for the encrypted file system, such as the starting position and range of other areas, the encryption mode, size, data statistics information of the encrypted file system, etc., and the size is 1 block. The inode table is a collection of file system objects (inodes). In the read-only layer, the inode size is inconsistent, so the position needs to be determined by byte offset. The directory entry table stores all directory entries, which have a uniform size, and the directory entries of the same directory are continuous in the table. The directory inode only needs to store the actual offset and size. The long path table stores long path names that cannot be placed in the reserved position, including the names of soft links and directory entries. The strings in the table are not aligned and there is no trailing 0. The inode needs to record the exact starting position and byte length. The file data area stores file data, which is randomly arranged, and the starting position needs to be specified in the inode.
[0033] like Figure 3As shown in the figure, the writable layer adopts a sparse encrypted image format to provide sufficient space for the allocation algorithm and facilitate expansion and contraction. Specifically, each data structure unit can include a file data area, an inode table, a directory entry table of each directory, bitmap data or a superblock. Each data structure unit is presented as an encrypted file on the host side. All encrypted files are placed in the same directory, representing a writable layer. The structures such as superblock and inode table are similar to those of the read-only layer. The difference is that an inode bitmap area is appended after the superblock file to record the allocation of the inode table. The directory entry table of each directory is regarded as the data of the inode and is stored separately in an encrypted file like the file data area.
[0034] Considering that the image layer of the confidential container scenario will not be too large and complex, and many files or directory entries and other data are generally small, the present invention uses inline data structures in many places. The data that can be inlined includes: file data, directory entry table, and soft link path. These inline data can better maintain the spatial consistency of data, improve cache hit rate, and improve the overall efficiency of the file system.
[0035] The encrypted file system of the present invention performs encryption and decryption in units of data blocks, and performs hierarchical management of encryption and decryption keys, that is, the encryption and decryption keys for each layer of data structure are reflected in the logical upper layer data structure, and the final key of the top layer is saved by the image owner of the encrypted file system.
[0036] Specifically, two configurable protection modes are used for the encrypted file system, encryption mode and integrity mode. The encryption mode refers to recording integrity information while encrypting and decrypting data blocks. Specifically, the AES-GCM algorithm can be used to take both confidentiality and integrity into account. The integrity mode only verifies the integrity of the data block without encryption protection. In this case, the SHA3-256 algorithm is used to obtain the hash value.
[0037] Specifically, the encryption and decryption keys are managed hierarchically, including: Except for the superblock or the encrypted file, all structures are wrapped with a Merkle Hash Tree (MHT) to obtain reasonable data integrity check performance and convenient hierarchical key management. Due to the structural characteristics of MHT, the expansion of MHT can be directly appended to the end of the encrypted file, and the contraction of MHT truncates the end of the encrypted file, which is convenient for the use of writable mode; The key of each data structure is stored at its parent in the file system logical hierarchy: for ordinary data blocks and index blocks of hash trees, the key is located in the hash tree parent node; for the hash tree root node, the key is located in the corresponding inode; if it is the file system metadata part, the key is located in the superblock; the key of the superblock is kept by the image owner.
[0038] The encrypted file system of the present invention provides a cache mechanism, through which the ciphertext cache inside the trusted execution environment is maintained. Specific cache types include data block cache, inode cache and path cache. The cache contains data plaintext and occupies the private memory of the trusted execution environment (TEE). The cache mechanism provided by the encrypted file system of the present invention is a dynamic mechanism. When opening a file, the increase or decrease of the cache is determined according to the size of the existing cache and the file to be opened, so as to reduce the TCB as much as possible. At the same time, the threshold and ratio of the cache can be manually set at startup to improve convenience.
[0039] The encrypted file system of the present invention provides a cache mechanism and also provides a cache for hash tree write-back operations. For MHT, when a leaf node data block needs to be written back to the image from the cache, the key needs to be updated at its parent node, and the parent node may also update its own key, which may cause continuous cache write-back operations. This phenomenon greatly reduces the effectiveness of the cache and leads to unstable performance. To address this problem, the cache of the MHT part uses a dynamic key temporary storage area to temporarily store the key to be updated in the dynamic key temporary storage area, preventing continuous cache write-back and maintaining stable performance.
[0040] The encrypted file system of the present invention also uses an additional independent encrypted image construction program that is not a local encrypted image construction program to build encrypted images for read-only layers and writable layers. As described above, the process of building a local encrypted image will affect the container startup delay. In this regard, the present invention speeds up the construction speed by designing an independent encrypted image construction program instead of writing an empty image. Specifically, the additional independent encrypted image construction program will analyze the size of the target file tree, the number of files, the number of directories and other information, and write the encrypted data to the encrypted image file at one time, without causing additional IO, thereby reducing unnecessary memory copies in the TEE environment.
[0041] The encrypted file system of the present invention also optimizes the index of the directory entry table. The structure and index design of the directory entry table directly determine the efficiency of directory entry search. The present invention makes targeted optimizations to the index of the directory entry table, specifically including: For the read-only layer, the directory entry tables of all directories are connected into one table. Each directory inode (inode) needs to record its starting position and length. The inode of the read-only layer stores limited index items. When searching for directory items, the encrypted file system first calculates the minor hash of the path (the specific algorithm is similar to the minor hash implementation of the ext4 file system in the Linux kernel), searches for index items based on the minor hash, determines the segment where the target directory item exists based on the index item, and then traverses the search. The segment length pointed to by the index item has a constant upper limit, so the number of search traversals can be greatly reduced. The construction of index items is completed by the encrypted image construction program. When building, the appropriate index segment is selected according to the number of directory items. When there are fewer directory items, the directory item may not exist. Considering the efficiency of the construction program and the usage scenario, since the image construction time will affect the container startup delay, and the confidential container scenario generally does not use more complex image layers, the index is at most one layer.
[0042] For the writable layer, although the directory entry table is split, the indexing method of each part is the same as that of the read-only layer, so it will not be repeated here.
[0043] The encrypted file system of the present invention is written in Rust language, and the file system logic is presented as a Rust Crate, so that it can be easily integrated with various programs, such as LibOS such as Occlum written in Rust, or presented as a FUSE daemon in the virtual machine TEE through the FUSE interface.
[0044] The embodiment also provides the operation process of the above-mentioned encrypted file system, such as Figure 4 As shown, it includes: when the upper-layer software issues a file read and write operation, the virtual file system (VFS) layer (LibOS, guest kernel provided or using the VFS that comes with this file system) parses the file operation, splits the path, and finds the corresponding file system instance (read-only layer, read-write layer, or overlay). For each layer of the path, the file system searches for the corresponding inode number in the inode cache. If there is no cache, it will be read and decrypted from the encrypted image. For file type inodes, the corresponding data block is found in the MHT according to the offset; for directory type inodes, the interval in the corresponding table is analyzed according to the directory entry table offset and possible indexes, and traversed for search. If the corresponding data block is not in the cache, it will be obtained from the encrypted image and decrypted. Each layer of the path is processed in this way in a loop, and the result is finally returned to the upper-layer software.
[0045] The specific implementation methods described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An encrypted file system for confidential container scenarios, characterized in that: include: Provides a cascading structure based on image layer stacking, and uses different encrypted image formats for read-only layers and writable layers to support multi-layer encrypted image stacking; Encryption and decryption are performed in data blocks, and encryption and decryption keys are managed hierarchically, that is, the encryption and decryption keys for each layer of the data structure are reflected in the logical upper layer data structure, and the final key of the top layer is saved by the image owner of the encrypted file system; Provide a caching mechanism to maintain the plaintext cache inside the trusted execution environment; Use independent encrypted image building programs to build encrypted images for read-only and writable layers to ensure efficient and reliable building time and space; Optimize the space and time efficiency of the directory entry table index.
2. The encrypted file system for confidential container scenarios according to claim 1, characterized in that: For the read-only layer, a compact encrypted image format is used to avoid idle areas. Starting from offset 0, it is the super block, inode table, directory entry table, long path table and file data area. The super block is the metadata area of the encrypted file system, storing meta information for the encrypted file system; The inode table is a collection of file system objects. The representation size of file system objects in the read-only layer is inconsistent, and the byte offset method is needed to determine the position; The directory entry table stores all directory entries. Its size is uniform, and the directory entries of the same directory are continuous in the table. The directory inode only needs to store the actual offset and number. The long path table stores long path names that cannot be placed in the reserved location, including the names of soft links and directory entries. The strings in the table are not aligned and have no trailing zeros. The inode needs to record the exact starting position and byte length. The file data area stores file data in random order and requires a starting position to be specified in the inode.
3. The encrypted file system for confidential container scenarios according to claim 1, characterized in that: For the writable layer, a sparse encrypted image format is used to provide space for the allocation algorithm to expand and shrink. Each data structure unit can represent file content data, inode table, directory entry table of each directory, super block or bitmap data. Each data structure unit is presented as an encrypted file on the host side. All encrypted files are placed in the same directory, representing a writable layer. The super block is the metadata area of the encrypted file system, which stores the meta information of the encrypted file system, and appends an inode bitmap area after the super block file to record the allocation of the inode table. The inode table is a collection of file system objects. In the writable layer, the inode size is consistent and the specific location is determined by number offset. The directory entry table of each directory is regarded as the data of the inode and is stored separately in an encrypted file like the file data area.
4. The encrypted file system for confidential container scenarios according to claim 1, characterized in that: When encryption and decryption are performed in data blocks, the AES-GCM algorithm is used for encryption and decryption; when integrity verification is performed in data blocks, the SHA3-256 algorithm is used to obtain the hash value.
5. The encrypted file system for confidential container scenarios according to claim 1, characterized in that: The encryption and decryption keys for each layer of the data structure are reflected in the logical upper layer data structure, and the final key of the top layer is saved by the image owner of the encrypted file system, including: Except for the super block or the encrypted file, all structures are wrapped with a hash tree. The expansion of the hash tree can be directly appended to the end of the encrypted file, and the contraction of the hash tree truncates the end of the encrypted file. For ordinary data blocks and index blocks of hash trees, the key is located in the parent node of the hash tree; for the root node of the hash tree, the key is located in the corresponding inode. If it is the file system metadata part, the key is located in the super block; the key of the super block is kept by the mirror owner of the encrypted file system.
6. The encrypted file system for confidential container scenarios according to claim 1, characterized in that: Provide a caching mechanism to maintain the plaintext cache inside the trusted execution environment, including: The cache types in the provided cache mechanism include data block cache, inode cache and path cache. The cache contains plaintext data and occupies the private memory of the trusted execution environment. The cache mechanism is a dynamic mechanism. When opening a file, the cache is increased or decreased based on the existing cache and the size of the file to be opened, so as to minimize the TCB. The cache threshold and ratio can be set manually at startup.
7. The encrypted file system for confidential container scenarios according to claim 5, characterized in that: Also includes: Provides a cache mechanism for hash tree write-back operations, specifically: The cache provided for the hash tree write-back operation is a dynamic key temporary storage area, in which the key to be updated is temporarily stored, suppressing continuous key cache write-back operations and maintaining stable performance.
8. The encrypted file system for confidential container scenarios according to claim 1, characterized in that: Also includes: Inline data structures are used in multiple places, wherein the data using the inline data structure include file data, directory entry table, and soft link path.
9. The encrypted file system for confidential container scenarios according to claim 1, characterized in that: Use independent encrypted image building programs to build encrypted images for read-only and writable layers, including: The additional independent encrypted image builder analyzes the characteristic indicators of the target file tree, including the number of files, the number of directories, the file tree depth, and the file size, and writes the encrypted data into the encrypted image file at one time without causing additional input and output, so as to reduce unnecessary memory copies in the trusted execution environment.
10. The encrypted file system for confidential container scenarios according to claim 1, characterized in that: Optimize the space and time efficiency of the directory entry table index, including: For the read-only layer, the directory entry tables of all directories are connected into one table. Each directory inode needs to record its starting position and length. The inode of the read-only layer stores a limited number of index entries. When searching for a directory entry, the encrypted file system first calculates the minor hash of the path, searches for the index entry based on the minor hash, determines the segment where the target directory entry exists based on the index entry, and then performs a traversal search. The segment length pointed to by the index entry has a constant upper limit to reduce the number of search traversals. The construction of the index entry is completed by the encrypted image construction program. During the construction, the appropriate index segment is selected according to the number of directory entries. When there are fewer directory entries, the index has at most one layer. For the writable layer, the directory entry table is split up and its parts are indexed in the same way as for the read-only layer.
Citation Information
Patent Citations
Docker layered mirror image encryption and decryption methods and related device
CN113032736A
Method and device for creating high-performance read-only file system
CN116955520A
Sharing container data inside a tenant's pod under different trusted execution environments (TEES)
US20220391494A1
Cited By
Encrypted disk creation method and data persistence storage method and device
CN120449219A
A method for creating an encrypted disk, a method for persistently storing data, and a device
CN120449219B
Container mirror image security management method and system
CN120597288A
Data persistence storage system and method, terminal and medium
CN122020740A
A data persistent storage system, method, terminal and medium
CN122020740B
