Sensitive data processing method and processing device, electronic device, and storage medium

By implementing data masking policy processing on the logs of the target application, the problem of ineffective masking of sensitive information is solved, and data security is guaranteed during the application log printing process.

CN115776399BActive Publication Date: 2025-09-16INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211466602.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-22
Publication Date
2025-09-16
Estimated Expiration
2042-11-22

Smart Images

  • Figure CN115776399B_ABST
    Figure CN115776399B_ABST
Patent Text Reader

Abstract

The present invention discloses a sensitive data processing method, processing device, electronic device, and storage medium, relating to the field of information security. The method comprises obtaining a target application corresponding to a log involving sensitive information, wherein the log includes field data recorded by the target application's existing service interface regarding the target application's operation process, where the target application corresponds to N applications, where N is a positive integer greater than or equal to 1; loading a data masking policy into the target application, and employing the data masking policy to mask target data involving designated sensitive fields in the log. The present invention addresses the technical problem in related technologies of being unable to effectively mask sensitive customer information, which can easily lead to customer information leaks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to a method and device for processing sensitive data, an electronic device, and a storage medium. Background Art

[0002] The continuous development of the internet has generated a vast amount of information data, such as travel-related data, financial institution account data, application account data, and instant messaging data. With the public's growing awareness of social information security and audit institutions' increased focus on data security, networks need to maintain confidentiality for some of the personal and commercial data generated to protect citizens' data security.

[0003] In related technologies, the way to handle sensitive data is often to use application permissions or application settings to block access by some customers. This is unable to effectively block sensitive information involving customers in the existing system, which can easily lead to leakage of customer information.

