A cloud database audit method, device and server
By obtaining and filtering the SQL audit log and protection object configuration information of the cloud database and matching rules, the problem that traditional database audit methods cannot audit the cloud database is solved, and security audit of the cloud database is realized.
Patent Information
- Application Number
- CN202011459765.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-11
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-12-11
AI Technical Summary
Traditional database auditing methods cannot directly obtain traffic from cloud databases, resulting in the inability to audit cloud databases, affecting data security.
By obtaining SQL audit logs and protection object configuration information, filtering and matching rules, generating audit records that comply with audit equipment, and inserting them into the audit system database to realize auditing of cloud databases.
The audit of cloud databases is realized, ensuring the security of data in cloud databases is solved, and the limitation that traditional methods cannot audit cloud databases.
Smart Images

Figure CN112416909B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of database auditing, and in particular to a method, device and server for auditing a database on a cloud. Background Art
[0002] Database audit (DB Audit for short) can record database activities on the network in real time, conduct fine-grained audit compliance management on database operations, issue warnings on risky behaviors encountered by the database, and block attack behaviors. It helps users generate compliance reports and trace the source of accidents after the fact by recording, analyzing and reporting on user access to the database, while strengthening the recording of internal and external database network behaviors and improving data asset security.
[0003] The traditional database audit architecture can directly use port mirroring or plug-in diversion to filter the desired traffic to the audit device, but the cloud database has restrictions on this. We cannot directly obtain traffic through the above methods, and thus cannot audit the cloud database. Summary of the invention
[0004] Based on this, it is necessary to provide a cloud database audit method, device and server to address the above technical problems, which can realize the audit of the cloud database and thus ensure the security of the data in the cloud database.
[0005] In a first aspect, an embodiment of the present invention provides a method for auditing a database on a cloud, the method comprising:
[0006] Get SQL audit logs;
[0007] Get the content of the protection object configuration information;
[0008] Screening the contents of the SQL audit log and the protected object configuration information to obtain audit records;
[0009] Performing regulation matching on the audit records to obtain new audit records;
[0010] The new audit record is inserted into the audit system's database.
[0011] In some embodiments, obtaining the SQL audit log includes:
[0012] Display the configuration page;
[0013] Obtaining registration information based on input on the configuration page;
[0014] The API interface is called according to the registration information to obtain the SQL audit log.
[0015] In some embodiments, the filtering of the contents of the SQL audit log and the protected object configuration information to obtain the audit record includes:
[0016] Based on the same fields and / or IP addresses, the content of the SQL audit log is combined with the content of the protection object configuration in the audit system to obtain an audit record.
[0017] In some embodiments, before combining the content of the SQL audit log with the content of the protected object configuration in the audit system based on the IP address to obtain the audit record, the method further includes:
[0018] The fields of the SQL audit log content are segmented by characters to obtain the host address field.
[0019] In some embodiments, combining the content of the SQL audit log with the content of the protection object configuration in the audit system based on the IP address to obtain the audit record includes:
[0020] Compare the host address field with the IP address;
[0021] If the host address field is consistent with the IP address, the content of the SQL audit log is combined with the content of the protection object configuration to obtain an audit record.
[0022] In some embodiments, combining the content of the SQL audit log with the content of the protection object configuration in the audit system based on the same field to obtain the audit record includes:
[0023] Compare the fields of the SQL audit log content with the fields of the content of the protection object configuration;
[0024] If they are consistent, the content corresponding to the field of the SQL audit log is combined with the content corresponding to the field of the protection object configuration in the audit system to obtain an audit record.
[0025] In some embodiments, performing regulation matching on the audit record to obtain a new audit record includes:
[0026] The audit record is matched with the rules called by the rule engine to fill in the fields in the audit record and obtain a new audit record.
[0027] In a second aspect, an embodiment of the present invention further provides a cloud database auditing device, including:
[0028] The first acquisition module is used to obtain SQL audit logs;
[0029] The second acquisition module is used to acquire the content of the protection object configuration information;
[0030] A screening module, used to screen the contents of the SQL audit log and the protection object configuration information to obtain audit records;
[0031] A matching module, used for performing regulation matching on the audit records to obtain new audit records;
[0032] The insert module is used to insert the new audit record into the database of the audit system.
[0033] In a third aspect, an embodiment of the present invention further provides a server, including:
[0034] at least one processor; and,
[0035] a memory communicatively connected to the at least one processor; wherein,
[0036] The memory stores instructions that can be executed by the at least one processor, the instructions
[0037] It is executed by the at least one processor so that the at least one processor can execute the above-mentioned cloud database auditing method.
[0038] In a fourth aspect, an embodiment of the present invention further provides a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are executed by a processor, the processor executes the above-mentioned cloud database auditing method.
[0039] Compared with the prior art, the beneficial effects of the present invention are: different from the prior art, the cloud database audit method, device and server in the embodiments of the present invention separate the log by adopting SQL insight, and then filter the SQL audit log in combination with the content of the protection object configuration information to generate an audit record that complies with the audit device, and then match the audit record with rules through the background program to obtain a new audit record, and finally insert the new audit record into the database, thereby realizing the audit of the cloud database, thereby ensuring the security of the data in the cloud database. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0041] Figure 1 It is a schematic diagram of the hardware structure of the server of the present invention;
[0042] Figure 2It is a flowchart of a cloud database audit method in one embodiment of the present invention;
[0043] Figure 3 It is a structural block diagram of a cloud database auditing device in one embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] It should be noted that, if there is no conflict, the various features in the embodiments of the present invention can be combined with each other, all within the scope of protection of the present invention. In addition, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order from the module division in the device or the flow chart. Furthermore, the words "first", "second", "third", etc. used in the present invention do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.
[0046] The embodiment of the present invention provides a server, see Figure 1 As shown, Figure 1 A hardware structure diagram of a server provided in an embodiment of the present invention, wherein the server 100 can be any type of device with computing capabilities, such as an audit server.
[0047] Specifically, Figure 1 As shown, the server 100 includes one or more processors 102 and a memory 104 . Figure 1 A processor 102 is taken as an example. The processor 102 and the memory 104 may be connected via a bus or other means. Figure 1 The example of connecting through bus is taken in the following.
[0048] The memory 104 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as programs, instructions and modules corresponding to the cloud database audit method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 104, that is, implementing the cloud database audit method in the following embodiment.
[0049] The memory 104 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created according to the use of the cloud database audit device, etc. In addition, the memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 104 may optionally include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the cloud database audit device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0050] like Figure 2 As shown, an embodiment of the present invention provides a method for auditing a database on a cloud, the method being executed by a server, and the method comprising:
[0051] Step 202: Obtain SQL audit logs.
[0052] In the embodiment of the present invention, the SQL audit log is stored in the cloud database, and the SQL audit log can also be understood as the SQL insight log, which records all operations on the database. Specifically, the server obtains the SQL audit log in the cloud database.
[0053] In some of the embodiments, as an implementation of step 202, it includes: displaying a configuration page; obtaining registration information based on the input of the configuration page; calling an API interface according to the registration information to obtain a SQL audit log.
[0054] In the embodiment of the present invention, if you want to obtain SQL audit logs, you need to register in advance. The registration information is parameter information, including but not limited to key ID, key signature string, signature result string, timestamp, etc., where key ID is similar to an account, key signature string is similar to a password, and result signature string is similar to a verification code. Specifically, register the database insight log through the configuration interface, and then generate SDK code to generate SQL audit logs, and then call the API interface through the registration information, that is, parameter information, to obtain the SQL audit logs in the cloud database.
[0055] Step 204: Obtain the content of the protection object configuration information.
[0056] In the embodiment of the present invention, the protection object configuration information is stored in the audit system, and the content of the protection object configuration information includes but is not limited to the original IP address of the protection object, the policy of the protection object, the rule of the protection object, the port and the database version number, etc. Specifically, the server obtains the content of the protection object configuration information from the audit system.
[0057] Step 206: Screen the contents of the SQL audit log and the protection object configuration information to obtain audit records.
[0058] In an embodiment of the present invention, the audit record is a record that complies with the audit device. The audit record is obtained by screening the contents of the SQL audit log and the protection object configuration information. However, the audit record obtained after screening is an incomplete audit record file and needs to be processed subsequently.
[0059] In some of the embodiments, as an implementation of step 206, it includes: based on the same field and / or IP address, combining the content of the SQL audit log with the content of the protection object configuration in the audit system to obtain the audit record.
[0060] In an embodiment of the present invention, there are multiple ways to obtain audit records, including but not limited to based on the same fields and / or IP addresses. Among them, the audit record is obtained based on the IP address, and the host address field is compared with the IP address; if the host address field is consistent with the IP address, the content of the SQL audit log and the content of the protection object configuration are combined to obtain the audit record. Specifically, after the server calls the API interface through parameter information, it will generate a return content in a certain format, such as jsson format or xml format, etc. The return content contains the fields of the SQL audit log content, and then the string segmentation function is used to perform string segmentation on the fields of the SQL audit log content, extract the host address field, and then compare the host address field with the original IP address of the protection object. If the host address field is the same as the original IP address of the protection object, the content of the SQL audit log and the content of the protection object configuration are combined to form an audit record.
[0061] In addition, based on the same field to obtain the audit record, the field of the SQL audit log content is compared with the field of the content of the protection object configuration; if they are consistent, the content corresponding to the field of the SQL audit log is combined with the content corresponding to the field of the protection object configuration in the audit system to obtain the audit record. Specifically, after the server calls the API interface through parameter information, it will generate a return content in a certain format, such as jsson format or xml format, etc. The return content contains the field of the SQL audit log content. Through the same field, the content corresponding to the field of the SQL audit log is combined with the content corresponding to the field of the protection object configuration in the audit system to form an audit record suitable for the database audit server.
[0062] Step 208: Perform regulation matching on the audit record to obtain a new audit record.
[0063] In the embodiment of the present invention, the new audit record is a complete audit record file, and the new audit record includes the original IP address, the original port, the operation statement, the client subject information, the occurrence time, etc., wherein the client subject information includes but is not limited to the database name, the database access tool, the database account, etc. Specifically, after the audit record is obtained, the audit record needs to be regulated and matched to obtain an audit record that complies with the audit system.
[0064] In some of the embodiments, as an implementation of step 208, it includes: matching the audit record with the rules called by the rule engine to fill in the fields in the audit record to obtain a new audit record.
[0065] In an embodiment of the present invention, a new audit record must be a complete audit record, and the rules called by the rule engine include but are not limited to keywords, operation types, rule effective time, and rule whitelists. Specifically, the server matches the obtained audit record with the rules called by the rule engine. The main purpose of the match is to fill in the audit record again. Because the audit record obtained by the previous screening is incomplete, it is necessary to use the rule engine to judge certain fields of the audit record to determine whether the field is missing some content. If there is a missing, the rule engine calls the rule to fill in the missing content of the audit record with a new field to generate an audit record that complies with the audit system. Exemplarily, if the audit record is missing a keyword, the rule engine calls the keyword to fill in the audit record, thereby generating an audit record that complies with the audit system.
[0066] Step 210: insert the new audit record into the database of the audit system.
[0067] The server stores the new audit record into the database.
[0068] In an embodiment of the present invention, the log is separated by adopting the SQL insight method, and then the SQL audit log is screened in combination with the content of the protection object configuration information to generate an audit record that complies with the audit device. Then, the audit record is matched with the rules through the background program to obtain a new audit record, and finally the new audit record is inserted into the database, thereby realizing the audit of the cloud database, thereby ensuring the security of the data in the cloud database.
[0069] It should be noted that, in each of the above embodiments, there is not necessarily a certain order between the above steps. A person skilled in the art can understand, based on the description of the embodiments of the present invention, that in different embodiments, the above steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.
[0070] Accordingly, the embodiment of the present invention further provides a cloud database auditing device 300, as shown in FIG3, including:
[0071] The first acquisition module 302 is used to acquire SQL audit logs;
[0072] The second acquisition module 304 is used to acquire the content of the protection object configuration information;
[0073] A screening module 306, used to screen the contents of the SQL audit log and the protection object configuration information to obtain audit records;
[0074] A matching module 308, used to perform regulation matching on the audit records to obtain new audit records;
[0075] Insertion module 310 is used to insert the new audit record into the database of the audit system.
[0076] The cloud database audit device provided by the embodiment of the present invention obtains the SQL audit log through the first acquisition module, then obtains the content of the protection object configuration information through the second acquisition module, and then screens the SQL audit log and the content of the protection object configuration information through the screening module to obtain the audit record, and further, regulates and matches the audit record through the matching module to obtain a new audit record, and finally inserts the new audit record into the database of the audit system through the insertion module, thereby realizing the audit of the cloud database, thereby ensuring the security of the data in the cloud database.
[0077] Optionally, in other embodiments of the device, please refer to Figure 3 As shown, the device 300 also includes:
[0078] The segmentation module 312 is used to perform character segmentation on the fields of the SQL audit log content to obtain the host address field.
[0079] Optionally, in other embodiments of the device, the first acquisition module 302 is specifically used for:
[0080] Display the configuration page;
[0081] Obtaining registration information based on input on the configuration page;
[0082] The API interface is called according to the registration information to obtain the SQL audit log.
[0083] Optionally, in other embodiments of the device, the screening module 306 is specifically used for:
[0084] Based on the same fields and / or IP addresses, the content of the SQL audit log is combined with the content of the protection object configuration in the audit system to obtain an audit record.
[0085] Compare the host address field with the IP address;
[0086] If the host address field is consistent with the IP address, the content of the SQL audit log is combined with the content of the protection object configuration to obtain an audit record.
[0087] Compare the fields of the SQL audit log content with the fields of the content of the protection object configuration;
[0088] If they are consistent, the content corresponding to the field of the SQL audit log is combined with the content corresponding to the field of the protection object configuration in the audit system to obtain an audit record.
[0089] Optionally, in other embodiments of the device, the matching module 308 is specifically configured to:
[0090] The audit record is matched with the rules called by the rule engine to fill in the fields in the audit record and obtain a new audit record.
[0091] It should be noted that the above-mentioned cloud database audit device can execute the cloud database audit method provided by the embodiment of the present invention, and has the functional modules and beneficial effects of the execution method application. For technical details that are not fully described in the embodiment of the cloud database audit device of the present invention, refer to the cloud database audit method provided by the embodiment of the present invention.
[0092] An embodiment of the present invention also provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the one or more processors can execute the cloud database audit method in any of the above method embodiments.
[0093] The server of the embodiment of the present invention exists in various forms, including but not limited to:
[0094] (1) Tower Server
[0095] A general tower server case is similar to the PC case we usually use, but a large tower case is much larger. In general, there is no fixed standard for the external dimensions.
[0096] (2) Rack-mounted servers
[0097] Rack-mounted servers are servers with a standard width of 19-inch racks, and the height ranges from 1U to several U, in order to meet the needs of dense deployment in enterprises. Placing servers on racks is not only conducive to daily maintenance and management, but also may avoid unexpected failures. First, placing servers does not take up too much space. Rack servers are neatly arranged in the rack, without wasting space. Secondly, connecting wires can also be neatly stored in the rack. Power cords and LAN cables can all be laid out in the cabinet, which can reduce the number of connecting wires piled on the ground, thereby preventing accidents such as kicking off the wires. The specified dimensions are the width (48.26cm = 19 inches) and height (multiples of 4.445cm) of the server. Since the width is 19 inches, racks that meet this requirement are sometimes called "19-inch racks."
[0098] (3) Blade Server
[0099] Blade server is a low-cost server platform with HAHD (High Availability High Density), which is specially designed for special application industries and high-density computer environments. Each "blade" is actually a system motherboard, similar to an independent server. In this mode, each motherboard runs its own system and serves different designated user groups, and there is no connection between them. However, these motherboards can be combined into a server cluster using system software. In cluster mode, all motherboards can be connected to provide a high-speed network environment, share resources, and serve the same user group.
[0100] (4) Cloud Server
[0101] Cloud server (Elastic Compute Service, ECS) is a simple, efficient, secure, reliable, and elastically scalable computing service. Its management method is simpler and more efficient than that of physical servers. Users can quickly create or release any number of cloud servers without having to purchase hardware in advance. The distributed storage of cloud servers is used to integrate a large number of servers into a supercomputer, providing a large amount of data storage and processing services. Distributed file systems and distributed databases allow access to common storage resources and achieve IO sharing of application data files. Virtual machines can break through the limitations of a single physical machine, and dynamic resource adjustment and allocation eliminate single points of failure of servers and storage devices to achieve high availability.
[0102] 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, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0103] Through the description of the above implementation methods, ordinary technicians in this field can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Ordinary technicians in this field can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only disk, or a computer program.
[0104] Storage memory (Read-Only Memory, ROM) or random access memory (Random Access Memory, RAM), etc.
[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them. Under the concept of the present invention, the technical features in the above embodiments or different embodiments may also be combined, the steps may be implemented in any order, and there are many other changes in different aspects of the present invention as described above, which are not provided in detail for the sake of simplicity. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they may still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A cloud database audit method, characterized in that: The method comprises: Display the configuration page; Acquire registration information input based on the configuration page, wherein the registration information includes a secret key ID, a secret key signature string, and a signature result string; Call the API interface according to the registration information to obtain the SQL audit log; Get the content of the protection object configuration information; Screening the contents of the SQL audit log and the protected object configuration information to obtain audit records; Matching the audit record with the rule called by the rule engine to fill in the fields in the audit record to obtain a new audit record, wherein the rule called by the rule engine includes a keyword and an operation type, and the new audit record is a complete audit record; The new audit record is inserted into the audit system's database.
2. The method according to claim 1, characterized in that The screening of the contents of the SQL audit log and the protection object configuration information to obtain the audit record includes: Based on the same fields and / or IP addresses, the content of the SQL audit log is combined with the content of the protection object configuration in the audit system to obtain an audit record.
3. The method according to claim 2, characterized in that Before obtaining the audit record by combining the content of the SQL audit log with the content of the protection object configuration in the audit system based on the IP address, the method further includes: The fields of the SQL audit log content are segmented by characters to obtain the host address field.
4. The method according to claim 3, characterized in that Based on the IP address, the content of the SQL audit log is combined with the content of the protection object configuration in the audit system to obtain the audit record, including: Compare the host address field with the IP address; If the host address field is consistent with the IP address, the content of the SQL audit log is combined with the content of the protection object configuration to obtain an audit record.
5. The method according to claim 2, characterized in that: Based on the same fields, the contents of the SQL audit log are combined with the contents of the protection object configuration in the audit system to obtain an audit record, including: Compare the fields of the SQL audit log content with the fields of the content of the protection object configuration; If they are consistent, the content corresponding to the field of the SQL audit log is combined with the content corresponding to the field of the protection object configuration in the audit system to obtain an audit record.
6. A cloud database auditing device, characterized in that: include: The first acquisition module is used to display a configuration page; obtain registration information input based on the configuration page, wherein the registration information includes a secret key ID, a secret key signature string, and a signature result string; and call an API interface according to the registration information to obtain an SQL audit log; The second acquisition module is used to acquire the content of the protection object configuration information; A screening module, used to screen the contents of the SQL audit log and the protection object configuration information to obtain audit records; A matching module, used for matching the audit record with the rule called by the rule engine to fill in the fields in the audit record and obtain a new audit record, wherein the rule called by the rule engine includes a keyword and an operation type, and the new audit record is a complete audit record; The insert module is used to insert the new audit record into the database of the audit system.
7. A server, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, the instructions is executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 5.
8. A non-volatile computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the processor is caused to execute the method according to any one of claims 1 to 5.
