Efficient API refined security management and control method based on asynchronous logic

By using asynchronous logic API fine-grained security control methods in the microservice architecture, the balance between business security and user experience is achieved, the delay problem caused by serial security verification is solved, and quantitative performance improvement evaluation is provided.

CN119316212APending Publication Date: 2025-01-14COMP APPL RES INST CHINA ACAD OF ENG PHYSICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411446986.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

In the microservice architecture, serial processing of business security verification leads to increased computing resource consumption and delay, affecting user experience and business development.

Method used

Using an API based on asynchronous logic, the precision security management and control method is adopted. By inserting the sentry module in the business system, the security management and control delay is reduced, and a business security management and control user experience calculation method is proposed to quantify performance improvement. .

Benefits of technology

It effectively reduces the delay in business security control, improves user experience, and provides quantitative performance improvement evaluation through the calculation method of user experience impact value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316212A_ABST
    Figure CN119316212A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of application self-defense, in particular to an efficient API (Application Program Interface) refined security control method based on asynchronous logic, which is characterized in that a sentinel module for business security control is instrumented in a business process, and the sentinel module is responsible for collecting business context data and transmitting the business context data to a security analysis module; the security analysis and the business process are executed in parallel; the process is operated in an asynchronous process, that is to say, after the guard module sends the collected data to the security analysis module, the guard module waits for a security analysis result all the time, and the whole process will not block the business process. The time delay influence in service security control is reduced, the service security control performance is improved, the service user experience is improved while the service security is ensured, and in order to further measure the experience influence of the service security control on a service system, the service security control method and device are provided. The invention also provides a business security control user experience influence value calculation method related to the security defense method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of application self-defense technology, and specifically to an efficient API refined security management and control method based on asynchronous logic. Background Art

[0002] With the rapid development of computer technology, B / S architecture applications based on microservices have sprung up in all walks of life. An application system often involves several or even hundreds of microservices, and the number of various API (Application Programming Interface) interfaces is astonishing. On the one hand, microservices speed up the code development, decouple various fields, and improve software production capacity. On the other hand, the call link becomes complicated and the data flow becomes more unpredictable. Once a risky operation occurs, the scope of influence may expand in a short period of time, greatly increasing security risks.

[0003] There are many solutions in the industry for the security issues brought by microservices, such as fuse mechanism, canary release, rollback mechanism, application self-defense, etc. These solutions can be mainly divided into two types: passive defense and active defense. Passive defense mainly strives to reduce the scope of the problem after the security problem occurs, while active defense is to block the propagation path of the security problem before or during the security problem occurs. It can be seen that the two types of defense focus on different stages of the business process, so businesses generally use active and passive defenses in combination.

[0004] Application self-defense has been widely used in the industry with its unique technical model and practical and efficient protection mechanism. On the one hand, application self-defense can block the security risk behavior of the business in real time, and on the other hand, it will also record and report the risk context, so that the business party can carry out governance and rectification in a timely manner. Figure 1 This is a typical schematic diagram of the application of self-defense technology.

[0005] Application self-defense builds a defense system before the business logic to perform security analysis and verification on data requests or returns in business access, such as user information, input and output, uploaded files, etc. Once risks are found in these data, the business process will be terminated before the risk reaches the next business node to prevent the risk from spreading further. Figure 2 shown.

[0006] Generally speaking, application self-defense adds its own sentinel module between business process nodes, which is responsible for collecting business data, passing the data to the security analysis module for security verification, and determining whether to continue the business process after obtaining the security analysis results. However, business security defense requires computing resources for data analysis and other operations, which is time-consuming. At present, this serial business security verification undoubtedly increases the overall latency of the business, reduces user experience, and affects the development of the business to a certain extent. Summary of the invention

[0007] In view of the above problems, the purpose of the present invention is to provide an efficient API refined security management method based on asynchronous logic, reduce the delay impact in business security management, and improve the business user experience while ensuring business security. In addition, in order to further measure the experience impact of business security management on the business system, the present invention also proposes a method for calculating the business security management user experience impact value related to the security defense method. The technical solution is as follows:

[0008] An efficient API refined security management method based on asynchronous logic, which completes the insertion of the sentinel module in the code logic of the business system. The sentinel module is responsible for collecting business context data and passing the business context data to the security analysis module; the security analysis module is an independently deployed service that is used to receive data transmitted by the sentinel module, analyze the data, and return the analysis results;