[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention

[0005] The embodiments of the present invention provide a method and device for processing sensitive data, an electronic device, and a storage medium, so as to at least solve the technical problem in related technologies that customers' sensitive information cannot be effectively shielded and processed, which easily leads to leakage of customer information.

[0006] According to one aspect of an embodiment of the present invention, a method for processing sensitive data is provided, comprising: obtaining a target application corresponding to a log involving sensitive information, wherein the log contains field data recorded by the target application's existing service interface of the target application during the operation of the target application, and the target application corresponds to N applications, where N is a positive integer greater than or equal to 1; loading a data masking policy into the target application, and using the data masking policy to mask the target data involving specified sensitive fields in the log.

[0007] Optionally, the step of obtaining a target application corresponding to a log involving sensitive information includes: obtaining a sensitive field set, wherein the sensitive field set contains M sensitive fields, and M is a positive integer greater than or equal to 1; reading the programs that need to print logs from the N applications to obtain an initial program screening set; and analyzing the applications corresponding to the logs involving the sensitive fields in the initial program screening set to obtain the target application.

[0008] Optionally, the step of obtaining a set of sensitive fields includes: reading the sensitive fields sent by each existing service interface of the target application to obtain a reading result; preprocessing the reading result, wherein the preprocessing strategy includes at least one of the following: deduplication, field normalization, and field filtering; and aggregating the sensitive fields in the preprocessed reading result to obtain the sensitive field set.

[0009] Optionally, the step of using the data masking strategy to mask target data involving specified sensitive fields in the log includes: after the log masking and desensitization switch is turned on, assigning the associated completely masked sensitive fields in the sensitive field set to the first parameter, and assigning the associated partially masked sensitive fields to the second parameter; using a preset annotation strategy to obtain the first parameter and the second parameter; and using the data masking strategy to mask target data involving the first parameter and the second parameter in the log.

[0010] Optionally, the data masking strategy includes at least masking strategy one, and the masking strategy one includes: traversing the JSON type data in the log to obtain a traversal result, wherein the traversal result includes at least: multiple key-value pairs, each key-value pair includes: a keyword and a corresponding key value; for the key value in the traversal result that starts with the first symbol, confirming that an array is embedded in the JSON type data, and converting the array that starts with the first symbol into an array of a specified type, and calling masking strategy two to process the converted array; for the key value in the traversal result that starts with the second symbol, confirming that the JSON type data is first-category data, and recursively calling masking strategy one to process the first-category data that starts with the second symbol; for the key value in the traversal result that is not the first symbol and the second symbol, reducing the font size of the keyword corresponding to the key value; for the keyword that has the first parameter or the second parameter, masking the keyword and the corresponding key value.

[0011] Optionally, the data masking strategy includes at least masking strategy 2, which includes: obtaining a specified type array in the log; for the JSON object in the specified type array, calling masking strategy 1 to mask the value of the first parameter or the second parameter in the JSON object; migrating the array subscript and masked value in the specified type array to a new array object.

[0012] Optionally, the data masking strategy includes at least masking strategy three, and the masking strategy three includes: obtaining at least one keyword in which MAP data appears in the log; obtaining a key value corresponding to each keyword, wherein the type of the key value includes at least: string type, MAP type; when the type of the key value is the string type, performing a masking operation on the key value in which the first parameter or the second parameter exists; when the type of the key value is the MAP type, recursively calling the masking strategy three to perform a masking operation on the key value in which the first parameter or the second parameter exists.

[0013] According to another aspect of an embodiment of the present invention, a sensitive data processing device is also provided, including: an acquisition unit, used to obtain a target application corresponding to a log involving sensitive information, wherein the log contains field data recorded by the target application's existing service interface of the target application during the operation of the target application, and the target application corresponds to N applications, where N is a positive integer greater than or equal to 1; a shielding unit, used to load a data shielding policy into the target application, and use the data shielding policy to shield the target data involving specified sensitive fields in the log.

[0014] Optionally, the acquisition unit includes: a first acquisition module, used to acquire a sensitive field set, wherein the sensitive field set contains M sensitive fields, and M is a positive integer greater than or equal to 1; a first reading module, used to read the programs that need to print logs among the N applications to obtain an initial program screening set; a first analysis module, used to analyze the applications corresponding to the logs involving the sensitive fields in the initial program screening set to obtain the target application.

[0015] Optionally, the first acquisition module includes: a first reading sub-module, used to read the sensitive fields sent by each existing service interface of the target application to obtain a reading result; a preprocessing sub-module, used to preprocess the reading result, wherein the preprocessing strategy includes at least one of the following: deduplication, field normalization, and field filtering; a collection sub-module, used to collect the sensitive fields in the preprocessed reading result to obtain the sensitive field set.

[0016] Optionally, the shielding unit includes: an assignment module for assigning the associated completely shielded sensitive fields in the sensitive field set to the first parameter and assigning the associated partially shielded sensitive fields to the second parameter after the log shielding and desensitization switch is turned on; a second acquisition module for adopting a preset annotation strategy to obtain the first parameter and the second parameter; and a shielding module for adopting the data shielding strategy to shield the target data in the log involving the first parameter and the second parameter.

[0017] Optionally, the data masking strategy includes at least masking strategy one, and the masking strategy one includes: traversing the JSON type data in the log to obtain a traversal result, wherein the traversal result includes at least: multiple key-value pairs, each key-value pair includes: a keyword and a corresponding key value; for the key value in the traversal result that starts with the first symbol, confirming that an array is embedded in the JSON type data, and converting the array that starts with the first symbol into an array of a specified type, and calling masking strategy two to process the converted array; for the key value in the traversal result that starts with the second symbol, confirming that the JSON type data is first-category data, and recursively calling masking strategy one to process the first-category data that starts with the second symbol; for the key value in the traversal result that is not the first symbol and the second symbol, reducing the font size of the keyword corresponding to the key value; for the keyword that has the first parameter or the second parameter, masking the keyword and the corresponding key value.

[0018] Optionally, the data masking strategy includes at least masking strategy 2, which includes: obtaining a specified type array in the log; for the JSON object in the specified type array, calling masking strategy 1 to mask the value of the first parameter or the second parameter in the JSON object; migrating the array subscript and masked value in the specified type array to a new array object.

[0019] Optionally, the data masking strategy includes at least masking strategy three, and the masking strategy three includes: obtaining at least one keyword in which MAP data appears in the log; obtaining a key value corresponding to each keyword, wherein the type of the key value includes at least: string type, MAP type; when the type of the key value is the string type, performing a masking operation on the key value in which the first parameter or the second parameter exists; when the type of the key value is the MAP type, recursively calling the masking strategy three to perform a masking operation on the key value in which the first parameter or the second parameter exists.

[0020] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, the computer-readable storage medium including a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned methods for processing sensitive data.

[0021] According to another aspect of an embodiment of the present invention, an electronic device is also provided, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the above-mentioned methods for processing sensitive data.

[0022] In the present disclosure, after obtaining the target application corresponding to the log involving sensitive information, the data masking strategy is loaded into the target application, and the data masking strategy is used to mask the target data involving specified sensitive fields in the log, wherein the log contains the field data recorded by the target application's existing service interface of the target application's running process, and the target application corresponds to N applications, where N is a positive integer greater than or equal to 1.

[0023] In the present disclosure, a pre-set data masking strategy (including field information to be masked) can be used to mask target data involving specified sensitive fields in the log, thereby reducing the possibility of sensitive information exposure during the printing of application logs and ensuring data security, thereby solving the technical problem in related technologies that the customer's sensitive information cannot be effectively masked, which easily leads to the leakage of customer information.

[0024] In this disclosure, a sensitive data shielding method based on the configuration center is used to ensure that the possibility of sensitive information exposure is reduced during the printing of application logs, thereby ensuring data security. The data shielding method can be flexibly configured. If new fields need to be shielded in the future, they can be added to the configuration center for configuration. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0026] Figure 1 is a flowchart of an optional sensitive data processing method according to an embodiment of the present invention;

