Database transparent encryption and decryption method and device, equipment and storage medium
By using stacked file systems and access control policies in the kernel space, transparent database encryption and decryption is achieved, solving the problems of database encryption and decryption dependency and data leakage in the existing technology, reducing development costs and improving security.
Patent Information
- Application Number
- CN202410789105.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-24
AI Technical Summary
Existing database transparent data encryption and decryption technologies have the problem of relying on the open interfaces of database manufacturers, which makes it difficult to implement encryption and decryption in databases of different types, versions and manufacturers, increases development and maintenance costs, and risks data leakage.
By using the stacked file system in the kernel space to obtain pre-configured key policy information, calling the encryption algorithm to perform encryption and decryption operations on the database table, and judging the legality of the access process through the access control policy, transparent encryption and decryption of the specified table space is achieved. Reduce dependence on database type, version, and manufacturer.
It improves the security of key data in the database, effectively prevents data leakage, reduces development and maintenance costs, and enables transparent encryption and decryption of multi-vendor and multi-version databases.
Smart Images

Figure 00000000_0000
Abstract
Description
Technical Field
[0001] The present application relates to the field of information security technology, and in particular to a database transparent encryption and decryption method, device, equipment and storage medium. Background Art
[0002] Sensitive data is stored in plain text in the database. In order to achieve secure storage of sensitive data, the traditional method is to encrypt and decrypt sensitive data in databases of different types, versions and manufacturers based on the TDE (Transparent Data Encryption) open interface provided by various database vendors or open source databases. The interface is implemented by the database vendor in the database engine, encrypts the data when it is written to the disk, and decrypts the data when it is output from the disk.
[0003] However, if the manufacturer or open source database does not provide a TDE open interface for the database, it is impossible to transparently encrypt sensitive data in the database. In this case, it is necessary to cooperate with the manufacturer to develop and implement it. In addition, there is currently no unified transparent encryption standard for TDE open interfaces by database manufacturers or open source databases. As long as each database supports the TDE function, a private customized interface can be opened for it. When it is necessary to support databases from multiple manufacturers and multiple versions, it is necessary to connect separately to implement transparent data encryption, resulting in high development and maintenance costs. In addition, in the process of encrypting and decrypting the database through the TDE open interface, the database may be at risk of data leakage. Summary of the invention
[0004] In view of this, the purpose of this application is to provide a database transparent encryption and decryption method, device, equipment and storage medium, which can realize the encryption and decryption operations of specified table space data, improve the security of key data in the database, effectively prevent data leakage, and reduce development and maintenance costs. The specific scheme is as follows:
[0005] In a first aspect, the present application discloses a database transparent encryption and decryption method, comprising:
[0006] When an access process that performs a write operation on a database table in a target database is detected, whether the access process is legal is determined by using pre-configured access control policy information;
[0007] If the access process is legal, obtaining pre-configured key policy information through a stacked file system; the stacked file system is located in the kernel space;
[0008] Calling an encryption algorithm corresponding to the database table according to the encryption algorithm information contained in the key policy information, and performing encryption operation on the database table to be accessed in the target database using the encryption algorithm to obtain an encrypted table space file;
[0009] The encrypted table space file is stored in a file storage system so that the corresponding write operation is performed on the database table by calling the encrypted table space file in the file management system; the file storage system is located in the kernel space.
[0010] Optionally, the database transparent encryption and decryption method further includes:
[0011] Obtain key policy information of the target database, and configure the key policy information to the key management component and the cryptographic algorithm component in the kernel space through the TDE plug-in in the user space; the key policy information includes the tablespace name, encryption algorithm information and key information;
[0012] Obtaining access control policy information for the service process of the target database, and configuring the access control policy information into the process access control component located in the kernel space through the TDE plug-in;
[0013] Accordingly, judging whether the access process is legal by using pre-configured access control policy information includes:
[0014] Whether the access process is legal is determined by the access control policy information configured in the process access control component.
[0015] Optionally, obtaining pre-configured key policy information through the stackable file system includes:
[0016] The key management component and the cryptographic algorithm component are accessed through a stacked file system to obtain the key policy information configured in the key management component and the cryptographic algorithm component.
[0017] Optionally, calling an encryption algorithm corresponding to the database table according to the encryption algorithm information included in the key policy information includes:
[0018] The encryption algorithm corresponding to the database table in the cryptographic algorithm component is called according to the encryption algorithm information contained in the key policy information.
[0019] Optionally, the obtaining access control policy information for the service process of the target database includes:
[0020] The process ID and process signature of the service process of the target database are obtained to obtain access control policy information.
[0021] Optionally, storing the encrypted tablespace file in a file storage system so as to perform a corresponding write operation on the database table by calling the encrypted tablespace file in the file management system includes:
[0022] The encrypted table space file is stored in the EXT storage system, so that the corresponding write operation is performed on the database table by calling the encrypted table space file in the EXT storage system.
[0023] Optionally, after storing the encrypted tablespace file in the file storage system, the method further includes:
[0024] When an access process that performs a read operation on a database table in the target database is monitored, acquiring the encrypted tablespace file from the file storage system;
[0025] The encrypted tablespace file is decrypted by the stacked file system to obtain the database table to be accessed, and the database table is sent to the target application that initiates the access process to perform a corresponding read operation on the database table.
[0026] In a second aspect, the present application discloses a database transparent encryption and decryption device, comprising:
[0027] A judgment module, for judging whether the access process is legal by using pre-configured access control policy information when an access process for writing to a database table in a target database is detected;
[0028] An information acquisition module, configured to acquire pre-configured key policy information through a stacked file system if the access process is legal; the stacked file system is located in the kernel space;
[0029] An algorithm calling module, used to call the encryption algorithm corresponding to the database table according to the encryption algorithm information contained in the key policy information;
[0030] An encryption operation module, used to perform encryption operation on the database table to be accessed in the target database using the encryption algorithm to obtain an encrypted table space file;
[0031] The file storage module is used to store the encrypted table space file in the file storage system so as to perform corresponding write operations on the database table by calling the encrypted table space file in the file management system; the file storage system is located in the kernel space.
[0032] In a third aspect, the present application discloses an electronic device, comprising a processor and a memory; wherein the processor implements the aforementioned database transparent encryption and decryption method when executing a computer program stored in the memory.
[0033] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned database transparent encryption and decryption method is implemented.
[0034] It can be seen that when the present application detects an access process that performs a write operation on a database table in a target database, it first determines whether the access process is legal through pre-configured access control policy information. If the access process is legal, it obtains the pre-configured key policy information through the stacked file system located in the kernel space, and then calls the encryption algorithm corresponding to the database table according to the encryption algorithm information contained in the key policy information, and uses the encryption algorithm to perform an encryption operation on the database table to be accessed in the target database to obtain an encrypted table space file, and then stores the encrypted table space file in the file storage system, so as to perform a corresponding write operation on the database table by calling the encrypted table space file in the file management system located in the kernel space. The present application can implement encryption and decryption operations of designated table space data independently of parameters such as database type, version, and manufacturer through pre-configured key policy information and access control policy information and stacked file system, and improves the security of key data in the database, effectively prevents data leakage, and reduces development and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present application 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 embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0036] Figure 1 A flow chart of a database transparent encryption and decryption method disclosed in this application;
[0037] Figure 2 A flowchart of a specific database transparent encryption and decryption method disclosed in this application;
[0038] Figure 3 A flowchart of a specific database transparent encryption and decryption method disclosed in this application;
[0039] Figure 4 A schematic diagram of a specific database transparent encryption and decryption method disclosed in this application;
[0040] Figure 5 This is a schematic diagram of the structure of a database transparent encryption and decryption device disclosed in this application;
[0041] Figure 6 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0043] The present application embodiment discloses a method for transparent encryption and decryption of a database. Figure 1 As shown, the method includes:
[0044] Step S11: when an access process that performs a write operation on a database table in a target database is monitored, whether the access process is legal is determined by using pre-configured access control policy information.
[0045] In this embodiment, when an access process is detected that performs write operations, such as adding, deleting, modifying, etc., on a database table in a target database, it is possible to first determine whether the access process is a legitimate process through pre-configured access control policy information. The access control policy information includes, but is not limited to, information such as process IDs (Identity Documents) and process signatures of all accessible service processes in the target database.
[0046] It should be pointed out that before transparently encrypting and decrypting the database, the present application specifically includes: obtaining the key policy information of the target database, and configuring the key policy information to the key management component and cryptographic algorithm component located in the kernel space through the TDE plug-in located in the user space; the key policy information includes the tablespace name, encryption algorithm information and key information; obtaining the access control policy information of the service process for the target database, and configuring the access control policy information to the process access control component located in the kernel space through the TDE plug-in. In this embodiment, see Figure 2As shown, the key policy information of the target database to be transparently encrypted and decrypted is first collected, such as the tablespace name, the encryption algorithm information and key information corresponding to each of the tablespace names, and then the key policy information is configured to the key management component and the cryptographic algorithm component in the kernel space through the TDE plug-in (i.e., the TDE plug-in process) in the user space. Specifically, the key management component can be used to store the tablespace name and the corresponding key information, and the cryptographic algorithm component can be used to store the tablespace name and the corresponding encryption algorithm information, that is, the information of the encryption algorithm used, and the encryption algorithm includes but is not limited to the SM3 (a cryptographic hash function standard) algorithm, the SM4 algorithm, etc.
[0047] Correspondingly, judging whether the access process is legal by using the pre-configured access control policy information may specifically include: judging whether the access process is legal by using the access control policy information configured in the process access control component. That is, judging whether the current access process is a legal process may be judged by using the access control policy information configured in the pre-created process access control component.
[0048] In a specific implementation, the obtaining of the access control policy information for the service process of the target database includes: obtaining the process ID and process signature of the service process of the target database to obtain the access control policy information. That is, the process ID and process signature of the service process are used as the access control policy information of the database.
[0049] Step S12: If the access process is legal, obtaining pre-configured key policy information through a stacked file system; the stacked file system is located in the kernel space.
[0050] In this embodiment, if the access process is a legitimate process, the pre-configured key policy information is obtained through a stacked file system pre-created in the kernel space.
[0051] Specifically, the obtaining of pre-configured key policy information through the stacked file system may include: accessing the key management component and the cryptographic algorithm component through the stacked file system to obtain the key policy information configured in the key management component and the cryptographic algorithm component. Figure 2 As shown, the key management component and the cryptographic algorithm component located in the kernel space can be accessed through the stacked file system located in the kernel space, so as to obtain the key policy information pre-configured in the key management component and the cryptographic algorithm component, such as obtaining the key information and encryption algorithm corresponding to the target database.
[0052] Step S13: calling the encryption algorithm corresponding to the database table according to the encryption algorithm information contained in the key policy information, and using the encryption algorithm to perform encryption operation on the database table to be accessed in the target database to obtain an encrypted table space file.
[0053] In this embodiment, after obtaining the pre-configured key policy information through the stacked file system, further, the encryption algorithm corresponding to the above database table is called according to the encryption algorithm information contained in the above key policy information, and then the above encryption algorithm and key information are used to perform corresponding encryption operations on the database table to be accessed in the above target database to obtain an encrypted table space file. It can be understood that a single table space contains multiple database tables, so when an encryption operation is performed on a single database table, a file corresponding to the table space where the entire database table is located is obtained.
[0054] Specifically, calling the encryption algorithm corresponding to the database table according to the encryption algorithm information included in the key policy information may include: calling the encryption algorithm corresponding to the database table in the cryptographic algorithm component according to the encryption algorithm information included in the key policy information. Figure 2 As shown, the target encryption algorithm corresponding to the database table in the cryptographic algorithm component can be called according to the encryption algorithm information contained in the key policy information.
[0055] Step S14: storing the encrypted table space file in a file storage system so as to perform a corresponding write operation on the database table by calling the encrypted table space file in the file management system; the file storage system is located in the kernel space.
[0056] In this embodiment, after the database table to be accessed in the target database is encrypted to obtain an encrypted table space file, the encrypted table space file can be stored in a file storage system located in the kernel space, so as to perform corresponding write operations on the database table by calling the encrypted table space file in the file management system, such as modifying data in the database table. The file storage system includes but is not limited to EXT (Extended file system) 2, EXT3, EXT4, XFS (X File System, log file system), etc.
[0057] Furthermore, after storing the encrypted tablespace file in the file storage system, the method may further include: when an access process that performs a read operation on a database table in the target database is detected, the encrypted tablespace file is obtained from the file storage system; the encrypted tablespace file is decrypted by the stacked file system to obtain the database table to be accessed, and the database table is sent to the target application that initiates the access process to perform a corresponding read operation on the database table. In this embodiment, after calling the encrypted tablespace file in the file management system to perform a corresponding write operation on the database table, a corresponding read operation, such as a query operation, may also be performed. Specifically, when an access process that performs a read operation on a database table in the target database is detected, the encrypted tablespace file may be first read from the file storage system, and then the encrypted tablespace file may be decrypted by the stacked file system located in the kernel space to obtain the database table to be accessed, and then the decrypted database table may be sent to the target application that initiates the access process, i.e., the user end, so that the target application performs a corresponding read operation on the database table.
[0058] It can be seen that when the embodiment of the present application monitors the access process that performs write operations on the database table in the target database, it first determines whether the access process is legal through the pre-configured access control policy information. If the access process is legal, the pre-configured key policy information is obtained through the stacked file system located in the kernel space, and then the encryption algorithm corresponding to the database table is called according to the encryption algorithm information contained in the key policy information, and the encryption algorithm is used to perform encryption operations on the database table to be accessed in the target database to obtain an encrypted table space file, and then the encrypted table space file is stored in the file storage system, so that the corresponding write operation is performed on the database table by calling the encrypted table space file in the file management system located in the kernel space. The embodiment of the present application can realize the encryption and decryption operations of the specified table space data without relying on the parameters such as the database type, version, and manufacturer through the pre-configured key policy information and access control policy information and the stacked file system, and improve the security of key data in the database, effectively prevent data leakage, and reduce development and maintenance costs.
[0059] The present application embodiment discloses a specific database transparent encryption and decryption method, see Figure 3 As shown, the method includes:
[0060] Step S21: when an access process that performs a write operation on a database table in a target database is monitored, whether the access process is legal is determined by using pre-configured access control policy information.
[0061] Step S22: if the access process is legal, access the key management component through the stacked file system to obtain the key policy information configured in the key management component; the stacked file system is located in the kernel space.
[0062] Step S23: calling the encryption algorithm corresponding to the database table in the cryptographic algorithm component according to the encryption algorithm information contained in the key policy information, and using the encryption algorithm to perform encryption operation on the database table to be accessed in the target database to obtain an encrypted table space file.
[0063] Step S24: storing the encrypted table space file in the EXT storage system, so as to perform corresponding write operations on the database table by calling the encrypted table space file in the EXT storage system; the file storage system is located in the kernel space.
[0064] In this embodiment, after the database table to be accessed in the target database is encrypted to obtain an encrypted table space file, the encrypted table space file is stored in the EXT storage system located in the kernel space, so that the corresponding write operation can be performed on the database table by calling the encrypted table space file in the EXT storage system.
[0065] For more specific processing procedures of the above steps S21 to S23, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be described in detail here.
[0066] It can be seen that the present application pre-configures key policy information and access control policy information in the kernel space through the TDE plug-in in the user space, and implements transparent encryption and decryption operations of the database table space through the stacked file system in the kernel space, which can achieve encryption and decryption operations of specified table space data independently of parameters such as database type, version, and manufacturer. Since the dependence on database manufacturers and open source version databases is shielded, secondary cooperative development with different manufacturers will not be carried out, thereby effectively reducing development and maintenance costs, and at the same time can effectively prevent the leakage of key data in the database.
[0067] For example, see Figure 4As shown, first configure the key management component through the TDE plug-in or TDE plug-in process, and configure the key policy information of the database, such as the specified tablespace name, the encryption algorithm used and the corresponding key information, etc., into the key management component, that is, step 1; then send the response information after the configuration is completed to the TDE plug-in or TDE plug-in process through the key management component, that is, step 2; then execute steps 3 and 4, configure the accessible process information into the process access control component through the TDE plug-in or TDE plug-in process, and the process information can specifically include the process ID, process signature, etc., so that the process legitimacy can be checked when there is a subsequent process access, and send the response information to the TDE plug-in or TDE plug-in process after the configuration is completed. When the access process of the application operating the database table is monitored, such as when creating a tablespace, step 5 is triggered, and the process access control component first determines whether the service process of the current database is legal (that is, steps 6 and 7). If the service process is not legal, the access is directly terminated, that is, step 8; if the service process is legal, the access is allowed, and then continue to step 9, and after the encryption operation is performed through the stacked file system located in the kernel space, it is stored in the file storage system. Specifically, you can first access the key management component (i.e., steps 10, 11, and 12) to obtain key policy information, and then call the corresponding encryption algorithm in the cryptographic algorithm component to perform encryption operations according to the algorithm configuration information in the key policy information (i.e., steps 13, 14, and 15). After the encryption operation is completed, the ciphertext table space file is stored in the file storage system, and finally the database service process is responded to, so as to perform subsequent operations such as adding, deleting, modifying, and checking the database table. Through the collaborative work between the various components, this solution can encrypt and decrypt the data in the database accessed by the application, and can also perform access control on the service process of the accessed database.
[0068] Correspondingly, the embodiment of the present application also discloses a database transparent encryption and decryption device, see Figure 5 As shown, the device comprises:
[0069] The judging module 11 is used to judge whether the access process is legal by using the pre-configured access control policy information when an access process that performs a write operation on a database table in a target database is detected;
[0070] An information acquisition module 12, configured to acquire pre-configured key policy information through a stacked file system if the access process is legal; the stacked file system is located in the kernel space;
[0071] An algorithm calling module 13, used to call the encryption algorithm corresponding to the database table according to the encryption algorithm information contained in the key policy information;
[0072] An encryption operation module 14 is used to perform encryption operation on the database table to be accessed in the target database using the encryption algorithm to obtain an encrypted table space file;
[0073] The file storage module 15 is used to store the encrypted table space file in the file storage system so as to perform corresponding write operations on the database table by calling the encrypted table space file in the file management system; the file storage system is located in the kernel space.
[0074] Among them, the specific working processes of the above-mentioned modules can refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0075] It can be seen that in the embodiment of the present application, when an access process that performs a write operation on a database table in a target database is monitored, the access process is first judged to be legal through the pre-configured access control policy information. If the access process is legal, the pre-configured key policy information is obtained through the stacked file system located in the kernel space, and then the encryption algorithm corresponding to the database table is called according to the encryption algorithm information contained in the key policy information, and the encryption algorithm is used to perform an encryption operation on the database table to be accessed in the target database to obtain an encrypted table space file, and then the encrypted table space file is stored in the file storage system, so that the corresponding write operation is performed on the database table by calling the encrypted table space file in the file management system located in the kernel space. The embodiment of the present application can realize the encryption and decryption operation of the specified table space data independently of the database type, version, manufacturer and other parameters through the pre-configured key policy information and access control policy information and the stacked file system, and improve the security of key data in the database, effectively prevent data leakage, and reduce development and maintenance costs.
[0076] In some specific embodiments, the database transparent encryption and decryption device may further include:
[0077] A first information acquisition unit is used to acquire key policy information of a target database; the key policy information includes a tablespace name, encryption algorithm information, and key information;
[0078] A first information configuration unit, configured to configure the key policy information into a key management component and a cryptographic algorithm component located in a kernel space through a TDE plug-in located in a user space;
[0079] A second information acquisition unit, used to acquire access control policy information for the service process of the target database;
[0080] A second information configuration unit, configured to configure the access control policy information into a process access control component located in the kernel space through the TDE plug-in;
[0081] Accordingly, the judging module 11 may specifically include:
[0082] The judging unit is used to judge whether the access process is legal through the access control policy information configured in the process access control component.
[0083] In some specific embodiments, the information acquisition module 12 may specifically include:
[0084] An access unit is used to access the key management component and the cryptographic algorithm component through a stacked file system to obtain the key policy information configured in the key management component and the cryptographic algorithm component.
[0085] In some specific embodiments, the algorithm calling module 13 may specifically include:
[0086] An algorithm calling unit is used to call the encryption algorithm corresponding to the database table in the cryptographic algorithm component according to the encryption algorithm information contained in the key policy information.
[0087] In some specific embodiments, the second information acquisition unit may specifically include:
[0088] The third information acquisition unit is used to acquire the process ID and process signature of the service process of the target database to obtain access control policy information.
[0089] In some specific embodiments, the file storage module 15 may specifically include:
[0090] The file storage unit is used to store the encrypted table space file in the EXT storage system, so as to perform a corresponding write operation on the database table by calling the encrypted table space file in the EXT storage system.
[0091] In some specific embodiments, after the file storage module 15, the following may also be included:
[0092] A file acquisition unit, configured to acquire the encrypted tablespace file from the file storage system when an access process performing a read operation on a database table in the target database is detected;
[0093] A decryption unit, configured to perform a decryption operation on the encrypted table space file through the stacked file system to obtain the database table to be accessed;
[0094] The database table sending unit is used to send the database table to the target application that initiates the access process, so as to perform a corresponding read operation on the database table.
[0095] Furthermore, the present application also discloses an electronic device. Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0096] Figure 6 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the database transparent encryption and decryption method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0097] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0098] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0099] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to computer programs that can be used to complete the database transparent encryption and decryption method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs that can be used to complete other specific tasks.
[0100] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed database transparent encryption and decryption method is implemented. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.
[0101] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0102] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0103] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0104] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0105] The above is a detailed introduction to a database transparent encryption and decryption method, device, equipment and storage medium provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A database transparent encryption and decryption method, characterized in that: include: When an access process that performs a write operation on a database table in a target database is detected, whether the access process is legal is determined by using pre-configured access control policy information; If the access process is legal, obtaining pre-configured key policy information through a stacked file system; the stacked file system is located in the kernel space; Calling an encryption algorithm corresponding to the database table according to the encryption algorithm information contained in the key policy information, and performing encryption operation on the database table to be accessed in the target database using the encryption algorithm to obtain an encrypted table space file; The encrypted table space file is stored in a file storage system so that the corresponding write operation is performed on the database table by calling the encrypted table space file in the file management system; the file storage system is located in the kernel space.
2. The database transparent encryption and decryption method according to claim 1 is characterized in that: Also includes: Obtain key policy information of the target database, and configure the key policy information to the key management component and the cryptographic algorithm component in the kernel space through the TDE plug-in in the user space; the key policy information includes the tablespace name, encryption algorithm information and key information; Obtaining access control policy information for the service process of the target database, and configuring the access control policy information into the process access control component located in the kernel space through the TDE plug-in; Accordingly, judging whether the access process is legal by using pre-configured access control policy information includes: Whether the access process is legal is determined by the access control policy information configured in the process access control component.
3. The database transparent encryption and decryption method according to claim 2 is characterized in that: The obtaining of pre-configured key policy information through the stackable file system includes: The key management component and the cryptographic algorithm component are accessed through a stacked file system to obtain the key policy information configured in the key management component and the cryptographic algorithm component.
4. The database transparent encryption and decryption method according to claim 2 is characterized in that: The calling the encryption algorithm corresponding to the database table according to the encryption algorithm information included in the key policy information includes: The encryption algorithm corresponding to the database table in the cryptographic algorithm component is called according to the encryption algorithm information contained in the key policy information.
5. The database transparent encryption and decryption method according to claim 2 is characterized in that: The obtaining of access control policy information for the service process of the target database includes: The process ID and process signature of the service process of the target database are obtained to obtain access control policy information.
6. The database transparent encryption and decryption method according to claim 1 is characterized in that: The step of storing the encrypted tablespace file in a file storage system so as to perform a corresponding write operation on the database table by calling the encrypted tablespace file in the file management system includes: The encrypted table space file is stored in the EXT storage system, so that the corresponding write operation is performed on the database table by calling the encrypted table space file in the EXT storage system.
7. The database transparent encryption and decryption method according to any one of claims 1 to 6, characterized in that: After storing the encrypted tablespace file in the file storage system, the method further includes: When an access process that performs a read operation on a database table in the target database is monitored, obtaining the encrypted tablespace file from the file storage system; The encrypted tablespace file is decrypted by the stacked file system to obtain the database table to be accessed, and the database table is sent to the target application that initiates the access process to perform a corresponding read operation on the database table.
8. A database transparent encryption and decryption device, characterized in that: include: A judgment module, for judging whether the access process is legal by using pre-configured access control policy information when an access process for writing to a database table in a target database is detected; An information acquisition module, configured to acquire pre-configured key policy information through a stacked file system if the access process is legal; the stacked file system is located in the kernel space; An algorithm calling module, used to call the encryption algorithm corresponding to the database table according to the encryption algorithm information contained in the key policy information; An encryption operation module, used to perform encryption operation on the database table to be accessed in the target database using the encryption algorithm to obtain an encrypted table space file; The file storage module is used to store the encrypted table space file in the file storage system so as to perform corresponding write operations on the database table by calling the encrypted table space file in the file management system; the file storage system is located in the kernel space.
9. An electronic device, characterized in that: It comprises a processor and a memory; wherein, when the processor executes the computer program stored in the memory, the database transparent encryption and decryption method as claimed in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the database transparent encryption and decryption method as described in any one of claims 1 to 7 is implemented.