[0009] Security analysis and business processes are executed in parallel. In the two cases where the security analysis and business processes are completed in a different order, the handling measures are as follows:

[0010] When the security analysis is completed later than the business process, the main business process will be handed over to the sentinel module of business security control after it reaches the security analysis insertion point; the sentinel module will pass the business context data to the security analysis module for security analysis, and continue to execute the main business process at the same time; after the main business process is executed, the business result data will be handed over to the sentinel module for hosting, and the sentinel module will continue to wait for the results of the security analysis; after obtaining the results of the security analysis, the sentinel module will block the business and roll back the business process according to the security analysis results, or release the business;

[0011] When the security analysis is completed before the business process is executed, after the main business process executes to the security analysis insertion point, it is handed over to the sentinel module of business security control, and the security analysis and the main business process are executed in parallel; the security analysis results are returned to the sentinel module first, at which time the sentinel module determines whether to continue the business process based on the status of the security analysis results. If there is a risk, the sentinel module immediately blocks and rolls back the business process and will no longer wait for its results to be returned; if there is no risk, the business is released and continues to wait for the business results.

[0012] Furthermore, it also includes calculating the impact value of business security management and control on user experience, and making a comprehensive analysis of business user experience. The calculation formula is as follows:

[0013]

[0014] Where R is the impact value of business security management and user experience, M i is the business impact factor of the ith API involved in the link request, n is the number of all APIs involved in a link request; S j is the security risk factor of the jth security control point involved in the link request, n ′ is the number of security control points involved in a link request; T is the average time consumption of a certain API interface; t is the average time consumption of all API interfaces under the business;

[0015] The higher the R value, the greater the impact of the corresponding API's business security control on the user experience, and vice versa.

[0016] The main purpose of this calculation formula is to quantify the improvement in performance efficiency of this invention patent compared to traditional application self-defense technology. Conventional application self-defense technology currently on the market adopts a serial logic process, which is inefficient. According to the above user experience calculation formula, a larger R value will be obtained. After replacing it with the technical method of the present invention, it can effectively reduce latency and improve efficiency. A smaller R value will be obtained through the user experience calculation formula again. For the application self-defense of the business system, it is a complex process affected by multiple dimensions. The present invention abstracts it into a calculation method and obtains a final result, which is expressed concretely.

[0017] Furthermore, the value of the service impact factor is determined by the service impact scope, user traffic, delay sensitivity and user stay time;

[0018] The business impact scope refers to the degree of coupling between a business module or function and the business of this system, that is, the degree of dependence of the business of this system on the business module or function, corresponding to the business usage level; the user traffic refers to the daily independent active users of a business module or function, that is, the number of independent users who use the business module or function every day; the delay sensitivity refers to the tolerance of the user to the maximum delay that a business module or function can accept; the user stay time refers to the length of time a user stays in a business module or function;

[0019] The security risk factor is determined by the impact scope, repair difficulty and triggering conditions;

[0020] The impact scope refers to the degree of coupling between a business module or function and the business of this system, that is, the degree of dependence of the business of this system on the business module or function, which corresponds to the level of risk; the repair difficulty refers to the difficulty of repairing a business module or function after a risk occurs; the trigger condition refers to the difficulty of triggering this risk for users or attackers after a risk occurs in a business module or function.

[0021] The beneficial effects of the present invention are:

[0022] The present invention effectively adopts the principle of asynchronous technology, allowing the business logic and security analysis logic to be carried out simultaneously, reducing the security management delay. At the same time, by comparing different processing results of security analysis, appropriate business release and termination methods are adopted to ensure the security management of the business and improve business performance.

[0023] The present invention starts from various aspects of the impact of business security self-defense on business performance, integrates and summarizes them into a fixed formula for user experience impact, which can intuitively and conveniently view the specific good and bad values ​​of the impact of business security management on the business. At the same time, it also provides a quantitative calculation method for the specific improvement value of the security management method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 A typical schematic diagram of the application of self-defense technology.

[0025] Figure 2 Self-defense business process diagram for existing applications.

[0026] Figure 3 This is a safety control flow chart for the present invention when the safety analysis is performed later than the completion of the business process.

[0027] Figure 4 This is a safety management and control flow chart for the safety analysis of the present invention before the business process is completed. DETAILED DESCRIPTION

[0028] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0029] 1. Non-blocking asynchronous processing method for business security management

[0030] First, the service used for security control computing needs to be deployed independently of the business service. The responsibility of this service is to accept business context data input, verify this data, and pass the verification results to the sentinel in the business server.