[0027] Figure 2 is a schematic diagram of an optional method for obtaining a sensitive field set according to an embodiment of the present invention;

[0028] Figure 3 is a schematic diagram of an optional sensitive data processing device according to an embodiment of the present invention;

[0029] Figure 4 This is a hardware structure block diagram of an electronic device (or mobile device) according to a sensitive data processing method of an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions 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 embodiments described are only 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 making creative efforts should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] It should be noted that the sensitive data processing methods and devices disclosed in the present invention can be used in the field of information security when sensitive information is shielded, and can also be used in any field other than the field of information security when sensitive information is shielded. The application fields of the sensitive data processing methods and devices disclosed in the present invention are not limited.

[0033] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display and analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set up between this system and the relevant user or organization. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving the consent information fed back by the aforementioned user or organization.

[0034] The present invention can be applied to various data processing systems, applications, sensitive information processing devices / products / systems (for example, various mobile terminals, PC terminals, chat software, shopping software). The sensitive data shielding method based on the configuration center can reduce the possibility of sensitive information exposure during the printing of application logs, ensure data security, and flexibly configure data shielding methods. If new fields need to be shielded later, they can be added to the configuration center for configuration.

[0035] The present invention is described in detail below with reference to various embodiments.

[0036] Example 1

[0037] According to an embodiment of the present invention, an embodiment of a method for processing sensitive data is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0038] Figure 1 is a flowchart of an optional sensitive data processing method according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps:

[0039] Step S101: Obtain a target application corresponding to a log involving sensitive information, wherein the log includes field data recorded by the target application's existing service interface regarding the target application's running process. The target application corresponds to N applications, where N is a positive integer greater than or equal to 1.

[0040] Step S102: Load the data shielding policy into the target application, and use the data shielding policy to shield the target data involving the designated sensitive fields in the log.

[0041] Through the above steps, after obtaining the target application corresponding to the log involving sensitive information, the data shielding policy can be loaded into the target application, and the data shielding policy can be used to shield the target data involving the specified sensitive fields in the log, wherein the log contains the field data recorded by the stock service interface of the target application for the running process of the target application, and the target application corresponds to N applications, where N is a positive integer greater than or equal to 1. In this embodiment, the target data involving the specified sensitive fields in the log can be shielded by a pre-set data shielding policy (including the field information to be shielded), ensuring that the possibility of sensitive information exposure is reduced during the printing of the application log, ensuring data security, and thus solving the technical problem in the related technology that the customer's sensitive information cannot be effectively shielded, which easily leads to the leakage of customer information.

[0042] The sensitive data processing method in this embodiment may refer to a sensitive data shielding method used after the shielding parameters are configured by the configuration center, providing a sensitive data shielding method based on the configuration center.

[0043] The following first describes the parameters configured by the configuration center. In this embodiment, there is no limit on the number of configured parameters, and the number of parameters required is determined by the shielding method. This embodiment involves two shielding methods, so three parameters are set for schematic illustration.

[0044] The configuration center configures three parameters (parameters are not limited to three, multiple parameters are allowed, and the decision is mainly based on the shielding mode. This embodiment involves two shielding modes and sets three parameters), log shielding desensitization switch A; respectively, information field B that needs to be completely shielded and information field C that needs to be partially shielded. The specific descriptions are as follows:

