Data encryption method, system and device based on OCI driver agent
By deploying the OCI driver agent before the database driver to intercept, encrypt and decrypt sensitive data, the adaptation complexity and performance problems of database data encryption in the existing technology are solved, and efficient and stable data encryption protection is achieved.
Patent Information
- Application Number
- CN202410635313.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-05-22
AI Technical Summary
Existing database data encryption technology has problems such as high coupling with database products, limited supported database types, low performance, high adaptation complexity, and poor application transparency. It is difficult to adapt to various databases and achieve efficient data encryption.
Adopt a method based on OCI driver agent, deploy the OCI driver agent process before the database driver, intercept the application system's access to the database driver, parse and selectively encrypt and decrypt sensitive data, and use encryption interception components to monitor the database driver in the operating system kernel space. system calls to achieve high-performance and low-complexity data encryption.
It implements a data encryption protection scheme with a wider scope of application and high performance, reduces processing complexity and stability, avoids the need to modify the application system, and adapts to all functions of the target database.
Smart Images

Figure CN118228292B
Abstract
Description
Technical Field
[0001] The present application relates to the field of driver agent technology, and in particular to a data encryption method, system and device based on OCI driver agent. Background Art
[0002] At present, there are a large number of high-value data in the information systems of enterprises and institutions. These data are generally stored in databases. They are the core assets of the system and the targets of attackers. Once the data is leaked, it will bring immeasurable losses. In order to safeguard the interests of enterprises and institutions, it is necessary to pay attention to protecting the data security of enterprises, and the database is the focus of security protection. Encrypting key and sensitive data in the database is the most economical and effective means of security protection.
[0003] With the rapid development of database technology, the current data encryption technologies in the industry mainly include:
[0004] Database transparent encryption:
[0005] This technology uses the transparent encryption and decryption functions of the database product itself to implement data encryption at the table space or data column granularity. The disadvantage is that it is highly coupled with the database product itself, supports fewer database types, and is limited by the database product design and cannot use Chinese commercial encryption algorithms.
[0006] Database backend proxy:
[0007] The essence of this technology is actually a database plug-in. After the database engine receives an operation request from the application system, it implements data encryption and decryption through the use of views, triggers, extended indexes and custom functions, and retrieves encrypted data. The disadvantage is that in scenarios with large amounts of data, the performance of triggers will be significantly reduced. In addition, the use of views requires some modifications on the application side, which cannot be completely transparent to the application and makes it difficult to implement access control.
[0008] Database front-end proxy and encryption gateway:
[0009] This technology adds a security proxy service in front of the database. All application-side access to the database must go through the security proxy service. Data encryption and decryption, access control, and then the security proxy service implements data storage through the database access interface. The disadvantage is that it needs to adapt to the internal communication protocol of each database. The protocol interfaces of different database products or different versions of the same database product are different. Some protocol contents are not public, resulting in a large workload for adaptation.
[0010] Application layer transformation:
[0011] When the application system adds, deletes, or modifies data, it encrypts sensitive data through the encryption and decryption API and stores the encrypted data in the database through the original database driver interface. When retrieving data, the ciphertext data is retrieved back to the application side and decrypted through the encryption and decryption API. The disadvantage is that the application must be remodeled on a large scale, adding logic for calling the encryption and decryption API to encrypt and decrypt the data, which increases the complexity of programming. It is also impossible to be transparent to the existing application system, making the transformation extremely difficult.
[0012] Universal driver proxy encryption:
[0013] This solution adds a proxy service between the application system and the general database driver, and implements data encryption and decryption of data columns by intercepting the read and write access through the general database driver interface. The disadvantage is that it can only be loaded based on a certain general database driver (such as JDBC, etc.), and it is difficult to adapt to other special database drivers or various native database drivers. In addition, due to the limitations of the functions of the general driver, it cannot adapt to the database dialect grammar and unique functions.
[0014] Therefore, developing a data encryption method that can overcome the above technical shortcomings has a large application space. Summary of the invention
[0015] The main purpose of this application is to provide a data encryption method, system and device based on OCI driver agent to achieve a high-performance data encryption protection solution with a wider range of applications.
[0016] In order to achieve the above object, the present application provides: a data encryption method based on OCI driver agent, the method comprising:
[0017] Deploy the OCI driver agent process before the database driver;
[0018] Intercept the application system's access to the database driver;
[0019] Parse the application system's read or write calls to the database interface based on the intercepted content;
[0020] Selectively encrypt and decrypt read or write calls, and call the database driver to access the database.
[0021] Further, the method of intercepting the application system's access to the database driver includes:
[0022] Deploy an encryption interception component in the operating system, wherein the encryption interception component resides in the kernel space of the operating system;
[0023] By means of the encryption interception component, a monitoring probe is set at the entrance and exit of the kernel used for system calls by the database driver;
[0024] The system call of the database driver is identified by the monitoring probe.
[0025] Further, the identifying the system call of the database driver by the monitoring probe specifically includes:
[0026] When the target application system to be intercepted calls the API interface of the database driver to perform operations of reading and writing the database, the system call of the database driver is executed, thereby triggering the monitoring probe.
[0027] Further, the method of performing encryption and decryption processing on the read or write call and calling the database driver to access the database specifically includes:
[0028] Identify the sensitive data and meta-information corresponding to the sensitive data involved in the application system's read or write calls to the database interface after analysis;
[0029] Call the corresponding encryption and decryption strategy based on sensitive data.
[0030] Furthermore, after calling the corresponding encryption and decryption strategy according to the sensitive data, the method further includes:
[0031] Call the built-in interface function of the encryption interception component and cooperate with the encryption and decryption strategy to complete the encryption and decryption processing of the read or write call;
[0032] Call the original database driver's system call to perform the original DB read and write processing;
[0033] The encryption interception component obtains the results of the corresponding DB read and write processing, performs decryption processing, and returns the decrypted results to the application system.
[0034] Furthermore, the OCI driver proxy process and the application system run independently of each other.
[0035] This embodiment further discloses a data encryption system based on an OCI driver agent, the system comprising:
[0036] Deployment module, used to deploy the OCI driver agent process before the database driver;
[0037] The OCI driver proxy module is used to intercept the application system's access to the database driver through the OCI driver proxy process, and is also used to:
[0038] Parse the application system's read or write calls to the database interface based on the intercepted content;
[0039] The data encryption module is used to selectively encrypt and decrypt read or write calls and call the database driver to access the database.
[0040] Furthermore, the system further comprises:
[0041] The data encryption management module is used to identify the sensitive data and meta-information corresponding to the sensitive data involved in the application system's read or write calls to the database interface after parsing; it is also used to,
[0042] Call the corresponding encryption and decryption strategy based on sensitive data.
[0043] This embodiment further discloses a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method is implemented.
[0044] This embodiment further discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-described method when executing the program.
[0045] Compared with the prior art, the OCI-driven data encryption method, system and device provided by the present invention have the following beneficial effects:
[0046] 1. By completing the deployment of the OCI driver agent on the application side, the data content between the application system and the database can be protected. At the same time, the OCI driver agent process is implemented by intercepting related calls instead of triggering them, so it has higher processing performance.
[0047] 2. The interception of the database driver interface only involves processing the calls of the relevant interfaces, but does not involve the internal protocols of the database. Therefore, the processing complexity is lower and the processing stability is higher.
[0048] 3. By intercepting the database driver interface, there is no need to transform and develop the application system, and deployment and implementation are more convenient; at the same time, all functions of the target database can be adapted, which can effectively make up for the problem of single function of general database. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The drawings constituting a part of this application are used to provide a further understanding of this application, so that other features, purposes and advantages of this application become more obvious. The schematic embodiment drawings and their descriptions of this application are used to explain this application and do not constitute an improper limitation on this application. In the drawings:
[0050] Figure 1 This is a flow chart of the data encryption method of the OCI driver agent in this embodiment;
[0051] Figure 2 This is a schematic diagram of the structure of the data encryption system based on the OCI driver agent in this embodiment;
[0052] Figure 3This is a schematic diagram of the database application scenario structure based on the OCI driver agent in this embodiment. DETAILED DESCRIPTION
[0053] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present application.
[0054] It should be noted that the terms "first", "second", etc. in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0055] In the present application, the terms "upper", "lower", "left", "right", "front", "back", "top", "bottom", "inner", "outer", "middle", "vertical", "horizontal", "lateral", "longitudinal" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings. These terms are mainly used to better describe the present application and its embodiments, and are not used to limit the indicated devices, elements or components to have a specific orientation, or to be constructed and operated in a specific orientation.
[0056] In addition, some of the above terms may be used to express other meanings in addition to indicating orientation or positional relationship. For example, the term "on" may also be used to express a certain dependency or connection relationship in some cases. For those of ordinary skill in the art, the specific meanings of these terms in this application can be understood according to specific circumstances.
[0057] In addition, the term "plurality" shall mean two or more.
[0058] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0059] With the rapid development of database technology, the use of databases has become the main choice for data storage, followed by the application of data management. More importantly, it is the security protection of data in the database, that is, multi-level protection for the storage, transmission and use of sensitive data to ensure the data security of business systems.
[0060] refer to Figure 1 , is a flow chart of a data encryption method based on an OCI driver agent, and the data encryption method based on an OCI driver agent includes the following steps:
[0061] S100: Deploy the OCI driver agent process before the database driver.
[0062] The database driver is a native database driver. This embodiment uses the OCI driver as an example. It should be understood that the same is applicable to other native database drivers. Specifically, the OCI driver proxy process is set between the application system and the OCI driver. The OCI driver proxy process and the application system are independent of each other and can be independently loaded and run. Therefore, they are not affected by the architecture of the application system, and the deployment is more flexible and the operation stability is higher.
[0063] Furthermore, the OCI driver proxy process does not need to be associated with the application system settings, but only needs to be associated with the database driver. For example, the OCI driver proxy process is associated with the OCI driver, and the module architecture is simpler. Therefore, the OCI driver proxy technology in this embodiment does not rely on the general database driver interface, and is therefore not functionally limited by the functional limitations of the general database driver interface.
[0064] S200: Intercept the access of the application system to the database driver.
[0065] The application system accesses the database by issuing a system call. The OCI driver proxy process intercepts the system call before the database. At this time, the OCI driver cannot receive the system call. At the same time, the interception technology is used instead of the triggering method, so the processing performance of the system is much higher than the access control implemented by the traditional post-proxy.
[0066] The principle of intercepting the application system's access to the database driver is as follows: intercept the call to the OCI driver at the core layer of the operating system, create a kernel probe (kprobe) through the trace system at the core layer, and monitor and intercept the function call of the OCI driver through the kernel probe. The specific methods include:
[0067] S210: Deploy an encryption interception component in the operating system, where the encryption interception component resides in the kernel space of the operating system.
[0068] S220: Setting a monitoring probe at the entrance and exit of the kernel used for system calls by the database driver through an encryption interception component.
[0069] S230: Identify the system call of the database driver through the monitoring probe.
[0070] Specifically, the monitoring probe identifies the database-driven system call, including: when the target application system to be intercepted calls the database-driven API interface and performs operations to read and write the database, the database-driven system call is executed, thereby triggering the monitoring probe. Since only the API interface call needs to be intercepted, the internal information of the database protocol will not be involved, so the processing complexity of the related calls is much lower than that of the traditional database front-end proxy and encryption gateway that achieves this effect, further improving the processing performance and stability.
[0071] It should be noted that the above-mentioned operating system refers to the module of the kernel space of the system in the complete application scenario, and the application system refers to the module of the user space of the system in the complete application scenario.
[0072] Furthermore, after the monitoring probe identifies the system call of the database driver, the access of the application system to the database driver is intercepted, and the data encryption method based on the OCI driver agent further includes:
[0073] S300: Parsing the read or write call of the application system to the database interface according to the intercepted content.
[0074] Specifically, the parsed read or write call contains data corresponding to the corresponding operation request, where the data is sensitive data and non-sensitive data. It should be noted that sensitive data and non-sensitive data are defined in advance, and the system records the meta information of sensitive data in the database and the encryption and decryption strategy corresponding to the sensitive data.
[0075] After obtaining relevant attributes of the data, the data encryption method based on the OCI driver agent further includes:
[0076] S400: selectively encrypt and decrypt the read or write call, and call the database driver to access the database.
[0077] Specific:
[0078] S410: Identify the sensitive data and meta-information corresponding to the sensitive data involved in the read or write call of the application system to the database interface after the analysis.
[0079] S420: Perform encryption and decryption on the sensitive data by calling the corresponding encryption and decryption strategy according to the sensitive data.
[0080] After calling the corresponding encryption and decryption strategy according to the sensitive data, the method further includes:
[0081] S430: Calling the built-in interface function of the encryption interception component to cooperate with the encryption and decryption strategy to complete the encryption and decryption processing of sensitive data for the read or write call;
[0082] S440: calling the original database driver system call to execute the original DB read and write processing;
[0083] S450: The encryption interception component obtains the result of the corresponding DB read and write processing, performs decryption processing, and returns the decrypted result to the application system.
[0084] It should be noted that in step S400, the encryption and decryption processing in the selective encryption and decryption processing of the read or write call only involves sensitive data. For example, for the encryption processing of sensitive data, the sensitive data is encrypted using the above-mentioned encryption strategy, and then the original database-driven system call is called to write the encrypted sensitive data into the database. For the reading of sensitive data, the read call is encrypted, and the encrypted read call is used to call the original database-driven system call to extract the encrypted data from the database, and the encrypted data is decrypted or desensitized according to the encryption and decryption strategy, and the data is transmitted back to the application system. For non-sensitive data, the original data is retained for reading and writing the database.
[0085] The meta information and encryption / decryption strategies of the sensitive data involved above are all determined in a custom way and stored in the operating system. The meta information specifically includes: the database information, table information, column information and row information of the database where the sensitive data is located, and the encryption / decryption strategy includes the location information of the data, the encryption method used, and the entity information with the permission to use the original sensitive data.
[0086] Exemplary, reference Figure 3, the database driver takes the OCI driver as an example. In the application scenario, the application system initiates a system call, which is a call command in the user space. The kernel probe of the core layer of the operating system in the kernel space identifies the system call for calling the OCI driver library function, intercepts the system call, thereby intercepting the system call of the database driver, namely the OCI driver, and then realizing the OCI driver agent. This interception method completes the interception operation in the core layer of the operating system, and the interception is more sufficient. The system call will not be missed, and it will not be bypassed by the user process. Any system call can be intercepted. The intercepted system call is parsed, and the sensitive data involved in the system call and the meta information corresponding to the sensitive data are obtained. At the same time, the encryption and decryption strategy set in advance for the sensitive data is obtained. At this time, the built-in interface function of the encryption interception component is called to cooperate with the encryption and decryption strategy to complete the encryption and decryption processing of the read or write call of the sensitive data, and then the OCI driver is called to perform the original DB read and write processing on the database through the database engine. Before performing the DB read and write processing, it must also be processed by the relevant processing of the upper-layer service of the application. The database returns the result value of the DB read and write processing to the encryption interception component, and decrypts it, and returns the decrypted result to the application system.
[0087] refer to Figure 2 This embodiment further discloses a data encryption system based on an OCI driver agent, including:
[0088] The deployment module 31 is used to deploy the OCI driver agent process before the database driver; and is also used to:
[0089] An encryption interception component is deployed in the operating system, and the encryption interception component resides in the kernel space of the operating system.
[0090] The OCI driver proxy module 32 is used to intercept the application system's access to the database driver through the OCI driver proxy process, and is also used to:
[0091] Parse the application system's read or write calls to the database interface based on the intercepted content.
[0092] Through the encryption interception component, monitoring probes are set at the entrance and exit of the kernel used by the database driver for system calls.
[0093] Identify database driver system calls through monitoring probes.
[0094] The data encryption module 33 is used to selectively encrypt and decrypt the read or write call, and call the database driver to access the database. In this embodiment, the data encryption module 33 also includes a cryptographic software module that supports Chinese commercial encryption and international cryptographic algorithms to improve the encryption and decryption capabilities of the data encryption module 33.
[0095] The data encryption management module 34 is used to identify the sensitive data and meta-information corresponding to the sensitive data involved in the application system's read or write call to the database interface after parsing; and is also used to:
[0096] Invoke the corresponding encryption and decryption strategy according to the sensitive data. In one or more embodiments, the data encryption management module 34 is also used to manage the entity access rights and encryption and decryption keys of the sensitive data in the database through the network.
[0097] The OCI driver proxy module 32 is also used to call the built-in interface function of the encryption interception component to complete the encryption and decryption processing of the read or write call in coordination with the encryption and decryption strategy after the data encryption management module 34 obtains the encryption and decryption strategy corresponding to the sensitive data; call the original database driver system call to execute the original DB read and write processing; and also used to,
[0098] The encryption interception component obtains the results of the corresponding DB read and write processing, performs decryption processing, and returns the decrypted results to the application system.
[0099] This embodiment further provides an electronic device, the electronic device comprising: a processor, a memory, and a bus;
[0100] The processor and the memory communicate with each other via a bus; the processor is used to call program instructions in the memory to execute the methods provided by the above-mentioned method embodiments.
[0101] This embodiment provides a non-transitory computer-readable storage medium, which stores computer instructions. The computer instructions enable a computer to execute the methods provided by the above method embodiments.
[0102] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various storage media that can store program codes.
[0103] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0104] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0105] The specific manner of executing the operation of each unit in the above embodiment has been described in detail in the embodiment of the method, and will not be elaborated here.
[0106] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A data encryption method based on OCI driver agent, characterized in that: The method comprises: Deploy the OCI driver agent process before the database driver; The OCI driver proxy process and the application system run independently of each other; The OCI driver proxy process is independent of the application system and can be independently run and loaded. The OCI driver proxy process does not need to be associated with the application system settings, but only needs to be associated with the database driver; Intercept the application system's access to the database driver; The method of intercepting the access of the application system to the database driver includes: Deploy an encryption interception component in the operating system, wherein the encryption interception component resides in the kernel space of the operating system; By means of the encryption interception component, a monitoring probe is set at the entrance and exit of the kernel used for system calls by the database driver; Identifying a system call driven by the database through the monitoring probe; The identifying the system call of the database driver by the monitoring probe specifically includes: When the target application system to be intercepted calls the API interface of the database driver to perform operations of reading and writing the database, the system call of the database driver is executed, thereby triggering the monitoring probe; Parse the application system's read or write calls to the database interface based on the intercepted content; Selectively encrypt and decrypt read or write calls, and call the database driver to access the database.
2. The data encryption method based on OCI driver agent according to claim 1, characterized in that: The method of selectively encrypting and decrypting the read or write call and calling the database driver to access the database specifically includes: Identify the sensitive data and meta-information corresponding to the sensitive data involved in the application system's read or write calls to the database interface after analysis; Call the corresponding encryption and decryption strategy based on sensitive data.
3. The data encryption method based on OCI driver agent according to claim 2, characterized in that: After calling the corresponding encryption and decryption strategy according to the sensitive data, the method further includes: Call the built-in interface function of the encryption interception component and cooperate with the encryption and decryption strategy to complete the encryption and decryption processing of the read or write call; Call the original database driver's system call to perform the original DB read and write processing; The encryption interception component obtains the results of the corresponding DB read and write processing, performs decryption processing, and returns the decrypted results to the application system.
4. A data encryption system based on OCI driver agent, characterized in that: The system comprises: Deployment module, used to deploy the OCI driver agent process before the database driver; The OCI driver proxy process and the application system run independently of each other; The OCI driver proxy process is independent of the application system and can be independently run and loaded. The OCI driver proxy process does not need to be associated with the application system settings, but only needs to be associated with the database driver; OCI driver proxy module, used to intercept the application system's access to the database driver; The method of intercepting the access of the application system to the database driver includes: Deploy an encryption interception component in the operating system, wherein the encryption interception component resides in the kernel space of the operating system; By means of the encryption interception component, a monitoring probe is set at the entrance and exit of the kernel used for system calls by the database driver; Identifying a system call driven by the database through the monitoring probe; The identifying the system call of the database driver by the monitoring probe specifically includes: When the target application system to be intercepted calls the API interface of the database driver to perform the operation of reading and writing the database, the system call of the database driver is executed, thereby triggering the monitoring probe; and also used for, Parse the application system's read or write calls to the database interface based on the intercepted content; The data encryption module is used to selectively encrypt and decrypt read or write calls and call the database driver to access the database.
5. The data encryption system based on OCI driver agent as claimed in claim 4, characterized in that: The system further comprises: The data encryption management module is used to identify the sensitive data and meta-information corresponding to the sensitive data involved in the application system's read or write calls to the database interface after parsing; it is also used to, Call the corresponding encryption and decryption strategy based on sensitive data.
6. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of claims 1 to 3 is implemented.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method described in any one of claims 1 to 3 is implemented.