[0031] The business process also needs to insert the sentinel module for business security control. This module is responsible for collecting business context data and passing the business context data to the security analysis module, but this process will be operated in an asynchronous thread. That is to say, after the sentinel module sends the collected data to the security analysis module, it will wait for the results of the security analysis. However, since the waiting operation is in an asynchronous thread, the business process can enable another thread separately to continue to execute business operations. Then the entire security control process will not block the business process, thereby reducing business time and improving performance.

[0032] The security analysis module is an independently deployed service that has the ability to receive data transmitted by the sentinel module, analyze the data, and return the analysis results. In traditional application self-defense technology, before the security analysis module returns the analysis results, the sentinel module will suspend the business process and wait until the security analysis results are executed. Then, based on the analysis results, it will choose whether to continue the business process. In this inventive method, the security analysis and the business process are executed in parallel, so that the security analysis does not block the business process, thereby improving the efficiency of business execution.

[0033] Figure 2 For example, the original logic of a business system is to execute from A to B, but due to security requirements, it is necessary to increase the business security control logic, so Figure 2 The process below requires security analysis of the business data of node A before it can reach node B. This is a typical process of traditional application self-defense technology, in which the business needs to wait for the security analysis to be completed before continuing to execute subsequent business processes, which obviously increases the overall duration of the business. The present invention optimizes the performance of this link, adopts the principle of asynchronous technology, allows the business logic and security analysis logic to be carried out simultaneously, reduces the security control delay, and at the same time, by comparing the different processing results of the security analysis, adopts appropriate business release and termination methods to ensure the security control of the business, effectively reduces the business delay of traditional business self-defense, and improves business performance.

[0034] In the method of the present invention, security analysis and business processes are executed in parallel. Although the performance is improved, since both processes are time-consuming, there is a difference in the order in which security analysis and business processes are completed. Therefore, for the two situations of difference in order, the business security management and control non-blocking asynchronous processing method specifically proposes two processing measures:

[0035] (1) Security analysis is completed later than business process execution

[0036] After the main business process is executed to the security analysis plug-in point, it is handed over to the sentinel module of business security control. At this time, the sentinel module passes the business context to the security analysis module for security analysis, and continues to execute the main business process at the same time. After the main business process is executed, the business result data is handed over to the sentinel module for hosting, and the sentinel module will continue to wait for the results of the security analysis. After obtaining the results of the security analysis, the sentinel module will block or release the business according to the results of the security analysis.

[0037] The safety management process diagram when safety analysis is performed later than the business process is completed is as follows Figure 3 shown.

[0038] (2) Security analysis is completed before business processes are executed

[0039] After the main business process is executed to the security analysis insertion point, it is handed over to the sentinel module of business security control, and the security analysis and the main business process are executed in parallel. The security analysis results are returned to the sentinel module first. At this time, the sentinel module needs to determine whether to continue the business process based on the status of the security analysis results. If there is a risk, the sentinel module will immediately terminate the business process and will not wait for its results to be returned. If there is no risk, the business will be released and continue to wait for the business results.

[0040] The safety management and control process diagram when safety analysis is performed before the business process is completed is as follows Figure 4 shown.

[0041] There are four specific business scenarios, each of which describes the performance improvement benefits:

[0042] a. When the security analysis is completed before the business is executed and the security analysis determines that there is no risk:

[0043] The overall time consumption of traditional application self-defense technology is: security analysis time + business execution time;

[0044] The overall time consumption of the present invention is: business execution time.

[0045] b. When the security analysis is completed later than the business execution, and the security analysis determines that there is no risk:

[0046] The overall time consumption of traditional application self-defense technology is: security analysis time + business execution time;

[0047] The overall time consumption of the present invention is: security analysis time.

[0048] c. When the security analysis is completed before the business is executed and the security analysis determines that there is a risk:

[0049] The overall time consumption of traditional application self-defense technology is: security analysis time;

[0050] The overall time consumption of the present invention is: security analysis time.

[0051] d. When the security analysis is completed later than the business execution and the security analysis determines that there is a risk:

[0052] The overall time consumption of traditional application self-defense technology is: security analysis time;

[0053] The overall time consumption of the present invention is: security analysis time.

[0054] It can be seen that in both cases a and b, the present invention has performance improvement, and cases a and b account for the highest proportion, because security analysis determines that no risk should be the norm for a business, and business risk is a low-probability event. It is impossible for a business to have risks under high probability.