[0045] 1. Log shielding desensitization switch A: The data dictionary is: 0 does not perform log desensitization, 1 performs log desensitization; it is mainly used to determine whether to perform log desensitization for emergency use. In actual use, the switch can be set to 1 for desensitization. If problems with log desensitization are found after use, set the log desensitization switch to 0.

[0046] 2. Completely masked information field B: Register the field that needs to be completely masked in parameter B (the first parameter is used as an example below). When the log is printed, it will be completely masked. For example, the customer password will be displayed as ******* after being masked.

[0047] 3. Partially mask information field C: Register the field that needs to be partially masked in parameter C (illustrated as the second parameter below). When the log is printed, it will be partially masked. For example, the customer card number will be displayed as: 6200******8888.

[0048] After setting the corresponding shielding fields, desensitization switch fields, and registering the fields under the corresponding parameters, detailed instructions are given in conjunction with the real-time data desensitization scenario.

[0049] The present invention will be described in detail below in conjunction with the above-mentioned implementation steps.

[0050] Step S101, obtain the target application corresponding to the log involving sensitive information, wherein the log contains field data recorded by the target application's existing service interface of the target application's running process, and the target application corresponds to N applications, where N is a positive integer greater than or equal to 1.

[0051] Optionally, step S102 includes: obtaining a sensitive field set, wherein the sensitive field set includes M sensitive fields, and M is a positive integer greater than or equal to 1; reading programs that need to print logs from N applications to obtain an initial program screening set; analyzing the applications corresponding to the logs involving sensitive fields in the initial program screening set to obtain the target application.

[0052] When collecting the target application corresponding to the log involving sensitive information, it means that in this embodiment, it is mainly to organize the public programs for log printing in each application, and confirm which applications need to print message information. Since the logs for message printing involve the need to process sensitive information, the sensitive data in the logs needs to be shielded. Therefore, it is necessary to first locate which applications generate logs involving sensitive information.

[0053] Since there are many types of printed logs, such as transaction logs and system logs, it is necessary to check which public applications contain sensitive information and add data masking policies (or log processing policies / log processing procedures) to applications involving sensitive information.

[0054] Before adding a data masking policy for an application involving sensitive information, you need to first find out which applications generate logs involving sensitive information. To find the sensitive information, you need to first determine the sensitive field set and use the sensitive field set to identify the sensitive data.

[0055] Figure 2 is a schematic diagram of an optional method for obtaining a sensitive field set according to an embodiment of the present invention, such as Figure 2 As shown, the steps for obtaining a sensitive field set include:

[0056] Step S201: read the sensitive fields sent by each existing service interface of the target application to obtain the reading result.

[0057] Among them, each target application will contain at least one stock service interface. By sending sensitive fields through the stock service interface, the total set of sensitive fields can be obtained.

[0058] Step S202 : pre-processing the read result, wherein the pre-processing strategy includes at least one of the following: deduplication, field normalization, and field filtering.

[0059] Among them, deduplication processing refers to deduplicating repeated sensitive fields in the total set of sensitive fields sent from multiple existing service interfaces to obtain a single field; field normalization refers to normalizing fields that may have multiple sensitive fields with the same meaning, and unifying these fields with the same meaning under a certain field; field filtering refers to filtering invalid fields, for example, fields without corresponding sensitive data, no name, and no identification.

[0060] Step S203: Aggregate the sensitive fields in the pre-processed reading result to obtain a sensitive field set.

[0061] In this embodiment, when obtaining a set of sensitive fields, services of all known applications will be sorted out, and all existing service interfaces of applications will be sorted out (each existing service interface has an uploaded field). Fields involving sensitive data will be sorted out and classified into different categories. The fields that are "completely shielded" or "partially shielded" will be assigned to the first parameter and the second parameter (corresponding to the above-mentioned parameters B and C), respectively. The existing services and various field tables, as well as the display items of whether they are shielded, will be saved.

[0062] After locating all applications corresponding to logs involving sensitive information, you can add data masking policies (or log processing policies / log processing procedures) to these applications.

[0063] Step S102: Load the data shielding policy into the target application, and use the data shielding policy to shield the target data involving the designated sensitive fields in the log.

[0064] Optionally, the step of using a data masking strategy to mask target data involving specified sensitive fields in the log includes: after the log masking and desensitization switch is turned on, assigning the associated completely masked sensitive fields in the sensitive field set to the first parameter, and assigning the associated partially masked sensitive fields to the second parameter; using a preset annotation strategy to obtain the first parameter and the second parameter; and using the data masking strategy to mask target data involving the first parameter and the second parameter in the log.

