Log desensitization method and device, computer equipment and storage medium
By introducing a log desensitization toolkit in financial backend projects and applying regular matching rules and Key matching rules, the problem of insufficient applicability and accuracy in handling non-standard JSON format data is solved, and more efficient log desensitization processing is achieved, improving data security and readability.
Patent Information
- Application Number
- CN202411446104.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-02-25
AI Technical Summary
The existing logback log desensitization method has low applicability and low accuracy, especially when processing non-standard JSON format data, it is impossible to effectively identify and process sensitive information.
By introducing a preset log desensitization toolkit into the target project, preconfigured regular matching rules and Key matching rules are called to desensitize log information.
It improves the applicability and accuracy of log desensitization processing, can automatically and intelligently realize the desensitization processing of custom format log information, and enhances the data security and readability of the final generated target log information.
Smart Images

Figure CN119513910A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of data processing technology and financial technology, and in particular to log desensitization methods, devices, computer equipment and storage media. Background Art
[0002] In the financial field, logging of back-end projects is an important means to ensure stable system operation, troubleshooting and compliance auditing. However, with the increasing complexity of financial services and the continuous increase of sensitive data, logs often contain a large amount of personal information, transaction data and other sensitive content. Once this information is leaked, it will have a serious impact on personal privacy, corporate security and even the stability of the entire financial system.
[0003] In order to meet this challenge, the industry generally adopts log desensitization technology, that is, hiding or replacing sensitive information during the logging process to protect data privacy and security. Among the many log frameworks, logback is widely used in financial backend projects due to its flexibility and scalability. However, the traditional logback log desensitization method, such as using libraries such as fastjson to process JSON format data, has obvious limitations and shortcomings. Specifically, libraries such as fastjson mainly process data in standard JSON format, while the logs of financial backend projects often contain data in multiple formats, such as plain text, XML, custom formats, etc. This leads to a significant reduction in the applicability and accuracy of desensitization processing when libraries such as fastjson process non-standard JSON format data. For example, when the log contains key-value pairs separated by equal signs, libraries such as fastjson cannot accurately identify and process sensitive information therein. Summary of the invention
[0004] The purpose of the embodiments of the present application is to propose a log desensitization method, device, computer equipment and storage medium to solve the technical problems of low applicability and low accuracy of the existing log desensitization method using logback.
[0005] In order to solve the above technical problems, the embodiment of the present application provides a log desensitization method, which adopts the following technical solution:
[0006] When it is detected that the log framework corresponding to the target project completes the generation and processing of the log information, the log information is intercepted based on a preset conversion method; wherein a preset log desensitization toolkit is introduced in advance into the target project;
[0007] Based on the log desensitization toolkit, all pre-configured desensitization rules are called; wherein the desensitization rules at least include regular matching rules and Key matching rules;
[0008] Desensitizing the sensitive information of the log information based on the regular matching rule to obtain corresponding first desensitized content;
[0009] Desensitizing the log information based on the key matching rule to obtain corresponding second desensitized content;
[0010] Obtaining non-sensitive information from the log information;
[0011] Generate target log information based on the first desensitized content, the second desensitized content, and the non-sensitive information.
[0012] Furthermore, the step of performing desensitization processing on the log information for sensitive information based on the regular matching rule to obtain the corresponding first desensitized content specifically includes:
[0013] Based on the regular matching rule, calling a preset regular expression engine to filter out the first sensitive information that meets the regular matching condition from the log information;
[0014] Acquire a first desensitization processing method corresponding to the first sensitive information from the regular matching rule;
[0015] The first sensitive information is desensitized based on the first desensitization processing method to obtain first desensitized content corresponding to the first sensitive information.
[0016] Furthermore, the step of performing desensitization processing on the log information based on the Key matching rule to obtain the corresponding second desensitized content specifically includes:
[0017] Traversing all fields in the log information based on the Key matching rule, and filtering out second sensitive information that meets the Key matching condition based on all the fields;
[0018] Acquire a second desensitization processing method corresponding to the second sensitive information from the Key matching rule;
[0019] The second sensitive information is desensitized based on the second desensitization processing method to obtain second desensitized content corresponding to the second sensitive information.
[0020] Furthermore, the step of generating target log information based on the first desensitized content, the second desensitized content, and the non-sensitive information specifically includes:
[0021] Get the preset splicing method;
[0022] Based on the splicing method, the first desensitized content, the second desensitized content, and the non-sensitive information are spliced to obtain corresponding splicing information;
[0023] The splicing information is used as the target log information.
[0024] Furthermore, before the step of intercepting the log information based on a preset conversion method when the log framework corresponding to the target project completes the generation process of the log information, the method further includes:
[0025] Obtain the log desensitization toolkit;
[0026] Based on the preset build tool, add the log desensitization toolkit as a project dependency to the target project;
[0027] Obtain the scanning function of the log desensitization toolkit;
[0028] Add the scanning function to the startup item of the target project.
[0029] Furthermore, before the step of calling all pre-configured desensitization rules based on the log desensitization toolkit, the method further includes:
[0030] Determine whether a desensitization rule configuration request triggered by a user is received;
[0031] If yes, the preset desensitization rule configuration page is displayed;
[0032] Receiving desensitization rule configuration data input by the user in the desensitization rule configuration page;
[0033] Constructing corresponding desensitization rules based on the desensitization rule configuration data;
[0034] Add the desensitization rule to the configuration file corresponding to the target project.
[0035] Furthermore, the log desensitization method further includes:
[0036] Performing compliance statistical processing on the desensitization rules to obtain corresponding statistical results;
[0037] Generate a corresponding compliance report based on the statistical results;
[0038] Obtain communication information of relevant personnel;
[0039] Based on the communication information, the compliance report is sent to the relevant personnel.
[0040] In order to solve the above technical problems, the embodiment of the present application also provides a log desensitization device, which adopts the following technical solution:
[0041] An interception module, used for intercepting the log information based on a preset conversion method when detecting that the log framework corresponding to the target project completes the generation and processing of the log information; wherein a preset log desensitization toolkit is introduced in advance into the target project;
[0042] A calling module, used to call all pre-configured desensitization rules based on the log desensitization toolkit; wherein the desensitization rules at least include regular matching rules and Key matching rules;
[0043] A first processing module, configured to perform desensitization processing on the log information based on the regular matching rule to obtain corresponding first desensitized content;
[0044] A second processing module, configured to perform desensitization processing on the log information based on the Key matching rule to obtain corresponding second desensitized content;
[0045] A first acquisition module, used to acquire non-sensitive information in the log information;
[0046] The first generating module is used to generate target log information based on the first desensitized content, the second desensitized content and the non-sensitive information.
[0047] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0048] When it is detected that the log framework corresponding to the target project completes the generation and processing of the log information, the log information is intercepted based on a preset conversion method; wherein a preset log desensitization toolkit is introduced in advance into the target project;
[0049] Based on the log desensitization toolkit, all pre-configured desensitization rules are called; wherein the desensitization rules at least include regular matching rules and Key matching rules;
[0050] Desensitizing the sensitive information of the log information based on the regular matching rule to obtain corresponding first desensitized content;
[0051] Desensitizing the log information based on the key matching rule to obtain corresponding second desensitized content;
[0052] Obtaining non-sensitive information from the log information;
[0053] Generate target log information based on the first desensitized content, the second desensitized content, and the non-sensitive information.
[0054] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0055] When it is detected that the log framework corresponding to the target project completes the generation and processing of the log information, the log information is intercepted based on a preset conversion method; wherein a preset log desensitization toolkit is introduced in advance into the target project;
[0056] Based on the log desensitization toolkit, all pre-configured desensitization rules are called; wherein the desensitization rules at least include regular matching rules and Key matching rules;
[0057] Desensitizing the sensitive information of the log information based on the regular matching rule to obtain corresponding first desensitized content;
[0058] Desensitizing the log information based on the key matching rule to obtain corresponding second desensitized content;
[0059] Obtaining non-sensitive information from the log information;
[0060] Generate target log information based on the first desensitized content, the second desensitized content, and the non-sensitive information.
[0061] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0062] When the application detects that the log framework corresponding to the target project has completed the generation and processing of log information, the log information is intercepted based on a preset conversion method; wherein, a preset log desensitization toolkit is introduced in the target project in advance; then all pre-configured desensitization rules are called based on the log desensitization toolkit; wherein, the desensitization rule includes at least a regular matching rule and a Key matching rule; then, based on the regular matching rule, the log information is desensitized for sensitive information to obtain a corresponding first desensitized content; and based on the Key matching rule, the log information is desensitized for sensitive information to obtain a corresponding second desensitized content; subsequently, non-sensitive information in the log information is obtained; and finally, the target log information is generated based on the first desensitized content, the second desensitized content and the non-sensitive information. When the log framework corresponding to the target project is detected to have completed the generation and processing of log information, the application intercepts the log information based on the conversion method, then calls all pre-configured desensitization rules based on the log desensitization toolkit introduced in the target project, and then desensitizes the sensitive information of the log information based on the regular matching rules and the Key matching rules contained in the regular matching rules to obtain the corresponding sensitive content, and subsequently generates the final desensitized target log information based on the desensitized content and the non-sensitive information in the log information, thereby automatically and intelligently realizing the desensitization processing of the custom format of the log information, effectively improving the applicability and accuracy of the desensitization processing, and facilitating improving the data security and readability of the target log information finally generated. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0064] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0065] Figure 2 A flow chart of an embodiment of a log desensitization method according to the present application;
[0066] Figure 3 is a structural schematic diagram of an embodiment of a log desensitization device according to the present application;
[0067] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0068] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0069] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0070] 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 accompanying drawings.
[0071] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0072] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0073] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to a laptop computer 1011, a tablet computer 1012 or a mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.
[0074] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .
[0075] It should be noted that the log desensitization method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the log desensitization device is generally set in the server / terminal device.
[0076] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0077] Continue to refer Figure 2 , showing a flow chart of an embodiment of the log desensitization method according to the present application. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted. The log desensitization method provided in the embodiment of the present application can be applied to any scenario where log desensitization is required, and the log desensitization method can be applied to products in these scenarios, for example, log desensitization of financial projects in the field of finance and insurance. The log desensitization method comprises the following steps:
[0078] Step S201, when it is detected that the log framework corresponding to the target project completes the generation process of log information, the log information is intercepted based on a preset conversion method; wherein a preset log desensitization toolkit is introduced in advance into the target project.
[0079] In this embodiment, the electronic device (eg Figure 1The server / terminal device shown in the figure) can obtain log information through a wired connection or a wireless connection. It should be noted that the above-mentioned wireless connection methods may include but are not limited to 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or developed in the future. The project is an actual scenario for using the log desensitization toolkit. In the project, developers need to integrate the log desensitization toolkit into the log processing process and define specific desensitization rules through configuration files. In this way, when the project generates log information, the log desensitization toolkit will desensitize the sensitive information in the log information according to the desensitization rules in the configuration file, thereby protecting the privacy and security of users.
[0080] The above-mentioned log framework is an important tool for project debugging and monitoring. Through the log framework, developers can easily view the running status of the project, including variable values, method calls, exception information, etc. This information is essential for locating problems, optimizing performance, and monitoring project stability. The log framework provides log management and analysis functions. Developers can configure the log framework to output log information to different targets (such as consoles, files, databases, etc.), and set the log level and format as needed. This helps developers better manage and analyze log information and improve the maintainability of the project. The log framework is usually integrated as a dependent library of the project. Developers need to introduce the dependency of the log framework in the project and use the API provided by the log framework in the code to record log information. This makes the log framework an indispensable part of the project, working together with other components of the project to ensure the normal operation of the project.
[0081] In addition, in the log processing business scenario in the financial field, the target project is a backend project of a financial application, such as an insurance project, a claims project, a financial management project, etc. In addition, the conversion method is specifically a convert method. By overloading the convert method, the log information generated by the log framework can be intercepted. The log information is a printed log with an irregular log format, such as a log information with commas and semicolons or even Chinese characters.
[0082] Step S202: Call all pre-configured desensitization rules based on the log desensitization toolkit.
[0083] In this embodiment, the log desensitization toolkit can extract the desensitization rules defined in the configuration file by querying the corresponding configuration file. Among them, the desensitization rules include at least regular matching rules and key matching rules. In addition, the configuration generation process of the desensitization rules will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated on here.
[0084] Step S203: desensitizing the sensitive information of the log information based on the regular matching rule to obtain corresponding first desensitized content.
[0085] In this embodiment, the above-mentioned specific implementation process of desensitizing the sensitive information of the log information based on the regular matching rule to obtain the corresponding first desensitized content will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated in detail here.
[0086] Step S204: desensitizing the sensitive information of the log information based on the Key matching rule to obtain corresponding second desensitized content.
[0087] In this embodiment, the above-mentioned specific implementation process of desensitizing the sensitive information of the log information based on the Key matching rule to obtain the corresponding second desensitized content will be further described in detail in subsequent specific embodiments of the present application and will not be elaborated in detail here.
[0088] Step S205: obtaining non-sensitive information in the log information.
[0089] In this embodiment, the non-sensitive information refers to part of the log information that has not been desensitized.
[0090] Step S206: Generate target log information based on the first desensitized content, the second desensitized content, and the non-sensitive information.
[0091] In this embodiment, the specific implementation process of generating the target log information based on the first desensitized content, the second desensitized content and the non-sensitive information will be described in further detail in subsequent specific embodiments of the present application and will not be elaborated on here.
[0092] When the application detects that the log framework corresponding to the target project has completed the generation and processing of log information, the log information is intercepted based on a preset conversion method; wherein, a preset log desensitization toolkit is introduced in the target project in advance; then all pre-configured desensitization rules are called based on the log desensitization toolkit; wherein, the desensitization rule includes at least a regular matching rule and a Key matching rule; then, based on the regular matching rule, the log information is desensitized for sensitive information to obtain a corresponding first desensitized content; and based on the Key matching rule, the log information is desensitized for sensitive information to obtain a corresponding second desensitized content; subsequently, non-sensitive information in the log information is obtained; and finally, the target log information is generated based on the first desensitized content, the second desensitized content and the non-sensitive information. When the log framework corresponding to the target project is detected to have completed the generation and processing of log information, the application intercepts the log information based on the conversion method, then calls all pre-configured desensitization rules based on the log desensitization toolkit introduced in the target project, and then desensitizes the sensitive information of the log information based on the regular matching rules and the Key matching rules contained in the regular matching rules to obtain the corresponding sensitive content, and subsequently generates the final desensitized target log information based on the desensitized content and the non-sensitive information in the log information, thereby automatically and intelligently realizing the desensitization processing of the custom format of the log information, effectively improving the applicability and accuracy of the desensitization processing, and facilitating improving the data security and readability of the target log information finally generated.
[0093] In some optional implementations, step S203 includes the following steps:
[0094] Based on the regular matching rule, a preset regular expression engine is called to filter out the first sensitive information that meets the regular matching condition from the log information.
[0095] In this embodiment, a circular matching mechanism is implemented inside the log desensitization toolkit to traverse all defined desensitization rules. Desensitization rules include regular matching rules and key matching rules. For regular matching rules, the content in the log information is matched by using a regular expression engine. If a part of the information in the log information matches the regular expression, it is determined that the part of the information belongs to the first sensitive information that meets the regular matching conditions.
[0096] A first desensitization processing method corresponding to the first sensitive information is obtained from the regular matching rule.
[0097] In this embodiment, a matching first desensitization processing method can be extracted from the regular matching rule based on the above-mentioned first sensitive information.
[0098] The first sensitive information is desensitized based on the first desensitization processing method to obtain first desensitized content corresponding to the first sensitive information.
[0099] In this embodiment, the matched first sensitive information may be desensitized according to the capture groups and the number of retained bits defined in the above-mentioned first desensitization processing method, so as to obtain the corresponding first desensitized content.
[0100] This application calls a preset regular expression engine based on the regular matching rule to filter out the first sensitive information that meets the regular matching condition from the log information; then obtains the first desensitizing processing method corresponding to the first sensitive information from the regular matching rule; and subsequently desensitizes the first sensitive information based on the first desensitizing processing method to obtain the first desensitized content corresponding to the first sensitive information. This application calls a preset regular expression engine based on the regular matching rule to filter out the first sensitive information that meets the regular matching condition from the log information; then desensitizes the first sensitive information based on the first desensitizing processing method corresponding to the first sensitive information obtained from the regular matching rule to obtain the corresponding first desensitized content, thereby realizing desensitization processing of the custom format of the log information based on the use of the regular matching rule, improving the intelligence and accuracy of the desensitizing processing, and facilitating improving the data security and readability of the target log information subsequently generated based on the first desensitized content.
[0101] In some optional implementations of this embodiment, step S204 includes the following steps:
[0102] All fields in the log information are traversed based on the Key matching rule, and the second sensitive information that meets the Key matching condition is screened out based on all the fields.
[0103] In this embodiment, for the Key matching rule, by traversing all fields in the log information, if the field name matches the Key defined in the Key matching rule, it is determined that the field corresponding to the field name belongs to the second sensitive information that meets the Key matching condition.
[0104] A second desensitization processing method corresponding to the second sensitive information is obtained from the Key matching rule.
[0105] In this embodiment, a matching second desensitization processing method can be extracted from the Key matching rule based on the above-mentioned second sensitive information.
[0106] The second sensitive information is desensitized based on the second desensitization processing method to obtain second desensitized content corresponding to the second sensitive information.
[0107] In this embodiment, the matched second sensitive information may be desensitized according to the desensitization pattern defined in the above-mentioned second desensitization processing method, so as to obtain corresponding second desensitized content.
[0108] This application traverses all the fields in the log information based on the Key matching rule, and filters out the second sensitive information that meets the Key matching condition based on all the fields; then obtains the second desensitization processing method corresponding to the second sensitive information from the Key matching rule; and subsequently desensitizes the second sensitive information based on the second desensitization processing method to obtain the second desensitized content corresponding to the second sensitive information. This application traverses all the fields in the log information based on the use of the Key matching rule, and filters out the second sensitive information that meets the Key matching condition based on the fields, and then desensitizes the second sensitive information according to the second desensitization processing method corresponding to the second sensitive information obtained from the Key matching rule to obtain the corresponding second desensitized content, thereby realizing the desensitization processing of the custom format of the log information based on the use of the Key matching rule, improving the intelligence and accuracy of the desensitization processing, and facilitating the improvement of the data security and readability of the target log information subsequently generated based on the second desensitized content.
[0109] In some optional implementations, step S206 includes the following steps:
[0110] Get the preset stitching method.
[0111] In this embodiment, the above-mentioned splicing method may specifically adopt the appendTail method of Matcher.
[0112] The first desensitized content, the second desensitized content and the non-sensitive information are spliced based on the splicing method to obtain corresponding splicing information.
[0113] In this embodiment, after the matched sensitive information in the log information is processed based on the use of regular matching rules and Key matching rules and the corresponding first desensitized content and second desensitized content are obtained, the unmatched part (i.e., non-sensitive information) retained in the log information will be spliced with the desensitized first desensitized content and the second desensitized content according to the above-mentioned splicing method to form the final target log information, i.e., the above-mentioned splicing information.
[0114] The splicing information is used as the target log information.
[0115] In this embodiment, the target log information after the desensitization process is subsequently output, which can effectively ensure the data security and readability of the target log information.
[0116] The present application obtains a preset splicing method; then splices the first desensitized content, the second desensitized content and the non-sensitive information based on the splicing method to obtain corresponding splicing information; and subsequently uses the splicing information as the target log information. The present application splices the first desensitized content, the second desensitized content and the non-sensitive information based on the use of a splicing method, so that the final target log information can be constructed quickly and accurately, effectively ensuring the data security and readability of the obtained target log information.
[0117] In some optional implementations, before step S201, the electronic device may further perform the following steps:
[0118] Obtain the log desensitization toolkit.
[0119] In this embodiment, there is no specific limitation on the selection of the log desensitization toolkit. For example, an extension package of Logback or a third-party log desensitization library may be used.
[0120] Based on the preset build tool, the log desensitization toolkit is added to the target project as a project dependency.
[0121] In this embodiment, the above-mentioned construction tool is a tool with a project dependency adding function. By using the above-mentioned construction tool, the log desensitization toolkit can be added as a project dependency to the pom.xml or build.gradle file in the target project.
[0122] Get the scanning function of the log desensitization toolkit.
[0123] In this embodiment, the above scanning function refers to the scan function of the log desensitization toolkit.
[0124] Add the scanning function to the startup item of the target project.
[0125] In this embodiment, the scanning function of the log desensitization toolkit can be added to the startup configuration of the target project, thereby ensuring that the log desensitization toolkit can take effect when the application is started.
[0126] This application obtains the log desensitization toolkit; then based on the preset build tool, adds the log desensitization toolkit as a project dependency to the target project; then obtains the scanning function of the log desensitization toolkit; and subsequently adds the scanning function to the startup item of the target project. This application obtains the log desensitization toolkit; then based on the use of the build tool, adds the log desensitization toolkit as a project dependency to the target project, and further adds the scanning function of the obtained log desensitization toolkit to the startup item of the target project, thereby effectively ensuring that the log desensitization toolkit can take effect when the application is started, and then can quickly and accurately complete the log desensitization processing based on the log desensitization toolkit, effectively ensuring the data security and readability of the logs generated after log desensitization.
[0127] In some optional implementations of this embodiment, before step S202, the electronic device may further perform the following steps:
[0128] Determine whether a desensitization rule configuration request triggered by a user is received.
[0129] In this embodiment, the user may be a person responsible for configuration management and operation and maintenance of the desensitization rules for the target. The desensitization rule configuration request may be a user-triggered request for generating desensitization rules required for desensitizing the log information of the project.
[0130] If yes, the preset desensitization rule configuration page is displayed.
[0131] In this embodiment, the above-mentioned desensitization rule configuration page is a page pre-built according to the configuration business requirements of the desensitization rule. The above-mentioned desensitization rule configuration page at least includes a rule configuration area, allowing the processing personnel to define various desensitization rules. Among them, the desensitization rule at least includes a regular matching rule and a key matching rule.
[0132] Receive the desensitization rule configuration data entered by the user in the desensitization rule configuration page.
[0133] In this embodiment, the user can generate desensitizing rules according to his own needs, enter the corresponding rule configuration data on the desensitizing rule configuration page, and can add, delete, modify and review the rule configuration data to generate the final desensitizing rule configuration data.
[0134] Construct corresponding desensitization rules based on the desensitization rule configuration data.
[0135] In this embodiment, the desensitization rule configuration data input by the user can be collected and saved, and the rule configuration can be performed according to the desensitization rule configuration data, thereby generating the corresponding desensitization rule. The desensitization rule includes a regular matching rule and a Key matching rule.
[0136] Specifically, for the constructed regular matching rules, a custom configuration item is set, separated by semicolons, and each configuration distinguishes the number of bits to be retained. You can configure the desired desensitization effect by yourself. Exemplary: If the desensitization effect is to retain the first 4 and the last 4 of the mobile phone regular, the corresponding configuration can be: ([^0-9])(1[0-9][0-9]\d{8})(?![0-9])&&4&&4; If the desensitization effect is to replace the last 4 of the landline regular, the corresponding configuration can be *:(0[1-9]\d{1,2}-)[1-9]\d{6,7}(?![0-9])&&-1&&4; The above is the desensitization effect of the mobile phone number is 18122223333-》181****3333. If the desensitization effect needs to be 1********33-, the corresponding configuration is: the mobile phone retains the first 1 and the last 2: ([^0-9])(1[0-9][0-9]\d{8})(?![0-9])&&1&&2.
[0137] For the constructed Key matching rule, by setting a key match, you only need to configure and use Pattern p = Pattern.compile(item);
[0138] Matcher m1=p.matcher(content);
[0139] while(m1.find()){xxx}.
[0140] Because there are many irregular logs, the key value mode is still used, but the key is configured for circular matching, such as key = name, address. It also supports capitalization of the first letter to facilitate suffix camel case matching. For example, if only name is configured, clientName can still be matched. In addition, because the key and value must be connected by an intermediate symbol, there is another configuration to separate symbols. For example, in Example 1: name = Zhang San, the equal sign is the connector. The comma is the end symbol. Example 2: name = 'Zhang San'. The equal quotation mark is the connector. The quotation mark is the end symbol. According to the above rules, the value can be perfectly matched. Next, you only need to perform desensitization on the value.
[0141] Add the desensitization rule to the configuration file corresponding to the target project.
[0142] In this embodiment, a configuration file related to the target project for defining desensitization rules is pre-built. In the configuration file, regular matching rules and key matching rules can be added in the specified format. The configuration file is an important file for defining log desensitization rules and behaviors. It usually contains detailed definitions of various desensitization rules, such as which fields need to be desensitized, the desensitization method (such as replacement, encryption, etc.), and the format after desensitization. The configuration file can also define the behavior of the log desensitization toolkit, such as whether to enable desensitization, the level of desensitization, etc. By modifying the configuration file, developers can flexibly adjust the strategies and rules of log desensitization to meet different project requirements.
[0143] Specifically, in the configuration file, a unique identifier is specified for each regular matching rule so that it can be referenced in subsequent configuration or log processing. And the corresponding regular matching rule is written in the format of (regular expression) (capture group) (negative lookahead) && retain the first digit && retain the last digit;. For example, for PHONE_REGEX = ([^0-9])(1[0-9][0-9]\d{8})(?![0-9])&&4&&4. Among them, ([^0-9]): non-numeric characters, as the beginning of the capture group (here used to match non-numeric characters before the mobile phone number, such as spaces or brackets). (1[0-9][0-9]\d{8}): matches the mobile phone number (starting with 1, the second and third digits are numbers, followed by 8 digits). (?![0-9]): negative lookahead to ensure that the matched mobile phone number is not followed by a numeric character. &&4&&4: retain the first 4 digits and the last 4 digits of the mobile phone number, and the middle part will be desensitized.
[0144] In addition, in the configuration file, specify a unique identifier for each Key matching rule so that it can be referenced in subsequent configuration or log processing. Write the Key matching rule using the key=value format, where key is the field name in the log, that is, the key of the log information that needs to be desensitized, and value is the desensitization processing method (it can be a fixed desensitization mode or a reference to other rules). Example: NAME_KEY=name=mask(****), where name: the field name in the log, that is, the key that needs to be desensitized. mask(****): Desensitization processing method, which means that the matched name field value is replaced with four asterisks. In addition, the value part needs to be adjusted according to the specific syntax of the selected log desensitization toolkit.
[0145] This application determines whether a desensitizing rule configuration request triggered by the user is received; if so, displays a preset desensitizing rule configuration page; then receives the desensitizing rule configuration data entered by the user in the desensitizing rule configuration page; then constructs the corresponding desensitizing rule based on the desensitizing rule configuration data; and subsequently adds the desensitizing rule to the configuration file corresponding to the target project. After receiving the desensitizing rule configuration request triggered by the user, this application displays a preset desensitizing rule configuration page, and then constructs the corresponding desensitizing rule according to the desensitizing rule configuration data entered by the user in the desensitizing rule configuration page, thereby realizing the intelligent and accurate construction of desensitizing rules that meet the user's needs based on the user's desensitizing rule configuration requirements, thereby improving the configuration efficiency and configuration intelligence of the desensitizing rules. And by adding the desensitizing rules to the configuration file corresponding to the target project, it is beneficial for the subsequent use of the log desensitization toolkit to smoothly call out all the desensitizing rules pre-configured by the user.
[0146] In some optional implementations of this embodiment, the electronic device may further perform the following steps:
[0147] Compliance statistical processing is performed on the desensitization rules to obtain corresponding statistical results.
[0148] In this embodiment, the desensitization rules can be statistically processed for compliance using the preset audit plan and audit standards at regular intervals to check whether they comply with the requirements of laws, regulations and industry standards, and obtain corresponding statistical results. There is no specific limitation on the time value of the regular time, and it can be set according to actual business needs, such as once a week or once a month, etc.
[0149] A corresponding compliance report is generated based on the statistical results.
[0150] In this embodiment, a corresponding compliance report may be generated based on the statistical results. The compliance report may include data such as the execution status of the desensitization rules, problems found, and improvement measures.
[0151] Get the communication information of relevant personnel.
[0152] In this embodiment, the above-mentioned relevant personnel may be developers responsible for the operation and maintenance of the desensitization rules. The above-mentioned communication information may include information such as email addresses and mobile phone numbers.
[0153] Based on the communication information, the compliance report is sent to the relevant personnel.
[0154] In this embodiment, the compliance report can be provided to relevant personnel based on the obtained communication information, so that the relevant personnel can timely understand the implementation and effect of the desensitization rules and take corresponding measures.
[0155] This application performs compliance statistical processing on the desensitization rules to obtain corresponding statistical results; then generates a corresponding compliance report based on the statistical results; then obtains the communication information of the relevant personnel; and subsequently sends the compliance report to the relevant personnel based on the communication information. This application performs compliance statistical processing on the constructed desensitization rules to obtain corresponding statistical results, and generates a corresponding compliance report based on the statistical results, and then sends the compliance report to the relevant personnel based on the acquired communication information of the relevant personnel, thereby helping the relevant personnel to understand the implementation and effects of the desensitization rules in a timely manner and take corresponding measures, thereby improving the work experience of the relevant personnel and ensuring the correctness and accuracy of the desensitization rules to avoid the occurrence of erroneous desensitization or missed desensitization.
[0156] In some optional implementations, the user information obtained is subject to the user's consent and complies with relevant laws and policies.
[0157] In addition, the non-Company software tools or components that appear in the embodiments of the present application are merely examples and do not represent actual use.
[0158] In addition, the log desensitization toolkit used in the log desensitization method proposed in this application can avoid repeated writing of desensitization codes for each system. And the docking is simple, the docking cost is low, if there is no additional requirement, it is ready to use, and the default configuration covers most scenarios. And there is no need to pay attention to the log format, support custom configuration corresponding to the key, connector end character, etc., or custom rules can be used to complete the desensitization of the custom format. It can also support turning on or off the printing of desensitized logs. And the configuration item corresponding to the key or custom rule can complete the desensitization of the custom format, and support turning on or off desensitization.
[0159] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0160] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned target log information, the above-mentioned target log information can also be stored in a node of a blockchain.
[0161] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0162] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0163] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions 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 aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0164] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0165] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a log desensitization device, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0166] like Figure 3As shown, the log desensitization device 300 described in this embodiment includes: an interception module 301, a calling module 302, a first processing module 303, a second processing module 304, a first acquisition module 305 and a first generation module 306. Among them:
[0167] The interception module 301 is used to intercept the log information based on a preset conversion method when detecting that the log framework corresponding to the target project completes the generation and processing of the log information; wherein a preset log desensitization toolkit is introduced in advance into the target project;
[0168] A calling module 302 is used to call all pre-configured desensitization rules based on the log desensitization toolkit; wherein the desensitization rules at least include regular matching rules and Key matching rules;
[0169] The first processing module 303 is used to perform desensitization processing on the log information based on the regular matching rule to obtain corresponding first desensitized content;
[0170] The second processing module 304 is used to perform desensitization processing on the log information based on the Key matching rule to obtain corresponding second desensitized content;
[0171] A first acquisition module 305 is used to acquire non-sensitive information in the log information;
[0172] The first generating module 306 is used to generate target log information based on the first desensitized content, the second desensitized content and the non-sensitive information.
[0173] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the log desensitization method in the aforementioned implementation mode, and are not described in detail here.
[0174] In some optional implementations of this embodiment, the first processing module 303 includes:
[0175] A first screening submodule, configured to call a preset regular expression engine to screen out first sensitive information that meets the regular matching condition from the log information based on the regular matching rule;
[0176] A first acquisition submodule, used to acquire a first desensitization processing method corresponding to the first sensitive information from the regular matching rule;
[0177] The first processing submodule is used to perform desensitization processing on the first sensitive information based on the first desensitization processing method to obtain first desensitized content corresponding to the first sensitive information.
[0178] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the log desensitization method in the aforementioned implementation mode, and are not described in detail here.
[0179] In some optional implementations of this embodiment, the second processing module 304 includes:
[0180] A second screening submodule, used for traversing all fields in the log information based on the Key matching rule, and screening out second sensitive information that meets the Key matching condition based on all the fields;
[0181] A second acquisition submodule, used to acquire a second desensitization processing method corresponding to the second sensitive information from the Key matching rule;
[0182] The second processing submodule is used to perform desensitization processing on the second sensitive information based on the second desensitization processing method to obtain second desensitized content corresponding to the second sensitive information.
[0183] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the log desensitization method in the aforementioned implementation mode, and are not described in detail here.
[0184] In some optional implementations of this embodiment, the first generating module 306 includes:
[0185] The third acquisition submodule is used to acquire a preset splicing method;
[0186] A splicing submodule, configured to splice the first desensitized content, the second desensitized content and the non-sensitive information based on the splicing method to obtain corresponding splicing information;
[0187] A submodule is determined, which is used to use the splicing information as the target log information.
[0188] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the log desensitization method in the aforementioned implementation mode, and are not described in detail here.
[0189] In some optional implementations of this embodiment, the log desensitization device further includes:
[0190] A second acquisition module is used to obtain the log desensitization toolkit;
[0191] A first adding module is used to add the log desensitization toolkit as a project dependency to the target project based on a preset build tool;
[0192] A third acquisition module is used to obtain the scanning function of the log desensitization toolkit;
[0193] The second adding module is used to add the scanning function to the startup item of the target project.
[0194] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the log desensitization method in the aforementioned implementation mode, and are not described in detail here.
[0195] In some optional implementations of this embodiment, the log desensitization device further includes:
[0196] A judgment module is used to judge whether a desensitization rule configuration request triggered by a user is received;
[0197] A display module is used to display the preset desensitization rule configuration page if yes;
[0198] A receiving module, used for receiving the desensitization rule configuration data input by the user in the desensitization rule configuration page;
[0199] A construction module, used to construct corresponding desensitization rules based on the desensitization rule configuration data;
[0200] The third adding module is used to add the desensitization rule to the configuration file corresponding to the target project.
[0201] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the log desensitization method in the aforementioned implementation mode, and are not described in detail here.
[0202] In some optional implementations of this embodiment, the log desensitization device further includes:
[0203] A statistical module is used to perform compliance statistical processing on the desensitization rules to obtain corresponding statistical results;
[0204] A second generating module, used to generate a corresponding compliance report based on the statistical results;
[0205] The fourth acquisition module is used to obtain the communication information of relevant personnel;
[0206] A sending module is used to send the compliance report to the relevant personnel based on the communication information.
[0207] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the log desensitization method in the aforementioned implementation mode, and are not described in detail here.
[0208] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0209] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0210] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0211] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 4. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the log desensitization method, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0212] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for running the log desensitization method.
[0213] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0214] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0215] In an embodiment of the present application, when it is detected that the log framework corresponding to the target project completes the generation and processing of log information, the log information is intercepted based on the conversion method, and then all pre-configured desensitization rules are called based on the log desensitization toolkit introduced in the target project, and then the log information is desensitized based on the regular matching rules and the Key matching rules contained in the regular matching rules to obtain the corresponding sensitive content, and then the final desensitized target log information is generated based on the desensitized content and the non-sensitive information in the log information, thereby automatically and intelligently realizing the desensitization processing of the custom format of the log information, effectively improving the applicability and accuracy of the desensitization processing, and is conducive to improving the data security and readability of the target log information finally generated.
[0216] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the log desensitization method as described above.
[0217] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0218] In an embodiment of the present application, when it is detected that the log framework corresponding to the target project completes the generation and processing of log information, the log information is intercepted based on the conversion method, and then all pre-configured desensitization rules are called based on the log desensitization toolkit introduced in the target project, and then the log information is desensitized based on the regular matching rules and the Key matching rules contained in the regular matching rules to obtain the corresponding sensitive content, and then the final desensitized target log information is generated based on the desensitized content and the non-sensitive information in the log information, thereby automatically and intelligently realizing the desensitization processing of the custom format of the log information, effectively improving the applicability and accuracy of the desensitization processing, and is conducive to improving the data security and readability of the target log information finally generated.
[0219] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0220] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A log desensitization method, characterized in that: The steps include: When it is detected that the log framework corresponding to the target project completes the generation and processing of the log information, the log information is intercepted based on a preset conversion method; wherein a preset log desensitization toolkit is introduced in advance into the target project; Based on the log desensitization toolkit, all pre-configured desensitization rules are called; wherein the desensitization rules at least include regular matching rules and Key matching rules; Desensitizing the sensitive information of the log information based on the regular matching rule to obtain corresponding first desensitized content; Desensitizing the log information based on the key matching rule to obtain corresponding second desensitized content; Obtaining non-sensitive information from the log information; Generate target log information based on the first desensitized content, the second desensitized content, and the non-sensitive information.
2. The log desensitization method according to claim 1, characterized in that: The step of performing desensitization processing on the log information based on the regular matching rule to obtain the corresponding first desensitized content specifically includes: Based on the regular matching rule, calling a preset regular expression engine to filter out the first sensitive information that meets the regular matching condition from the log information; Acquire a first desensitization processing method corresponding to the first sensitive information from the regular matching rule; The first sensitive information is desensitized based on the first desensitization processing method to obtain first desensitized content corresponding to the first sensitive information.
3. The log desensitization method according to claim 1, characterized in that: The step of performing desensitization processing on the log information based on the Key matching rule to obtain the corresponding second desensitized content specifically includes: Traversing all fields in the log information based on the Key matching rule, and filtering out second sensitive information that meets the Key matching condition based on all the fields; Acquire a second desensitization processing method corresponding to the second sensitive information from the Key matching rule; The second sensitive information is desensitized based on the second desensitization processing method to obtain second desensitized content corresponding to the second sensitive information.
4. The log desensitization method according to claim 1, characterized in that: The step of generating target log information based on the first desensitized content, the second desensitized content, and the non-sensitive information specifically includes: Get the preset splicing method; Based on the splicing method, the first desensitized content, the second desensitized content, and the non-sensitive information are spliced to obtain corresponding splicing information; The splicing information is used as the target log information.
5. The log desensitization method according to claim 1, characterized in that: Before the step of intercepting the log information based on a preset conversion method when the log framework corresponding to the target project completes the generation process of the log information, the method further includes: Obtain the log desensitization toolkit; Based on the preset build tool, add the log desensitization toolkit as a project dependency to the target project; Obtain the scanning function of the log desensitization toolkit; Add the scanning function to the startup item of the target project.
6. The log desensitization method according to claim 1, characterized in that: Before the step of calling all pre-configured desensitization rules based on the log desensitization toolkit, the method further includes: Determine whether a desensitization rule configuration request triggered by a user is received; If yes, the preset desensitization rule configuration page is displayed; Receiving desensitization rule configuration data input by the user in the desensitization rule configuration page; Constructing corresponding desensitization rules based on the desensitization rule configuration data; Add the desensitization rule to the configuration file corresponding to the target project.
7. The log desensitization method according to claim 1, characterized in that: The log desensitization method further includes: Performing compliance statistical processing on the desensitization rules to obtain corresponding statistical results; Generate a corresponding compliance report based on the statistical results; Obtain communication information of relevant personnel; Based on the communication information, the compliance report is sent to the relevant personnel.
8. A log desensitization device, characterized in that: include: An interception module, used for intercepting the log information based on a preset conversion method when detecting that the log framework corresponding to the target project completes the generation and processing of the log information; wherein a preset log desensitization toolkit is introduced in advance into the target project; A calling module, used to call all pre-configured desensitization rules based on the log desensitization toolkit; wherein the desensitization rules at least include regular matching rules and Key matching rules; A first processing module, configured to perform desensitization processing on the log information based on the regular matching rule to obtain corresponding first desensitized content; A second processing module, configured to perform desensitization processing on the log information based on the Key matching rule to obtain corresponding second desensitized content; A first acquisition module, used to acquire non-sensitive information in the log information; The first generating module is used to generate target log information based on the first desensitized content, the second desensitized content and the non-sensitive information.
9. A computer device, characterized in that: It includes a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the log desensitization method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the log desensitization method according to any one of claims 1 to 7.