[0055] 2. Calculation method of user experience impact value of business security management

[0056] For the application self-defense of the business system, it is a complex process affected by multiple dimensions, because the business system needs to consider the user experience and make the business response as fast as possible, and also needs to take care of the system security. Adding security detection means to the system business process generally takes time to process, which increases the overall time consumption of the business. Therefore, if you want to measure the improvement of business performance by a business security control, you need to measure it from multiple dimensions. For example, if an important business involves money, more security analysis can be done, and the overall business time consumption will be longer; while for some marketing activity processes, less security analysis will be done, so that the business can be presented faster.

[0057] In addition to the business system's own process, application self-defense adds a series of logic such as context collection and security analysis. On the one hand, it increases the overall time consumption of the business, but on the other hand, it reduces security risks and improves stability. Therefore, a comprehensive evaluation method is needed to conduct a comprehensive analysis of the business user experience. This invention proposes a new method for calculating the user experience impact value of business security management, which comprehensively evaluates a value from multiple angles such as business time consumption, business importance, and risk impact to measure the degree of impact of application self-defense on the user experience of the API.

[0058] First, make the following definition:

[0059] a) Business impact factor M, 0≤M≤10.

[0060] The interpretation of the business impact factor values ​​is shown in Table 1.

[0061] Table 1 Explanation of business impact factor values

[0062] M value Business impact User traffic Delay Sensitivity User stay time 10 3 3 3 3 9 3 3 2 3 8 3 3 2 2 7 2 3 3 3 6 2 3 3 2 5 2 3 2 2 4 2 2 3 3 3 1 2 3 3 2 1 2 2 2 1 1 1 1 1 0 0 0 0 0

[0063] Note: Service impact scope, user traffic, latency sensitivity, and user stay time are represented by 3, 2, and 1, respectively, according to "Severe (high)", "General (medium)", and "None (low)". If there is no corresponding value in the table, find the corresponding value by starting from M.

[0064] Business impact scope: refers to the degree of coupling between a business module or function and the business of this system or other systems. It can also be understood as the degree of dependence of the business of this system or other systems on this business module or function. It refers to the business usage level. For example, the identity function module of the shopping software is strongly coupled with other shopping modules, and other modules are highly dependent on it.

[0065] User traffic: refers to the DUA (Daily Unique Active Users) of a business module or function, that is, the number of unique users who use the business module or function every day.

[0066] Delay sensitivity: The maximum delay that users can tolerate for a business module or function. For example, in the train ticket purchase business, users have a low tolerance for delay, which can also be considered to be very sensitive to delay. However, when opening a news page, users are not so sensitive to delay.

[0067] User stay time: how long a user stays in a business module or function. For example, when a user logs in, it starts from entering the login page to clicking the login button to enter the system. This is the length of time the user stays in the login function.

[0068] b) The average time consumption of an API interface is T, where the value is the millisecond value of the service request consumption, T≥0.

[0069] c) The average time consumption t of all API interfaces under this business, which is also in milliseconds, t≥0.

[0070] d) The number of all APIs involved in a link request is n, where n>0.

[0071] e) The number of security control points involved in a link request is n′, 0 <n′≤n。

[0072] f) Safety risk factor S, 1≤S≤10.

[0073] The explanation of the safety risk factor values ​​is shown in Table 2.

[0074] Table 2 Explanation of safety risk factor values

[0075] S value Impact Repair difficulty Trigger conditions 10 3 3 1 9 3 3 2 8 3 3 3 7 2 3 1 6 2 2 2 5 2 2 3 4 1 2 3 3 1 1 1 2 1 1 2 1 1 1 3

[0076] Note: Impact scope, repair difficulty, and trigger conditions are represented by 3, 2, and 1 according to "Severe (high)", "General (medium)", and "None (low)". If there is no corresponding value in the table, the corresponding value is found by taking the value downward from S.

[0077] Impact scope: refers to the degree of coupling between a business module or function and the business of this system or other systems. It can also be understood as the degree of dependence of the business of this system or other systems on this business module or function. It is almost the same as the "business impact scope" mentioned above, but this time it is viewed from the perspective of risk, that is, if the business has a risk, which businesses will be affected. The more businesses are affected and the more serious the risk, the higher the score.

[0078] Repair difficulty: refers to how difficult it is to repair a business module or function after a risk occurs. It is generally considered from the repair time, technical requirements of the repair personnel, etc. The more difficult the repair, the higher the score.