[0065] The above-mentioned preset annotation strategy can be understood as the meaning of loading variables, and the pre-configured first parameter and second parameter can be obtained through the annotation strategy.

[0066] The data format in this embodiment uses JSON, a lightweight data exchange format that is very easy to read and write, as well as to generate and parse. Instead of using protobuf or thrift to define the format of message content through IDL description files, conversion between in-memory data structures can be achieved directly. Compared to XML, JSON is smaller and more efficient. The following describes the shielding process for several types of JSON data.

[0067] Optionally, the data masking strategy includes at least masking strategy one, which includes: traversing the JSON type data in the log to obtain a traversal result, wherein the traversal result includes at least: multiple key-value pairs, each key-value pair includes: a keyword and a corresponding key value; for the key value in the traversal result that starts with the first symbol, confirming that an array is embedded in the JSON type data, and converting the array that starts with the first symbol into an array of a specified type, and calling masking strategy two to process the converted array; for the key value in the traversal result that starts with the second symbol, confirming that the JSON type data is first-category data, and recursively calling masking strategy one to process the first-category data that starts with the second symbol; for the key value in the traversal result that is not the first symbol and the second symbol, reducing the font size of the keyword corresponding to the key value; for the keyword with the first parameter or the second parameter, masking the keyword and the corresponding key value.

[0068] In this embodiment, by setting the strategy method1 for processing JSON data (that is, the above-mentioned shielding strategy one), JSON type data needs to be sent as a parameter. If the parameter passed in is empty, null is returned directly; the key value in the JSON string is looped through, and the value value corresponding to the key value is obtained (that is, a key-value pair is obtained, key indicates the keyword, and value indicates the key value).

[0069] In this embodiment, there is no limitation on the types of the first symbol and the second symbol in the data, for example, "[", "{", "!", "%", "&", etc. In this embodiment, "[" is used as the first symbol and "{" is used as the second symbol for schematic illustration. After obtaining the key-value pair, if the value is not empty, it is determined whether the value starts with "[". If so, it means that an array is embedded in the JSON type data and the array needs to be converted into an array of a specified type. In this embodiment, "JSONArray" is used as the array of the specified type for schematic illustration. After the array embedded in the JSON type data is converted into a JSONArray, the strategy method2 (i.e., the above-mentioned shielding strategy 2) is called to process and return, that is, the shielding strategy 2 is called to pass the JSONArray into the obtained shielded son array, and return it as value.

[0070] If the value starts with "{", it means that the value is JSON data. You need to recursively call the strategy method1 to process the data and return it. That is, get the JSON object corresponding to the key and pass it as a parameter to method1, and return the converted JSON object as the new value.

[0071] If the value is neither of the above two cases, the key value will be changed to lowercase (the font size of the keyword corresponding to the key value will be reduced), and it will be determined whether the key is in the first parameter B or the second parameter C. If so, the corresponding masking operation will be performed. If not, it will not be processed, and the key-value pair key-value will be returned.

[0072] Alternatively, the data masking strategy includes at least masking strategy 2, which includes: obtaining a specified type array in the log; for a JSON object in the specified type array, calling masking strategy 1 to mask the values ​​of the first parameter or the second parameter in the JSON object; and migrating the array subscript and the masked values ​​in the specified type array to a new array object.

[0073] In this embodiment, by setting the JSONArray data processing strategy method2 (i.e., the aforementioned masking strategy 2), the JSONArray data needs to be passed in as a parameter. If the parameter is empty, null is directly returned. If there is a value, the JSONArray object is looped through. The obtained JSON object is called with strategy method1, and the processed data is returned as a new value. After the call, the JSONArray subscript and the masked value / data are set to the new JSONArray object, and the return processing is performed.

[0074] In an embodiment of the present invention, the data masking strategy includes at least masking strategy three, and masking strategy three includes: obtaining at least one keyword of MAP data appearing in the log; obtaining a key value corresponding to each keyword, wherein the type of the key value includes at least: string type, MAP type; when the type of the key value is a string type, masking operation is performed on the key value with the first parameter or the second parameter; when the type of the key value is a MAP type, recursively calling masking strategy three to perform a masking operation on the key value with the first parameter or the second parameter.

