Method, apparatus, computer readable medium and computer program product for data desensitization
By configuring rules for data desensitization, low-invasive desensitization processing of log data and database data is achieved, and problems such as irreversible, time-consuming and financial-consuming desensitization processing in the prior art are solved, thereby improving the system's anti-invasiveness and data security.
Patent Information
- Application Number
- CN202411712811.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-18
AI Technical Summary
In the privacy data protection, the existing technology has problems such as irreversible desensitization processing, large amount of data consumes time and money, and pseudo-desensitization is not suitable for the production environment, making it difficult to effectively protect all kinds of privacy data in the system.
Provides a complete privacy data protection desensitization solution, implements low-invasive data desensitization processing by configuring various rules for data desensitization, including desensitization rules for log data and database data, and supports fuzzy queries.
It realizes efficient desensitization of various data, enhances the system's anti-invasiveness, supports flexible fuzzy matching query, meets business needs in different scenarios, and improves data security.
Smart Images

Figure CN119646876A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a method, apparatus, computer-readable medium, and computer program product for data desensitization. Specifically, the present disclosure relates to a desensitization processing scheme for privacy data protection, in which various rules for data desensitization can be configured, such as rules for desensitizing log data, encryption rules for database writing, and desensitized output rules for database reading, etc. Background Art
[0002] In today's digital age, data has become a new asset. The collection, processing and analysis of data in IT projects are crucial for providing personalized services, optimizing user experience, and driving business growth. As the value of data becomes increasingly prominent, data security and privacy issues are also receiving more and more attention. Especially for privacy data, its security and importance are self-evident. Many countries and regions have strict data protection regulations, requiring companies to protect users' privacy data, otherwise they will face serious legal consequences. In addition, the leakage of privacy data may cause huge economic losses to the company, damage the company's reputation, and lead to user loss.
[0003] At present, in the process of enterprise informatization construction, how to effectively and continuously prevent the leakage of private data in IT systems has become an important challenge. There are also endless means and measures for how to protect private data, such as adding stars, encrypting and saving. Privacy data desensitization is an important means of protecting sensitive information. By modifying, replacing or deleting sensitive data, it makes it impossible to identify specific individuals, thereby preventing data leakage. The following are some common methods of desensitizing private data. Masking: This is one of the most common desensitization methods, usually used to process private data involving users such as credit card numbers and phone numbers. For example, most of the digits of a credit card number can be replaced with asterisks, and only the last four digits are displayed. Data slicing: This method divides the data into multiple parts and then only displays part of them. For example, the date of birth can be divided into year, month and day, and then only the year can be displayed. Data replacement: This method replaces sensitive data with other non-sensitive data. For example, the name can be replaced with a randomly generated alias to achieve the purpose of desensitization. Data obfuscation: This method scrambles the order of the data so that it cannot be used for identification. For example, the order of the address can be scrambled so that it cannot identify a specific location. Data forgery: This method generates fake data with the same structure and statistical characteristics as the original data to replace the original data. Data aggregation: This method combines multiple data points into one data point to hide individual data. For example, age data can be grouped to only show the age range instead of the specific age. When desensitizing privacy data, it is also necessary to consider factors such as the sensitivity of the data and the usage scenario, and choose the appropriate desensitization method. At the same time, it is also necessary to regularly review and update the desensitization strategy to respond to new threats and challenges.
[0004] One existing technology is to desensitize and save all private data, such as replacing the characters at the specified position in the string that needs to be desensitized with asterisks or other symbols or replacing the middle four digits of the mobile phone number with asterisks, and using masks to prevent sensitive data leakage. Therefore, the data saved in the database and other middleware is the masked data after desensitization. Similarly, the desensitized data with asterisks is obtained after the system query. The data desensitization of this solution is irreversible, so it is impossible to query the desensitized data and compare the uniqueness of the business data. Therefore, the use scenario of this solution is very limited and is only used in one-time occasions.
[0005] Another existing technology loads all the data into the memory for decryption, and after decryption, fuzzy matching is performed through a program algorithm, or the ciphertext data is mapped to a plaintext mapping table, and then a fuzzy query is performed to associate the ciphertext data to obtain the data. The disadvantage of this technology is that if the amount of data is small, this method can be used, but if the amount of data is large, it will be a disaster, which is time-consuming and costly, and prone to system abnormalities. In addition, due to the use of a plaintext mapping table, there is also unmasked data in the system, which is pseudo-masked, so it is not suitable for use in a production environment, and it is not recommended to use this method for data desensitization.
[0006] Another existing technology is to implement the encryption algorithm function in the database and use the decryption function (decode(key)) during fuzzy query. This method is to implement the encryption and decryption algorithm consistent with the program in the database, so the fuzzy query conditions are modified, and the database encryption and decryption function is used to first decrypt and then fuzzy search, so as to meet business needs. The disadvantage of this technology is that it cannot use the database index to optimize the query, and some databases may not even guarantee the encryption and decryption algorithm consistent with the program implementation, so the usage scenarios are relatively limited.
[0007] To this end, the present disclosure provides a complete set of desensitization processing solutions for privacy data protection, in which various rules for data desensitization can be configured, such as rules for desensitizing log data, encryption rules for database writing, and desensitized output rules for database reading, etc. Through the present disclosure, various types of privacy data in the system can be effectively protected, and the anti-intrusion capability of the system is increased. In addition, in terms of fuzzy query of privacy data, the present disclosure adopts a non-intrusive processing form, which can flexibly implement fuzzy matching query of privacy data, thereby meeting the business requirements of systems in different scenarios. Summary of the invention
[0008] According to one aspect of the present disclosure, a method for data desensitization is provided, comprising: configuring rules for data desensitization, wherein the rules include at least one of the following: rules for desensitizing log data and rules for desensitizing data in a database; receiving data to be desensitized, and determining the type of the data; matching corresponding rules for data desensitization according to the type of the data, and desensitizing the data using the matched rules; and outputting the desensitized data. Through this method, rules for desensitization can be efficiently configured for various data, and desensitization processing for various data can be fully and completely achieved.
[0009] In one aspect, the rules for desensitizing data in the database include at least one of the following: encryption rules for database writing and desensitization output rules for database reading. Through this method, desensitization processing for data can be reversibly achieved.
[0010] In one aspect, the method further comprises intercepting writing and reading to the database to obtain the data to be desensitized. Through this method, desensitization processing for data can be achieved in a low-intrusive manner.
[0011] In one aspect, desensitizing the data using the matched rules further comprises performing word segmentation on the data. Through this method, fuzzy query and output of desensitized data can be achieved, thereby having a more practical effect.
[0012] According to one aspect of the present disclosure, there is provided a device for data desensitization, comprising: a configuration module for configuring rules for data desensitization, wherein the rules include at least one of the following: rules for desensitizing log data and rules for desensitizing data in a database; a receiving module for receiving data to be desensitized and determining the type of the data; a desensitizing module for matching corresponding rules for data desensitization according to the type of the data, and desensitizing the data using the matched rules; and an output module for outputting the desensitized data.
[0013] In one aspect, the rules for desensitizing data in the database include at least one of the following: encryption rules for database writing and desensitizing output rules for database reading.
[0014] In one aspect, the device further comprises an interception module for intercepting writing and reading to a database to obtain data to be desensitized.
[0015] In one aspect, the desensitization module is also used to perform word segmentation processing on the data.
[0016] According to one aspect of the present disclosure, a computer readable medium having instructions stored thereon is provided, wherein when the instructions are executed, the computing device is caused to perform the method described according to the present disclosure.
[0017] According to one aspect of the present disclosure, a computer program product is provided comprising instructions, which, when executed, cause a computing device to perform the method described according to the present disclosure.
[0018] Through the present disclosure, a fast configurable solution for privacy data desensitization is provided, including system output log desensitization, data encryption storage, and data desensitization output. In the present disclosure, the desensitization configuration rules in the project are uniformly managed and maintained, and the configuration and online and offline processing can be conveniently and quickly performed, thereby reducing the probability of system errors and improving the robustness of the system. In the present disclosure, interception technologies such as AOP (Aspect Oriented Programming) are used to reduce the intrusion into business system data, and the adaptive transformation of new systems and existing systems can be quickly connected, reducing development time and speeding up development progress to meet the requirements of enterprise agile development. In the present disclosure, various types of desensitization output formats can be easily customized, which can meet the design requirements of systems with different security levels and protect user data security. In the present disclosure, a unified privacy data desensitization package is encapsulated, and the above functions are uniformly encapsulated. Any subsequent project only needs to introduce a JAR file to complete the data desensitization process, thereby simplifying the generation mechanism, shielding technical details, and conforming to the system abstract modular design concept. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Specific exemplary embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, the present disclosure may be implemented in many different forms and should not be interpreted as being limited to the embodiments set forth herein; rather, these embodiments are provided to make the disclosure comprehensive and complete and will fully convey the scope of the present disclosure to those skilled in the art. The terms used in the detailed description of specific exemplary embodiments shown in the accompanying drawings are not intended to be limiting of the present disclosure. In the accompanying drawings, like numbers refer to like parts.
[0020] Figure 1 is a flow chart showing a method for data desensitization according to an embodiment of the present disclosure;
[0021] Figure 2 is a diagram showing an example of a data model for configuring a desensitization rule according to another embodiment of the present disclosure;
[0022] Figure 3 is a diagram showing an example of an interface generated by encapsulating desensitization rule configuration according to another embodiment of the present disclosure;
[0023] Figure 4 is a diagram showing an example of an interface for querying, adding, modifying and deleting configured rules generated by encapsulation according to another embodiment of the present disclosure;
[0024] Figure 5 is a diagram showing an example of an interface for refreshing a cache generated by encapsulation according to another embodiment of the present disclosure;
[0025] Figure 6 is a diagram showing an example of an interface for inputting user privacy data and data stored in a database according to another embodiment of the present disclosure;
[0026] Figure 7 is a diagram showing an example of output user privacy data according to another embodiment of the present disclosure;
[0027] Figure 8 is a diagram showing an example of performing fuzzy query on desensitized data according to another embodiment of the present disclosure;
[0028] Fig. 9 is a flow chart showing a method for data desensitization according to another embodiment of the present disclosure;
[0029] Fig.10 is a flow chart showing a method for desensitizing log data according to another embodiment of the present disclosure;
[0030] Fig.11 is a diagram showing an example of output after log desensitization according to another embodiment of the present disclosure;
[0031] Fig.12 is a flow chart showing a method for desensitizing data in a database and writing the data into the database according to another embodiment of the present disclosure;
[0032] Fig.13 is a flow chart showing a method for desensitizing data in a database and outputting the data from the database according to another embodiment of the present disclosure;
[0033] Fig.14 is a block diagram showing a device for data desensitization according to another embodiment of the present disclosure;
[0034] Fig.15 is a block diagram showing a device for data desensitization according to another embodiment of the present disclosure;
[0035] Fig.16 is a block diagram showing a system architecture for data desensitization according to another embodiment of the present disclosure;
[0036] Fig.17 is a diagram showing an example of reference of a JAR package according to an embodiment of the present disclosure. and
[0037] Fig.18 is a block diagram illustrating a computing device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solutions and advantages of the present disclosure more clearly understood, the technical solutions of the present disclosure are further described below with reference to the accompanying drawings and embodiments.
[0039] As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless expressly stated otherwise. It should be further understood that, as used in this specification, the term "comprising" means the presence of stated features, integers, steps, operations, parts and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, parts, components and / or groups thereof.
[0040] Figure 1 FIG. 1 is a flow chart showing a method 100 for data desensitization according to an embodiment of the present disclosure. Figure 1 As shown in , at step 102, rules for data desensitization are configured, wherein the rules include at least one of the following: rules for desensitizing log data and rules for desensitizing data in a database. In one embodiment, the rules for data desensitization can be configured through a data model such as a desensitization rule configuration table. Figure 2 FIG. 1 is a diagram showing an example of a data model for configuring desensitization rules according to another embodiment of the present disclosure. Figure 2 As shown, in addition to the desensitization rule configuration table, a user basic information table that can be used in association is also shown. More specifically, an example of the desensitization rule configuration table is shown in Table 1 below:
[0041] Field Name Field Type Remarks Parameter Description id int Integer Auto-increment primary key ID Type String String Category Code subType String String Subcategory code ruleCode String String Rule Encoding Name String String Rule Name Value String String Rule Value data_status String String Data Status create_time Date date Creation time update_time Date date Update time
[0042] Table 1: Desensitization rule configuration table
[0043] Thus, by setting Figure 2 The rules for data desensitization are configured by using the values of the fields in the data model shown in Table 1. According to the present disclosure, the desensitization rule configuration is encapsulated together with the general basic switch parameter configuration to facilitate efficient configuration of the desensitization rule. Figure 3 FIG. 1 is a diagram showing an example of an interface generated by encapsulating desensitization rule configuration according to another embodiment of the present disclosure. Figure 3 As shown, after the encapsulation, the user can configure the global log desensitization switch information according to the needs of the project, including parameter categories, subcategories, desensitization rules, parameter names and parameter values. When the user selects the Insert or Update Parameters button, the configuration parameters can be written into the corresponding basic configuration table. Then, the user can configure the desensitization rules, such as desensitization rules for log data. In one embodiment, the parameter name can be set to the corresponding regular expression, and the parameter value can be set to the replaced output format, so as to achieve the purpose of desensitizing the system log and prevent privacy data leakage. Figure 3In the example shown, a regular expression similar to a mobile phone number is configured so that the middle four digits of the log data that conforms to the regular expression can be replaced by asterisks for masked output, thereby shielding the privacy data and achieving the purpose of data desensitization.
[0044] Alternatively or additionally, one or more of the following items may also be generated by encapsulation: Figure 4 The interface for querying, adding, modifying and deleting configured rules as shown; and Figure 5 The interface for refreshing the cache is shown in FIG. Figure 4 As shown, all configured switches and rule information can be queried through this interface, and corresponding data can be queried, added, modified and deleted through this interface. Figure 4 A screenshot of the operation of deleting a configuration rule is also shown, in which a deletion confirmation window is first displayed to prevent misoperation, and then when the user clicks the confirmation button, the corresponding rule can be set to the deletion state, so that the rule will not take effect during the operation of data desensitization. In one embodiment, after the system is started, all rules and parameters are saved in the cache to speed up the operation of the system. In this embodiment, if the configured rules are modified, added, and deleted, it is necessary to ensure that these operations can take effect in a timely manner. Therefore, if Figure 5 The interface shown provides a cache refresh mechanism. By clicking the "Refresh Configuration" button in the upper right corner, the configured rules can be reloaded to ensure that the rules can take effect immediately.
[0045] Alternatively or additionally, the rules for desensitizing the data in the database include at least one of the following: encryption rules for database writing and desensitization output rules for database reading. According to the present disclosure, the encryption rules for database writing can be implemented by various encryption algorithms, such as symmetric encryption algorithms such as AES (Advanced Encryption Standard), DES (Data Encryption Standard) and asymmetric encryption algorithms such as RSA (Rivest-Shamir-Adleman). In one embodiment, in implementing the encryption rules for database writing, word segmentation technology can also be used for the data to be encrypted to take into account the fuzzy query requirements of subsequent data. Word segmentation technology is the process of dividing a continuous text sequence into individual words or vocabulary units according to certain rules. In one embodiment, rule-based word segmentation methods, statistics-based word segmentation methods, and deep learning-based word segmentation methods can be used. For example, in the word segmentation method based on deep learning, the word boundaries in a large amount of text already in the insurance enterprise system can be learned by a neural network model to apply the word segmentation technology more accurately and efficiently. Further, different encryption strategies can be used for different words after word segmentation is applied. For example, for a text data containing a name, address and telephone number, after word segmentation, one encryption method (such as substitution encryption) can be used for the name, another encryption method (such as fuzzy encryption) can be used for the address, and an encryption algorithm with higher encryption strength (such as AES symmetric encryption) can be used for the telephone number, etc., thereby further improving the flexibility of encryption. Through word segmentation, when it is necessary to retrieve, analyze or share the encrypted data, the encrypted data after word segmentation is easier to operate, such as the fuzzy query requirements mentioned above. For example, in data retrieval, the encrypted vocabulary after word segmentation can be indexed, and whether the retrieval conditions are met can be determined by decrypting part of the vocabulary without completely decrypting the entire text data. In one embodiment, the data processed by word segmentation and encryption can be stored in the field crypt_field in JSON format, thereby further facilitating subsequent query operations. Figure 6 FIG. 1 is a diagram showing an example of an interface for inputting user privacy data and data stored in a database according to another embodiment of the present disclosure. Figure 6 As shown, private data such as mobile phone numbers, ID numbers, and email addresses in the database have been stored in ciphertext.
[0046] The desensitizing output rules for database reading can be configured to output data in various formats, such as plain text, cipher text, mask, etc., so as to complete the output display of private data. Figure 7 FIG. 1 is a diagram showing an example of outputting user privacy data according to another embodiment of the present disclosure. Figure 7As shown in the figure, the mobile phone number is displayed in plain text, the ID number is displayed in a mask with asterisks, and the email address is output in cipher text. In this example, because the above three display formats are configured in the desensitized output rules, the requirements of different application security levels can be met.
[0047] Back to Figure 1 , at step 104, the data to be desensitized is received, and the type of the data is determined. According to the present disclosure, various data can be desensitized, such as the log data and the data in the database described above, etc. In addition, any various data that need to be included can be customized without being limited to privacy data, and the present disclosure is not limited thereto. Alternatively or additionally, the data to be desensitized can be obtained by interception. For example, in an embodiment involving data in the above-mentioned database, the writing and reading of the database can be intercepted to obtain the data to be desensitized. In one embodiment, the writing and reading of the database framework such as Mybatis can be intercepted respectively by an interception method such as AOP to obtain the data to be desensitized. Then, the obtained data is matched with the rules of the corresponding configuration, thereby completing the encrypted storage and desensitized output of the data. In an interception method such as AOP, the writing and reading methods of the database can be intercepted at a specific entry point to obtain the data to be desensitized and the data to be desensitized output respectively for subsequent operations. In this way, these cross-cutting concerns can be separated from the business logic and handled in a more modular and maintainable way, thereby reducing the intrusion into the business system data, quickly connecting new systems and existing systems for adaptive transformation, reducing development time and speeding up development progress, and meeting the requirements of enterprise agile development. Database frameworks such as Mybatis allow developers to separate SQL statements, parameter mappings, and result set mappings into configuration files or annotations, making database operations more flexible and maintainable.
[0048] At step 106, the corresponding rules for data desensitization are matched according to the type of the data, and the matched rules are used to perform desensitization processing on the data. In one embodiment, for data types such as log data, rules such as regular expressions can be matched for desensitization replacement operations of private data. For data types such as data in a database, rules such as encryption and decryption can be matched for desensitization processing and desensitization output. In one embodiment, the above matching can be performed by the category field in the desensitization rule configuration table as described above. In desensitizing data such as log data, the configured parameters can be traversed, and if the corresponding regular expression rules are met, the corresponding data is desensitized, otherwise no processing is performed. In desensitizing data such as data in a database, for example, rules and parameters can be matched according to classes, variables, method names, etc., so as to perform corresponding desensitization processing on the data using encryption methods and word segmentation techniques as described above. In desensitizing output for data such as data in a database, the output display of private data can be completed using the corresponding method (e.g., decryption algorithm) according to the output rules preset in the desensitization output rules (e.g., output formats such as plain text, cipher text, and mask).
[0049] In one embodiment, desensitization processing for log data can be implemented through the Logback log framework. Specifically, the conversionRule configuration element in the Logback log framework can be used to register the desensitization rules for log data in the XML configuration file of the Logback log framework. Then, when the log is output through the Logback log framework, the desensitization rules registered in the XML configuration file can be called to desensitize the log data. In this way, the desensitization rules can be customized, and the parameters of the configured desensitization rules can be dynamically loaded, so as to achieve desensitization output of the log, effectively protect various types of privacy data in the system, and increase the anti-intrusion of the system.
[0050] At step 108, the desensitized data is output. In an embodiment related to log data, the corresponding desensitized log can be output. In an embodiment related to data in a database, the desensitized data can be stored in the database. In another embodiment related to data in a database, the data read from the database is processed by a desensitized output rule, and the corresponding processed data is output, such as data in output formats such as plain text, ciphertext, and mask as described above. In addition, in an embodiment in which word segmentation is performed on data in a database, as described above, the word segmentation and encrypted data can be stored in a field crypt_field in JSON format. In this embodiment, when it is necessary to query related data, the corresponding privacy data is first desensitized (for example, encrypted), and then an exact match is performed using a JSON query method, thereby completing the fuzzy query operation, and the desensitized data is output according to the returned result. Figure 8 FIG. 1 is a diagram showing an example of performing a fuzzy query on desensitized data according to another embodiment of the present disclosure. Figure 8 As shown, a fuzzy query is performed on the user information containing 3611 in the ID card, and the returned result shows two pieces of user information, among which the ID number and email address are anonymized output.
[0051] Fig. 9 FIG. 9 is a flow chart showing a method 900 for data desensitization according to another embodiment of the present disclosure. Fig. 9 As shown, at step 902, an interceptor is configured. In one embodiment, as described above, an interceptor can be configured by an interception method such as AOP. Then, the interceptor can be used to intercept the write and read operations of the database to obtain the data to be desensitized. At step 904, desensitization rules are configured. In one embodiment, as Fig. 9 As shown, the desensitization rules may include one or more of the following: log output desensitization rules, database write desensitization rules, and database output desensitization rules, as described above with reference to Figure 1As described. At step 906, it is determined whether the data meets the desensitization rules. In one embodiment, it is possible to determine whether the log data in the log meets the desensitization rules (e.g., rules defined by regular expressions) by traversing. In another embodiment, the write and read operations of the database can be intercepted by the configured interceptor to obtain the data in the database, and then it is determined whether the data in the obtained database meets the database write desensitization rules or the database output desensitization rules accordingly. If satisfied, the desensitization process corresponding to the desensitization rule is performed at step 908, such as the various desensitization processes described above for the log data and the data in the database. Otherwise, method 900 ends. Alternatively or additionally, in an embodiment such as traversing the log data in the log, if it is determined at step 906 that the data does not meet the desensitization rules, it is possible to return to the traversal operation to further determine whether there are still data to be desensitized to be processed, if so, then proceed to step 906 to continue the operation, otherwise method 900 ends.
[0052] Fig.10 FIG. 1 is a flow chart showing a method 1000 for desensitizing log data according to another embodiment of the present disclosure. Fig.10 As shown, method 1000 can be logically divided into two parts, one for configuring desensitization rules and the other for configuring XML files. It should be understood that such logical division is only for the purpose of easy understanding, and the two parts can be executed in parallel or sequentially, and the present disclosure is not limited thereto. At step 1002, configure the global desensitization switch. In one embodiment, the user can access the built-in WEB page through the network in the client browser to configure the global log desensitization switch of the system. For example, the user can configure the information of the global log desensitization switch according to the needs of the project, including: parameter category, subcategory, desensitization rule, parameter name and parameter value and other information, for example, refer to Figure 3 Described. When the Insert or Update Parameters button is selected, the configuration parameters can be written into the corresponding configuration table. After the system is started, the corresponding desensitization operation can be performed according to the information of the global log desensitization switch. At step 1004, configure the desensitization rules. In one embodiment, it can be configured through regular expressions as described above, that is, configure the keyword matching rules in the log data (expressed by regular expressions) and the corresponding output display format after replacement. At step 1006, set the converter. In one embodiment, a converter for converting log data can be set according to the configured desensitization rules through various programming languages, such as Java, Python, C++, C#, etc. In the configuration XML file part, log desensitization is performed through Logback. At step 1008, set the conversion rule conversionRule. In one embodiment, it can be used <conversionrule>Tag is used to register the converter set at step 1006. In this way, the desensitization rules for log data can be registered in the XML configuration file of the Logback log framework using the conversionRule configuration element in the Logback log framework. At step 1010, the log output mode is configured. In one embodiment, the Logback framework can configure the log output mode according to the converter set at step 1006 and the conversion rule conversionRule set at step 1008, and format the log data in the log according to the mode. For example, if the log data contains a mobile phone number, the middle four digits of the mobile phone number will be replaced with asterisks during output according to the desensitization rules. At step 1012, the desensitized log is output. As Fig.11 In the desensitized output shown, desensitization rules are configured for the ID card number certNo, mobile phone number mobile, and email, thereby achieving the purpose of desensitized display.
[0053] Fig.12 FIG. 1 is a flow chart showing a method 1200 for desensitizing data in a database and writing the data into the database according to another embodiment of the present disclosure. Fig.12 As shown, method 1200 can be logically divided into two parts, which are used to configure encryption rules and AOP interception of database writing. It should be understood that such logical division is only for the purpose of easy understanding. The two parts can be executed in parallel or sequentially, and the present disclosure is not limited to this. At step 1202, configure the database encryption switch. In one embodiment, similar to the global log desensitization switch, the user can access the built-in WEB page through the network in the client browser to configure the database encryption switch. For example, the user can configure the information of the database encryption switch according to the needs of the project, including: parameter category, subcategory, encryption rule, parameter name and parameter value and other information. When the system starts and writes data to the database, the corresponding encryption operation can be performed according to the information of the database encryption switch. At step 1204, configure the encryption rules for database writing. In one embodiment, as described above, the encryption rules for database writing can be implemented by various encryption algorithms, such as AES, DES, RSA, etc. In one embodiment, in implementing the encryption rules for database writing, word segmentation technology can also be used for the data to be encrypted, as described above with reference to Figure 1 As described. At step 1206, a data encryption converter is set. In one embodiment, an encryption converter for converting data to be written to the database can be set according to the configured encryption rules through various programming languages, such as Java, Python, C++, C#, etc. In the write part of the AOP interception database, the write operation of the database framework such as Mybatis can be intercepted by an interception method such as AOP to obtain the data to be desensitized. At step 1208, Mybatis writes and updates are intercepted. In the AOP interception, the data to be desensitized can be obtained by intercepting the write and update methods of the database at a specific entry point, and these data will be written and / or updated to the database through Mybatis. At step 1210, the encryption rules are matched for data processing. In one embodiment, the data encryption converter set at step 1206 can be used to process (encrypt) the data obtained by interception at step 1208. At step 1212, the encrypted data is stored in the database. As Figure 6 In the example of desensitized storage of data in the database shown, private data such as mobile phone numbers, ID numbers, and email addresses in the database have been saved in ciphertext. In addition, in the field crypt_field, private data is segmented and encrypted and saved in a JSON format field for subsequent fuzzy query.
[0054] Fig.13 FIG. 1 is a flow chart showing a method 1300 for desensitizing data in a database and outputting the data from the database according to another embodiment of the present disclosure. Fig.13 As shown, method 1300 can be logically divided into two parts, which are used to configure decryption rules and AOP interception database reading. It should be understood that such logical division is only for the purpose of easy understanding. The two parts can be executed in parallel or sequentially, and the present disclosure is not limited thereto. At step 1302, the database decryption switch is configured. In one embodiment, similar to the database encryption switch, the user can access the built-in WEB page through the network in the client browser to configure the database decryption switch. For example, the user can configure the information of the database decryption switch according to the needs of the project, including: parameter category, subcategory, decryption rule (including desensitization output rule for data), parameter name and parameter value and other information. When the system starts to read data from the database and output, the corresponding decryption operation can be performed according to the information of the database decryption switch. At step 1304, the decryption rules for database reading are configured. In one embodiment, the desensitization output rules for database reading can be configured, which can be configured to output data in various formats, such as plain text, cipher text, mask and other output formats, so as to complete the output display of privacy data. At step 1306, a data decryption converter is set. In one embodiment, a decryption converter for converting the data to be read from the database can be set according to the configured decryption rules through various programming languages, such as Java, Python, C++, C#, etc. In the AOP interception of the database reading part, the reading operation of the database framework such as Mybatis can be intercepted through an interception method such as AOP to obtain the data to be desensitized. At step 1308, Mybatis reading is intercepted. In AOP interception, the data to be desensitized can be obtained by intercepting the database reading method at a specific entry point, and these data will be read from the database through Mybatis. At step 1310, the decryption rules are matched for data processing. In one embodiment, the data decryption converter set at step 1306 can be used to process the data obtained by interception at step 1308 (desensitization before output). At step 1312, the data read from the database is output. As Figure 7 In the desensitized output of the data in the database shown, the mobile phone number is output in plain text, the ID number is displayed with an asterisk mask, and the email address is output in cipher text.
[0055] Fig.14 FIG. 1 is a block diagram showing an apparatus 1400 for data desensitization according to another embodiment of the present disclosure. Fig.14 As shown, the device 1400 may include a configuration module 1402, a receiving module 1404, a desensitization module 1406, and an output module 1408. The configuration module 1402 may be used to configure rules for data desensitization, wherein the rules include at least one of the following: rules for desensitizing log data and rules for desensitizing data in a database. For example, the configuration of the rules for data desensitization may be performed by the various methods described above, such as configuring desensitization rules for log data, encryption rules and decryption rules for data in a database, and the like. The receiving module 1404 may be used to receive data to be desensitized, and determine the type of the data. For example, the data may be log data obtained by traversing a log file, data to be written into a database obtained by intercepting database writes, and data to be read from a database obtained by intercepting database reads, and the like. The desensitization module 1406 may be used to match corresponding rules for data desensitization according to the type of the data, and desensitize the data using the matched rules. For example, the corresponding data obtained can be desensitized by desensitization rules for log data, encryption rules and decryption rules for data in the database. The output module 1408 can be used to output desensitized data. For example, desensitized log data and private data read from the database can be output, and the desensitized data can be stored in the database, etc. In various embodiments, the corresponding modules in the device 1400 can be used to perform the steps of any method described herein.
[0056] Fig.15 FIG. 1 is a block diagram showing an apparatus 1500 for data desensitization according to another embodiment of the present disclosure. Fig.15 As shown, the device 1500 may include a global desensitization switch configuration module 1502, which can configure the system log desensitization switch and the database privacy data encryption and decryption switch according to the actual situation of the project. After the system is started, the system desensitization, encryption and decryption operations are completed according to the parameters of these switches. The device 1500 may include a desensitization rule configuration module 1504. When the above switch is turned on, the log data is desensitized and the database data is encrypted and decrypted according to the configuration items of the rules configured by the desensitization rule configuration module 1504. In one embodiment, the desensitization replacement operation of the log data is performed by matching the log data with regular expressions, and the desensitization of the data in the database is completed by matching the rules and parameters according to the class, variable, method name, etc., so as to have a wide range of usage scenarios. The device 1500 may include an XML file configuration module 1506 for configuring XML files such as in the Logback framework. As described above, Logback is a flexible and powerful logging framework that can easily log in Java applications. In Logback, conversionRule can be used to define custom conversion rules to achieve customization of the log output format. In the XML configuration file of Logback, the desensitization of the log data is completed by configuring the corresponding desensitization method in the project, and the corresponding desensitized log is output. The device 1500 may include a database privacy data encryption writing module 1508, which can intercept the write and update operations of the Mybatis database framework in an AOP manner. Then, the database privacy data encryption writing module 1508 generates corresponding encrypted data according to the encryption switch and encryption rules defined by the desensitization rule configuration module 1504, and saves it to the database, thereby completing the encryption desensitization of the data and ensuring the security of the privacy data in the system. In addition, considering the fuzzy query requirements of the data, the database privacy data encryption writing module 1508 can use word segmentation technology for the data to be encrypted. After the privacy data is word segmented and encrypted, it can be stored in the newly created JSON field crypt_field of the system to facilitate subsequent query operations. The device 1500 may include a database data output desensitization module 1510, which can intercept the database read operation through AOP, and according to the desensitization output rules defined by the desensitization rule configuration module 1504, complete the data output in the ciphertext, plaintext, star mask and other formats of the data, thereby meeting the requirements of different security levels in different business scenarios. In addition, fuzzy query on privacy data can also be performed in the database data output desensitization module 1510. According to the word segmentation encryption field of the database privacy data encryption writing module 1508, fuzzy query output on privacy data can be achieved, which has a more practical effect.
[0057] Fig.16 FIG. 1 is a block diagram showing a system architecture for data desensitization according to another embodiment of the present disclosure. Fig.16 In the system shown, users can access the WEB page through the network in the client browser to perform system operations. The operation request is verified by the gateway for permissions, etc. If the verification is passed, the user completes the system request input. The system can replace the output of data according to the configured log desensitization switch and log desensitization rules, thereby completing the desensitization processing of the system log to prevent data leakage. At the same time, the application server intercepts operations such as writing or updating the database, encrypts the data according to the configured data encryption switch and encryption configuration parameters, and then writes it into the database, thereby ensuring that there is no plaintext privacy data in the database, and all are encrypted ciphertext data, which effectively ensures the security of the data. The application server can also intercept the database read operation, and according to the configured privacy data display rules, it can output and display plaintext data, ciphertext data, and desensitized and starred data, thereby meeting the data output and display requirements for different security levels.
[0058] Additionally or alternatively, the present disclosure can provide a JAR method with a built-in data desensitization configuration page, including desensitization switches and rule configurations, and can perform rule addition, deletion, modification and query operations. The subsequent system can automatically complete the system desensitization processing according to the configured rules. The present disclosure shields the specific technical implementation details, and users do not need to care about the specific implementation logic. Data desensitization can be quickly completed in a configured manner. It is suitable for new system development and old system transformation, thereby speeding up project development progress, reducing development time, improving development efficiency, and reducing the probability of errors, forming a safe, flexible, and efficient docking method. Fig.17 An example of referencing a JAR package according to an embodiment of the present disclosure is shown.
[0059] Additionally or alternatively, the above methods, universal docking modules, service platforms or third-party platforms of the present disclosure may be implemented on one or more computers or servers or similar devices using computer processors, memory units, storage devices, computer software and other components. A high-level block diagram of such a computer or server is shown in Fig.18 1802. Computers, servers, or other devices including processors are collectively referred to herein as computing devices. Computing device 1802 includes processor 1804, which controls the operation of computer 1802 by executing computer program instructions that define the overall operation. The computer program instructions may be stored in a storage device 1812 (e.g., a disk) and loaded into memory 1810 when the computer program instructions need to be executed. Therefore, reference is made to Figure 1 , Fig. 9 , Fig.10 , Fig.12 and Fig.13 The steps of the method may be defined by computer program instructions stored in the memory 1810 and / or storage device 1812 and controlled by the processor 1804 executing the computer program instructions. The computing device 1802 also includes one or more network interfaces 1806 for communicating with other devices via a network. The computing device 1802 also includes other input / output devices 1808 (e.g., a display, keyboard, mouse, speakers, buttons, etc.) that enable a user to interact with the computer 1802. Those skilled in the art will recognize that the implementation of the actual computer may also include other components, and Fig.18 is a high-level representation of some of the components of such a computer for illustration purposes.
[0060] The storage device 1812 and the memory 1810 each include a tangible, non-transitory computer-readable storage medium. The storage device 1812 and the memory 1810 may each include a high-speed random access memory, such as a dynamic random access memory (DRAM), a static random access memory (SRAM), a double data rate synchronous dynamic random access memory (DDR RAM), or other random access solid-state memory devices, and may include non-volatile memory, such as one or more magnetic disk storage devices (such as internal hard disks and removable disks), magneto-optical disk storage devices, optical disk storage devices, flash memory devices, semiconductor memory devices (such as erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM)), compact disk read-only memory (CD-ROM), digital versatile disk read-only memory (DVD-ROM) disks, or other non-volatile solid-state storage devices.
[0061] In another embodiment, the above method, universal docking module, service platform or third-party platform can be implemented in a network-based cloud computing system. In such a network-based cloud computing system, the server communicates with one or more client computers via a network. The client computer can communicate with the server, for example, via a web browser application resident on and running on the client computer. The client computer can store data on the server and access the data via the network. The client computer can transmit data requests or online service requests to the server via the network. The server can implement the requested service and provide the data to (one or more) client computers. The server can also transmit data adapted to enable the client computer to implement a specified function (e.g., implement calculations, display specified data on the screen, etc.). Some steps of the above method can be implemented by a server or by other computers / processors in a network-based cloud computing system. Some steps of the above method can be implemented locally by a client computer in a network-based cloud computing system. The steps of the above method can be implemented in any combination by one or more devices in a network-based cloud computing system or by a local client computer.
[0062] It should be appreciated that certain features of the disclosure described in the context of separate embodiments for clarity may also be provided in combination in a single embodiment. Conversely, various features of the disclosure described in the context of a single embodiment for simplicity may also be provided individually or in any suitable sub-combination or as appropriate in any other described embodiment of the disclosure. Certain features described in the context of various embodiments should not be considered essential features of those embodiments unless the embodiment is ineffective without those elements.
[0063] Although the present disclosure has been described in conjunction with the specific embodiments of the present disclosure, it is obvious that many substitutions, modifications and changes will be obvious to those skilled in the art. Therefore, it is intended to cover all such substitutions, modifications and changes that fall within the spirit and broad scope of the appended claims.
[0064] All publications, patents, and patent applications mentioned in this specification are incorporated herein by reference in their entirety to the same extent as if each individual publication, patent, or patent application was specifically and particularly indicated to be incorporated herein by reference. In addition, citation or identification of any reference in this disclosure should not be construed as an admission that such reference is available as prior art to the present disclosure. Where section headings are used, they should not be construed as necessarily limiting.< / conversionrule>
Claims
1. A method for data desensitization, comprising: Configuring rules for data desensitization, wherein the rules include at least one of the following: a rule for desensitizing log data and a rule for desensitizing data in a database; Receiving data to be desensitized and determining the type of the data; Matching corresponding rules for data desensitization according to the type of the data, and desensitizing the data using the matched rules; as well as Output the desensitized data.
2. The method according to claim 1, wherein the rules for desensitizing data in the database include at least one of the following: encryption rules for database writing and desensitizing output rules for database reading.
3. The method according to claim 2, further comprising: Intercept writes and reads to the database to obtain the data to be desensitized.
4. The method according to claim 2, wherein desensitizing the data using the matched rules further comprises performing word segmentation on the data.
5. A device for data desensitization, comprising: A configuration module, configured to configure rules for data desensitization, wherein the rules include at least one of the following: a rule for desensitizing log data and a rule for desensitizing data in a database; A receiving module, used to receive the data to be desensitized and determine the type of the data; A desensitization module, used to match corresponding rules for data desensitization according to the type of the data, and perform desensitization processing on the data using the matched rules; as well as The output module is used to output the desensitized data.
6. The apparatus according to claim 5, wherein the rules for desensitizing data in the database include at least one of the following: encryption rules for database writing and desensitizing output rules for database reading.
7. The device according to claim 6 further comprises an interception module for intercepting writing and reading to the database to obtain the data to be desensitized.
8. The device according to claim 6, wherein the desensitization module is also used to perform word segmentation processing on the data.
9. A computer readable medium having stored thereon instructions which, when executed, cause a computing device to perform the method of any one of claims 1-4.
10. A computer program product comprising instructions which, when executed, cause a computing device to perform the method according to any one of claims 1 to 4.