[0079] Trigger condition: refers to the difficulty of triggering a risk for a user or attacker after a business module or function has a risk. For example, in the case of password theft, an attacker needs to retry the password hundreds of millions of times before stealing the first few digits of the password; in the case of white screen risk, a white screen is triggered when a user enters the page. Compared with the latter, the trigger condition of the former is more stringent, and the score of the trigger condition is higher.

[0080] The business security control user experience impact value R is calculated as follows:

[0081]

[0082] Where R is the impact value of business security management and user experience, M i is the business impact factor of the ith API involved in the link request, n is the number of all APIs involved in a link request; S j is the security risk factor of the jth security control point involved in the link request, n ′ is the number of security control points involved in a link request; T is the average time consumption of a certain API interface; t is the average time consumption of all API interfaces under the business.

[0083] The higher the R value, the greater the impact of the API's business security management on the user experience, that is, it may have a negative impact on the business. Conversely, the smaller the impact on the experience, there is almost no negative impact on the business.

[0084] The present invention starts from various aspects of the impact of business security self-defense on business performance, integrates and summarizes them into a fixed formula for user experience impact, which can intuitively and conveniently view the specific good and bad values ​​of the impact of business security management on the business. At the same time, it also provides a quantitative calculation method for the specific improvement value of the security management method of the present invention.

Claims

1. An efficient API refined security management method based on asynchronous logic, characterized in that: Complete the insertion of the sentinel module in the code logic of the business system. The sentinel module is responsible for collecting business context data and passing the business context data to the security analysis module; The security analysis module is an independently deployed service that is used to receive data transmitted by the sentinel module, analyze the data, and return the analysis results; Security analysis and business processes are executed in parallel. In the two cases where the security analysis and business processes are completed in a different order, the handling measures are as follows: When the security analysis is completed later than the business process, the main business process is executed to the security analysis insertion point and then handed over to the sentinel module of business security control; the sentinel module transmits the business context data to the security analysis module for security analysis, and continues to execute the main business process at the same time; After the main business process is executed, the business result data will be handed over to the sentinel module for hosting, and the sentinel module will continue to wait for the results of the security analysis; After obtaining the results of the security analysis, the Sentinel module will block the business and roll back the business process, or release the business according to the security analysis results; When security analysis is completed before the business process is executed, the main business process is executed to the security analysis insertion point and then handed over to the sentinel module of business security control, and the security analysis and the main business process are executed in parallel; The security analysis results are first returned to the Sentinel module. At this time, the Sentinel module determines whether to continue the business process based on the status of the security analysis results. If there is a risk, the Sentinel module immediately blocks and rolls back the business process without waiting for the results to be returned. If there is no risk, the business will be released and the business results will continue to be waited for.

2. According to claim 1, the efficient API refined security management and control method based on asynchronous logic is characterized in that: It also includes calculating the impact value of business security management and control on user experience, and making a comprehensive analysis of business user experience. The calculation formula is as follows: Where R is the impact value of business security management and user experience, M i is the business impact factor of the ith API involved in the link request, n is the number of all APIs involved in a link request; S j is the security risk factor of the jth security control point involved in the link request, n ′ The number of security control points involved in a link request; T is the average time consumption of a certain API interface; t is the average time consumption of all API interfaces under the business; The higher the R value, the greater the impact of the corresponding API's business security control on the user experience, and vice versa.

3. The efficient API refined security management and control method based on asynchronous logic according to claim 2 is characterized in that: The value of the service impact factor is determined by the service impact scope, user traffic, delay sensitivity and user stay time; The business impact scope refers to the degree of coupling between a business module or function and the business of this system, that is, the degree of dependence of the business of this system on the business module or function, corresponding to the business usage level; the user traffic refers to the daily independent active users of a business module or function, that is, the number of independent users who use the business module or function every day; the delay sensitivity refers to the tolerance of the user to the maximum delay that a business module or function can accept; the user stay time refers to the length of time a user stays in a business module or function; The security risk factor is determined by the impact scope, repair difficulty and triggering conditions; The impact scope refers to the degree of coupling between a business module or function and the business of the system, that is, the degree of dependence of the business of the system on the business module or function, corresponding to the level of risk; the repair difficulty refers to the difficulty of repairing a business module or function after a risk occurs; The trigger condition refers to the difficulty of triggering a risk for a user or attacker after a risk occurs in a business module or function.