[0075] In this embodiment, by setting the strategy mehtod3 for processing MAP data (that is, the above-mentioned shielding strategy three), it is necessary to pass in map data as a parameter, obtain the key value of the map data, and then traverse all key values ​​(by adding a new MAP object to be returned, and then obtaining the key set keyset, looping through the keyset, and obtaining the value of the map corresponding to the keyset), obtain the corresponding value value, and then judge the type of the value value. If the value is of String type (corresponding to the above-mentioned string type), judge whether the key value is configured in the first parameter B or the second parameter C. If there is a configuration, perform corresponding shielding. If not, return directly; if the value is of Map type, recursively call the strategy method3, and the passed-in parameter is the value corresponding to the current key until the processing is completed and returned.

[0076] Through the above implementation, processing methods for JSON data, JSON array and MAP data are provided respectively, so as to realize shielding processing of various types of JSON data.

[0077] In actual use, after production, switch A can be set to 1, and then program shielding verification can be performed, mainly checking the log printing and implementing the above-mentioned sensitive data shielding method. If there is a problem, switch A can be set to 0 to turn off the shielding program. It can be set flexibly without affecting the implementation of business functions.

[0078] Through the above embodiments, a sensitive data shielding method based on the configuration center is realized, which is suitable for scenarios where existing services have not performed data shielding. Through pre-set data shielding strategies (including shielding strategy one, shielding strategy two and shielding strategy three), the target data involving specified sensitive fields in the log can be shielded, ensuring that the possibility of sensitive information exposure is reduced during the printing of application logs, thereby ensuring data security.

[0079] At the same time, the sensitive data shielding method provided in this embodiment can be flexibly configured with respect to sensitive fields. If new fields need to be shielded later, they can be added to the configuration center for configuration.

[0080] The present invention is described below in conjunction with another optional embodiment.

[0081] Example 2

[0082] This embodiment provides a sensitive data processing device, and each implementation unit included in the processing device corresponds to each implementation step in the above-mentioned embodiment 1.

[0083] Figure 3 is a schematic diagram of an optional sensitive data processing device according to an embodiment of the present invention, such as Figure 3 As shown, the sensitive data processing device may include: an acquisition unit 31 and a shielding unit 32, wherein:

[0084] An acquisition unit 31 is configured to acquire a target application corresponding to a log involving sensitive information, wherein the log includes field data recorded by an existing service interface of the target application regarding the operation of the target application. The target application corresponds to N applications, where N is a positive integer greater than or equal to 1.

[0085] The shielding unit 32 is used to load the data shielding policy into the target application and use the data shielding policy to shield the target data involving the specified sensitive fields in the log.

[0086] The above-mentioned sensitive data processing device can obtain the target application corresponding to the log involving sensitive information through the acquisition unit 31, and then load the data shielding policy into the target application through the shielding unit 32, and use the data shielding policy to shield the target data involving the specified sensitive fields in the log, wherein the log contains the field data recorded by the stock service interface of the target application for the running process of the target application, and the target application corresponds to N applications, where N is a positive integer greater than or equal to 1. In this embodiment, the target data involving the specified sensitive fields in the log can be shielded by a pre-set data shielding policy (including the field information to be shielded), so as to ensure that the possibility of sensitive information exposure is reduced in the process of printing the application log, and data security is guaranteed, thereby solving the technical problem in the related technology that the sensitive information of the customer cannot be effectively shielded, which easily leads to the leakage of customer information.

[0087] Optionally, the acquisition unit includes: a first acquisition module, used to acquire a sensitive field set, wherein the sensitive field set contains M sensitive fields, and M is a positive integer greater than or equal to 1; a first reading module, used to read the programs that need to print logs in N applications to obtain an initial program screening set; a first analysis module, used to analyze the applications corresponding to the logs involving sensitive fields in the initial program screening set to obtain the target application.

[0088] Optionally, the first acquisition module includes: a first reading sub-module, used to read the sensitive fields sent by each existing service interface of the target application to obtain a reading result; a preprocessing sub-module, used to preprocess the reading result, wherein the preprocessing strategy includes at least one of the following: deduplication, field normalization, and field filtering; a collection sub-module, used to collect the sensitive fields in the preprocessed reading result to obtain a sensitive field set.

[0089] Optionally, the shielding unit includes: an assignment module for assigning the associated completely shielded sensitive fields in the sensitive field set to the first parameter and assigning the associated partially shielded sensitive fields to the second parameter after the log shielding and desensitization switch is turned on; a second acquisition module for adopting a preset annotation strategy to obtain the first parameter and the second parameter; and a shielding module for adopting a data shielding strategy to shield the target data involving the first parameter and the second parameter in the log.

[0090] Optionally, the data masking strategy includes at least masking strategy one, which includes: traversing the JSON type data in the log to obtain a traversal result, wherein the traversal result includes at least: multiple key-value pairs, each key-value pair includes: a keyword and a corresponding key value; for the key value in the traversal result that starts with the first symbol, confirming that an array is embedded in the JSON type data, and converting the array that starts with the first symbol into an array of a specified type, and calling masking strategy two to process the converted array; for the key value in the traversal result that starts with the second symbol, confirming that the JSON type data is first-class data, and recursively calling masking strategy one to process the first-class data that starts with the second symbol; for the key value in the traversal result that is not the first symbol and the second symbol, reducing the font size of the keyword corresponding to the key value; for the keyword with the first parameter or the second parameter, masking the keyword and the corresponding key value.

[0091] Optionally, the data masking strategy includes at least masking strategy 2, which includes: obtaining a specified type array in the log; for the JSON object in the specified type array, calling masking strategy 1 to mask the values ​​of the first parameter or the second parameter in the JSON object; migrating the array subscript and the masked value in the specified type array to a new array object.

[0092] Optionally, the data masking strategy includes at least masking strategy three, which includes: obtaining at least one keyword of MAP data appearing in the log; obtaining the key value corresponding to each keyword, wherein the type of the key value includes at least: string type, MAP type; when the type of the key value is a string type, masking operation is performed on the key value with the first parameter or the second parameter; when the type of the key value is a MAP type, recursively calling masking strategy three to perform masking operation on the key value with the first parameter or the second parameter.

[0093] The above-mentioned sensitive data processing device may further include a processor and a memory. The above-mentioned acquisition unit 31, shielding unit 32, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to implement corresponding functions.

[0094] The processor includes a kernel that retrieves the corresponding program unit from memory. One or more kernels can be configured to load a data masking policy into the target application by adjusting kernel parameters. The data masking policy is then used to mask target data in logs involving designated sensitive fields.

[0095] The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0096] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, the computer-readable storage medium including a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any of the above-mentioned sensitive data processing methods.

[0097] According to another aspect of an embodiment of the present invention, an electronic device is also provided, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement any of the above-mentioned methods for processing sensitive data.

[0098] Figure 4 FIG. 1 is a hardware structure diagram of an electronic device (or mobile device) according to a method for processing sensitive data according to an embodiment of the present invention. Figure 4 As shown, the electronic device may include one or more (402a, 402b, ..., 402n are shown in the figure) processors 402 (the processor 402 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 404 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 4 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 4 More or fewer components than shown, or with Figure 4 Different configurations shown.

[0099] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having the following method steps: obtaining a target application corresponding to a log involving sensitive information, wherein the log contains field data recorded by the target application's existing service interface of the target application during the operation of the target application, and the target application corresponds to N applications, where N is a positive integer greater than or equal to 1; loading a data masking policy into the target application, and using the data masking policy to mask the target data involving specified sensitive fields in the log.

[0100] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0101] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0102] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0103] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0104] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0105] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.

[0106] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.

Claims

1. A method for processing sensitive data, characterized in that: include: Obtain a target application corresponding to a log involving sensitive information, wherein the log includes field data recorded by the target application's existing service interface regarding the target application's running process, wherein the target application corresponds to N applications, where N is a positive integer greater than or equal to 1; the target application includes at least one of the existing service interfaces, and the existing service interface is used to upload sensitive fields; Loading a data masking policy into the target application, and using the data masking policy to mask target data in the log involving designated sensitive fields, including: after the log masking and desensitization switch is turned on, assigning the associated completely masked sensitive fields in the sensitive field set to a first parameter, and assigning the associated partially masked sensitive fields to a second parameter; using a preset annotation policy to obtain the first parameter and the second parameter; and using the data masking policy to mask target data in the log involving the first parameter and the second parameter; Among them, the data masking strategy includes at least masking strategy one, and the masking strategy one includes: traversing the JSON type data in the log to obtain a traversal result, wherein the traversal result includes at least: multiple key-value pairs, each of the key-value pairs includes: a keyword and a corresponding key value; for the key value starting with the first symbol in the traversal result, confirming that an array is embedded in the JSON type data, and converting the array starting with the first symbol into an array of a specified type, and calling masking strategy two to process the converted array; for the key value starting with the second symbol in the traversal result, confirming that the JSON type data is first-class data, and recursively calling masking strategy one to process the first-class data starting with the second symbol; for the key value in the traversal result that is not the first symbol and the second symbol, reducing the font size of the keyword corresponding to the key value, that is, changing the keyword corresponding to the key value to lowercase; for the keyword with the first parameter or the second parameter, masking the keyword and the corresponding key value.

2. The processing method according to claim 1, characterized in that The steps to obtain the target application's logs containing sensitive information include: Obtain a sensitive field set, wherein the sensitive field set includes M sensitive fields, where M is a positive integer greater than or equal to 1; Read the programs that need to print logs from the N applications to obtain an initial program screening set; Analyze the application corresponding to the log involving the sensitive field in the initial program screening set to obtain the target application.

3. The processing method according to claim 1, characterized in that The steps to obtain the sensitive field collection include: Read the sensitive fields sent by each existing service interface of the target application to obtain a reading result; Preprocessing the read result, wherein the preprocessing strategy includes at least one of the following: deduplication, field normalization, and field filtering; The sensitive fields in the preprocessed reading result are aggregated to obtain the sensitive field set.

4. The processing method according to claim 1, characterized in that The data shielding strategy includes at least a shielding strategy 2, and the shielding strategy 2 includes: Get an array of a specified type in the log; For the JSON object in the specified type array, calling the masking strategy 1 to mask the value of the first parameter or the second parameter in the JSON object; Migrate the array subscripts and masked values ​​in the specified type array to a new array object.

5. The processing method according to claim 1, characterized in that The data shielding strategy includes at least shielding strategy three, and the shielding strategy three includes: Obtaining at least one keyword appearing in the MAP data in the log; Obtain a key value corresponding to each keyword, wherein the type of the key value includes at least: a string type and a MAP type; In a case where the type of the key value is the string type, performing a masking operation on the key value having the first parameter or the second parameter; In a case where the type of the key value is the MAP type, the masking strategy three is recursively called to perform a masking operation on the key value having the first parameter or the second parameter.

6. A sensitive data processing device, characterized in that: include: An acquisition unit, configured to acquire a target application corresponding to a log involving sensitive information, wherein the log includes field data recorded by an existing service interface of the target application regarding the operation of the target application, wherein the target application corresponds to N applications, where N is a positive integer greater than or equal to 1; the target application includes at least one existing service interface, and the existing service interface is used to upload sensitive fields; a shielding unit, configured to load a data shielding policy into the target application and use the data shielding policy to shield target data involving designated sensitive fields in the log; The shielding unit includes: an assignment module for assigning, after the log shielding and desensitization switch is turned on, the values ​​of the completely shielded sensitive fields in the sensitive field set to the first parameter, and the values ​​of the partially shielded sensitive fields to the second parameter; a second acquisition module for acquiring the first parameter and the second parameter using a preset annotation strategy; and a shielding module for shielding target data in the log related to the first parameter and the second parameter using the data shielding strategy; Among them, the data masking strategy includes at least masking strategy one, and the masking strategy one includes: traversing the JSON type data in the log to obtain a traversal result, wherein the traversal result includes at least: multiple key-value pairs, each of the key-value pairs includes: a keyword and a corresponding key value; for the key value starting with the first symbol in the traversal result, confirming that an array is embedded in the JSON type data, and converting the array starting with the first symbol into an array of a specified type, and calling masking strategy two to process the converted array; for the key value starting with the second symbol in the traversal result, confirming that the JSON type data is first-class data, and recursively calling masking strategy one to process the first-class data starting with the second symbol; for the key value in the traversal result that is not the first symbol and the second symbol, reducing the font size of the keyword corresponding to the key value, that is, changing the keyword corresponding to the key value to lowercase; for the keyword with the first parameter or the second parameter, masking the keyword and the corresponding key value.

7. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the sensitive data processing method described in any one of claims 1 to 5.

8. An electronic device, characterized in that: The device comprises one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the sensitive data processing method described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Information processing method and apparatus

    CN106295390A

  • Log desensitization method and device

    CN114707180A