API-based business data security protection method and system
By analyzing the API request log and performance parameters, calculating the exception coefficients and taking corresponding measures, the impact of API requests and server exceptions on business data security is solved, and the efficiency and effect of data security protection is improved.
Patent Information
- Application Number
- CN202411273244.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-09-12
AI Technical Summary
The prior art has failed to effectively take protective measures based on API requests and the status of API servers, and cannot ensure the security of business data.
By obtaining the request log information and performance parameters of the API server, calculate the API request exception coefficient and the server operation exception coefficient, and determine and implement appropriate protection measures based on these coefficients and the encryption protocol of the API interface, including recording exception information, repairing the server, Update configuration, etc.
Improve the efficiency and effectiveness of business data security protection, and through comprehensive analysis of API requests and server health, we ensure timely measures taken in abnormal situations, enhancing data security.
Smart Images

Figure CN118796537B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to an API-based business data security protection method and system. Background Art
[0002] In the related art, CN115270191A discloses a method and device for dynamic information protection based on an API interface, wherein the method includes: intercepting API requests issued by each user end, and obtaining the identification information of the user end and the type of API requested to be accessed; if the API requested to be accessed contains sensitive data, forwarding the API request to the server end and receiving the return data returned by the server end, and determining the watermark adding strategy for the API request based on the number of API requests received by the current proxy end; wherein, if the number of API requests received by the current proxy end is less than or equal to a preset threshold, determining the watermark adding strategy for the API request as the proxy end adding strategy; if the watermark adding strategy is the proxy end adding strategy, performing a watermark adding operation on the return data corresponding to the API request to obtain watermarked data, and returning the watermarked data to the corresponding user end. This solution improves the effectiveness of watermark adding while improving the real-time performance of network access.
[0003] CN112052117A discloses a satellite system software protection method based on a redundant API interface, which extracts data information for interactive control process from the storage or memory space carried by the satellite system; encodes and backs up the data information through the encoding protection interface, and saves the backup data in the memory space of the satellite system storage area; when the original data information is called, the backup data is extracted and decoded through the decoding recovery interface to obtain the correct data information; the data information obtained by encoding and decoding is used to restore the data flow or control flow and copy it to the corresponding position of the original data information in the satellite system storage space. The scheme has good error correction and error detection capabilities, accurately corrects multi-bit random errors and burst errors, and has strong environmental adaptability.
[0004] Based on the above related technologies, multi-bit random errors and burst errors in the data transmission process can be accurately corrected. However, the related technologies do not consider the impact of abnormal conditions of API requests and API servers on data security, that is, it is impossible to take protective measures for the security of business data based on the conditions of API requests and API servers.
[0005] The information disclosed in the background technology section of this application is only intended to deepen the understanding of the general background technology of this application, and should not be regarded as an admission or any form of suggestion that the information constitutes the prior art already known to those skilled in the art. Summary of the invention
[0006] The present invention provides an API-based business data security protection method and system, which can solve the technical problem that related technologies are unable to take protection measures for the security of business data according to the status of API requests and API servers.
[0007] According to a first aspect of the present invention, there is provided a method for protecting business data security based on an API, comprising:
[0008] Obtain the request log information of the API server, wherein the request log information includes: request time, requester information, request parameters and response result;
[0009] Determine the API request abnormality coefficient according to the request log information;
[0010] If the API request abnormality coefficient is greater than the set API request abnormality coefficient threshold, record the abnormal information, and update, repair and continuously monitor;
[0011] Obtaining performance parameters of the API server within a time period, wherein the performance parameters include: response time, error rate, data flow, system load, and number of concurrent users;
[0012] Determining a server operation abnormality coefficient according to the performance parameters;
[0013] If the server operation abnormality coefficient is greater than the set server operation abnormality coefficient threshold, record the abnormal information, check the server status, and repair and verify the API server;
[0014] Get the encryption protocol of the API interface;
[0015] According to the encryption protocol, determine whether the network environment configuration needs to be changed.
[0016] According to a second aspect of the present invention, there is provided an API-based business data security protection system, comprising:
[0017] The log information module obtains the request log information of the API server, wherein the request log information includes: request time, requester information, request parameters and response result;
[0018] A request exception module determines an API request exception coefficient based on the request log information;
[0019] The abnormality repair module records the abnormal information, updates, repairs and continuously monitors if the abnormality coefficient of the API request is greater than the set API request abnormality coefficient threshold;
[0020] A performance parameter module, which obtains the performance parameters of the API server within a time period, wherein the performance parameters include: response time, error rate, data flow, system load, and number of concurrent users;
[0021] An operation abnormality module determines an operation abnormality coefficient of the server according to the performance parameters;
[0022] A server repair module, if the server operation abnormality coefficient is greater than a set server operation abnormality coefficient threshold, records abnormal information, checks the server status, and repairs and verifies the API server;
[0023] Encryption protocol module, obtains the encryption protocol of the API interface;
[0024] The configuration change module determines whether the network environment configuration needs to be changed according to the encryption protocol.
[0025] Technical effect: According to the present invention, the abnormal conditions of API requests and API servers can be comprehensively analyzed based on the request log information and performance parameters of the API server, and the API request abnormality coefficient and server operation abnormality coefficient can be obtained. Further, based on the API request abnormality coefficient, the server operation abnormality coefficient and the encryption protocol of the API interface, the protection measures for business data security are determined, thereby improving the efficiency and effect of business data security protection. When determining the request time abnormality coefficient, the request time abnormality coefficient can be determined based on the request time. During the calculation process, the abnormal conditions of the API request time are evaluated based on the time period of the API request and whether a large number of API requests appear in a short period of time, thereby improving the comprehensiveness and accuracy of the request time abnormality coefficient. When determining the requester abnormality coefficient, the requester abnormality coefficient can be determined based on the request source IP address, the legal IP address and the identity authentication identification result. During the calculation process, the requester information can be analyzed based on the legal status of the IP address and the legal status of the identity authentication information, thereby improving the comprehensiveness and accuracy of the requester abnormality coefficient. When determining the server operation abnormality coefficient, the server operation abnormality coefficient can be determined based on the normal response time, normal error rate and performance parameters. During the calculation process, the operation status of the API service can be evaluated based on five aspects: response time status, error rate status, data flow, system load status and number of concurrent users of the API service, thereby improving the comprehensiveness and accuracy of the server operation abnormality coefficient.
[0026] It should be understood that the above general description and the following detailed description are exemplary and explanatory only and do not limit the present invention. Other features and aspects of the present invention will become more apparent from the following detailed description of exemplary embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other embodiments can be obtained based on these drawings without creative work.
[0028] Figure 1 A schematic diagram of a process flow of a method for protecting business data security based on an API according to an embodiment of the present invention is exemplarily shown;
[0029] Figure 2 A block diagram of an API-based business data security protection system according to an embodiment of the present invention is exemplarily shown. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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 creative work are within the scope of protection of the present invention.
[0031] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0032] Figure 1 A flowchart of a method for protecting business data security based on an API according to an embodiment of the present invention is exemplarily shown. The method includes:
[0033] Step S101, obtaining request log information of the API server, wherein the request log information includes: request time, requester information, request parameters and response result;
[0034] Step S102, determining an API request abnormality coefficient according to the request log information;
[0035] Step S103, if the API request abnormality coefficient is greater than the set API request abnormality coefficient threshold, record the abnormal information, and update, repair and continuously monitor;
[0036] Step S104, obtaining performance parameters of the API server within a time period, wherein the performance parameters include: response time, error rate, data flow, system load, and number of concurrent users;
[0037] Step S105, determining the server operation abnormality coefficient according to the performance parameter;
[0038] Step S106, if the server operation abnormality coefficient is greater than the set server operation abnormality coefficient threshold, record abnormal information, check the server status, and repair and verify the API server;
[0039] Step S107, obtaining the encryption protocol of the API interface;
[0040] Step S108: Determine whether the network environment configuration needs to be changed according to the encryption protocol.
[0041] According to the API-based business data security protection method of an embodiment of the present invention, a comprehensive analysis of the abnormal conditions of API requests and the abnormal conditions of API servers can be performed based on the request log information and performance parameters of the API server, and the API request abnormality coefficient and the server operation abnormality coefficient can be obtained. Furthermore, based on the API request abnormality coefficient, the server operation abnormality coefficient and the encryption protocol of the API interface, protection measures for business data security are determined, thereby improving the efficiency and effectiveness of business data security protection.
[0042] According to an embodiment of the present invention, in step S101, request log information of the API server is obtained, wherein the request log information includes: request time, requester information, request parameters and response result.
[0043] For example, a dedicated log management tool is used to obtain the request log information of the API server within a time period.
[0044] According to an embodiment of the present invention, in step S102, the API request abnormality coefficient is determined according to the request log information.
[0045] According to one embodiment of the present invention, step S102 includes:
[0046] Determine the HTTP status code according to the response result;
[0047] Determine known abnormal status codes;
[0048] Determine the IP address of the request source according to the requester information;
[0049] Determine the legitimate IP addresses of the intended client and user groups;
[0050] Determine the identity verification result according to the requester information;
[0051] Determine parameter verification results and sensitive information check results according to the request parameters;
[0052] Determine the response content verification result and the error information identification result according to the response result;
[0053] Determine the API request abnormality coefficient based on the HTTP status code, the known abnormal status code, the request source IP address, the legal IP address, the identity authentication identification result, the parameter verification result, the sensitive information check result, the response content verification result, the error information identification result and the request time.
[0054] For example, obtain the HTTP status code in the request response result, and identify known abnormal status codes (for example, 400, 401, 403, and 500); determine the source IP address of the API requester's request based on the requester information, and determine the legal IP addresses of the expected client and user groups; check whether the API request contains valid authentication information (for example, API keys and OAuth tokens). If it contains valid authentication information, the authentication identification result is 1; if it does not contain valid authentication information, the authentication identification result is 0; strictly verify all parameters in the API request to determine whether they conform to the expected data type and format. If they conform to the expected data type and format, the parameter verification result is 0; if they do not conform to the expected data type and format, the parameter verification result is 1; check whether the request parameters contain sensitive information (for example, user passwords and private keys). If they do not contain sensitive information, the sensitive information The result of the sensitive information check is 0. If it contains sensitive information, the result of the sensitive information check is 1. Check whether the response content contains the expected data. If the response content contains the expected data, the response content verification result is 0. If the response content does not contain the expected data, the response content verification result is 1. Analyze the error information in the error response to check whether the error information will leak internal server information or sensitive data. If the error information will not leak internal server information or sensitive data, the error information identification result is 0. If the error information will leak internal server information or sensitive data, the error information identification result is 1. According to the HTTP status code, known abnormal status code, request source IP address, legal IP address, identity authentication identification result, parameter verification result, sensitive information check result, response content verification result, error information identification result and request time, determine the abnormal condition of the API request and the abnormal coefficient of the API request.
[0055] According to an embodiment of the present invention, determining the API request abnormality coefficient according to the HTTP status code, the known abnormal status code, the request source IP address, the legal IP address, the identity authentication identification result, the parameter verification result, the sensitive information check result, the response content verification result, the error information identification result and the request time includes:
[0056] Determining a request time anomaly coefficient according to the request time;
[0057] Determine the requester abnormality coefficient according to the request source IP address, the legal IP address and the identity verification result;
[0058] Determine an abnormal status code identification result according to the HTTP status code and the known abnormal status code;
[0059] Determine a request response abnormality coefficient according to the abnormal status code identification result, the response content verification result and the error information identification result;
[0060] Determining a request parameter abnormality coefficient according to the parameter verification result and the sensitive information inspection result;
[0061] An API request abnormality coefficient is determined according to the request time abnormality coefficient, the requester abnormality coefficient, the request response abnormality coefficient, and the request parameter abnormality coefficient.
[0062] For example, based on the request time of the API request, the abnormal status of the API request time is judged to determine the request time abnormality coefficient; based on the request source IP address, the legal IP address and the identity authentication identification result, the abnormal status of the API requester is evaluated to determine the requester abnormality coefficient; if a known abnormal status code appears in the HTTP status code, it may indicate a client error, unauthorized access and a server error, and the abnormal status code identification result is determined to be 1; if no known abnormal status code appears in the HTTP status code, the abnormal status code identification result is determined to be 0; the request response abnormality coefficient is determined by summing up the abnormal status code identification result, the response content verification result and the error message identification result; the request parameter abnormality coefficient is determined by summing up the parameter verification result and the sensitive information check result; the API request abnormality coefficient is determined by summing up the request time abnormality coefficient, the requester abnormality coefficient, the request response abnormality coefficient and the request parameter abnormality coefficient.
[0063] According to an embodiment of the present invention, determining the request time abnormality coefficient according to the request time includes: determining the request time abnormality coefficient according to formula (1): ,
[0064] (1)
[0065] Among them, if is the conditional function, max is the maximum value function, is the request time of the i-th API request, To set non-peak business hours, is the kth window time period, is the preset API request number threshold, K is the number of window time periods, k≤K, n is the number of API requests within the time period, i≤n, k, K, i and n are all positive integers.
[0066] According to one embodiment of the present invention, To set non-peak business hours, In the form of a set, in formula (1), the conditional function The value of includes the following two cases, when it satisfies When the condition is met, the request time of the i-th API request belongs to the preset non-business peak time, the value of the condition function is 1. When the condition is met, the request time of the i-th API request does not belong to the preset non-business peak time, and the value of the condition function is 0. It is the ratio of the number of API requests that occur during the preset non-business peak hours to the total number of API requests during the time period. The larger the ratio, the more API requests occur during non-business peak hours. When a large number of requests occur during non-business peak hours, it indicates that there may be automated scripts or attack attempts. The possibility of abnormal API requests is greater, which will endanger the security of business data.
[0067] According to one embodiment of the present invention, in formula (1), is the kth window time period, In set form, the conditional function The value of includes the following two cases, when it satisfies When the condition is met, the request time of the i-th API request belongs to the k-th window time period, indicating that the i-th API request occurs within the k-th window time period, and the value of the condition function is 1. When the condition is met, the request time of the i-th API request does not belong to the k-th window time period, which means that the i-th API request did not occur in the k-th window time period, and the value of the condition function is 0. The sum of the number of API requests in the time period is expressed as the number of API requests occurring in the kth window time period. To obtain the maximum value of the number of API requests within the K window time periods, the above maximum value processing can be used to determine whether a large number of API requests occur in a short period of time. It represents the maximum value of the number of API requests within K window time periods and the maximum value of the preset API request number threshold. The larger the ratio is, the more API requests there are within the window time period. When there are a large number of requests in a short period of time, it may be a sign of a denial of service attack (DDos). The greater the possibility of abnormal API requests, the more likely it is that the security of business data will be compromised.
[0068] In this way, the request time anomaly coefficient can be determined based on the request time. During the calculation process, the abnormal situation of the API request time is evaluated based on the time period in which the API request occurs and whether a large number of API requests occur in a short period of time, thereby improving the comprehensiveness and accuracy of the request time anomaly coefficient.
[0069] According to an embodiment of the present invention, determining the abnormal coefficient of the requester according to the request source IP address, the legal IP address and the identity verification result includes:
[0070] Determine a request source IP address vector according to the request source IP address;
[0071] Determine a legal IP address vector according to the legal IP address;
[0072] Determine the requester abnormality coefficient according to formula (2) ,
[0073] (2)
[0074] Among them, max is the maximum value function, min is the minimum value function, and if is the conditional function. is the source IP address of the i-th API request. is the IP address vector of the i-th request source, is the jth legal IP address, is the jth legal IP address vector, for The transposed vector of is the authentication result of the ith API request. , m is the number of legal IP addresses, j≤m, n is the number of API requests within a time period, i≤n, m, j, n and i are all positive integers.
[0075] According to one embodiment of the present invention, is the cosine similarity between the i-th request source IP address vector and the j-th legal IP address vector. The greater the similarity, the more similar the request source IP address of the i-th API request is to the j-th legal IP address. To obtain the maximum value of the cosine similarity between the i-th request source IP address vector and the m legal IP address vectors, the above maximum value operation can be used to determine whether the request source IP address of the i-th API request is a legal IP address. Indicates that the source IP address of the i-th API request is a legal IP address.
[0076] According to one embodiment of the present invention, in formula (2), the conditional function The value of includes the following two cases, when it satisfies When the condition is met, the source IP address of the i-th API request belongs to a legal IP address, and the value of the condition function is 1. When the condition is met, the source IP address of the i-th API request is not a legal IP address, it is an illegal access, and the value of the condition function is 0. Indicates the legal status of the source IP address of the i-th API request. Indicates the abnormal status of the requester information of the i-th API request. and When the value of are all 1, The value of is 1. When the request source IP address of the i-th API request is legal and the i-th API request contains valid identity information, there is no abnormality in the requester information of the i-th API request. or When the value of is 0, The value is 0. When the request source IP address of the i-th API request is illegal or the i-th API request does not contain valid identity information, the requester information of the i-th API request is abnormal. It can be used to determine whether there are any API requests with abnormal requester information among n API requests.
[0077] In this way, the requester anomaly coefficient can be determined based on the request source IP address, legal IP address and identity authentication identification results. During the calculation process, the requester information can be analyzed based on the legal status of the IP address and the legal status of the identity authentication information, thereby improving the comprehensiveness and accuracy of the requester anomaly coefficient.
[0078] According to an embodiment of the present invention, in step S103, if the API request abnormality coefficient is greater than a set API request abnormality coefficient threshold, the abnormal information is recorded, and updated, repaired, and continuously monitored.
[0079] For example, if the API request exception coefficient is greater than the set API request exception coefficient threshold, immediately capture and record the exception information, including the exception type, error code, error message, request URL, request method, request header, request body, response status code, response body, and timestamp of the exception. Preliminarily determine the cause of the exception based on the exception information, and record the exception information in the server's log file. Check the API documentation and update log to determine the root cause of the exception. Update the code and configuration based on the root cause of the exception to resolve the exception. After the exception is resolved, continue to monitor the performance and stability of the API request.
[0080] According to an embodiment of the present invention, in step S104, performance parameters of the API server within a time period are obtained, wherein the performance parameters include: response time, error rate, data flow, system load and number of concurrent users.
[0081] For example, send API requests through the XHR object and calculate the response time after the request is completed. According to the specific situation and needs of the API server, write a custom monitoring script to obtain the error rate. Use performance monitoring tools to monitor the data traffic, system load, and number of concurrent users of the API server in real time. The system load indicates the CPU, memory, and disk usage of the API server, and the number of concurrent users indicates the number of users accessing the API at the same time.
[0082] According to an embodiment of the present invention, in step S105, the server operation abnormality coefficient is determined according to the performance parameter.
[0083] According to one embodiment of the present invention, step S105 includes:
[0084] Obtaining historical performance parameters of the API server in multiple historical time periods, wherein the historical performance parameters include: historical response time and historical error rate;
[0085] Determining a regular response time based on the historical response time;
[0086] Determining a regular error rate based on the historical error rate;
[0087] A server operation abnormality coefficient is determined according to the normal response time, the normal error rate and the performance parameter.
[0088] For example, use API monitoring tools to obtain the historical response time and historical error rate of the API server in multiple historical time periods in the past; determine the regular response time by averaging multiple historical response times; determine the regular error rate by averaging multiple historical error rates; evaluate the abnormal conditions of API operation based on the regular response time, regular error rate and performance parameters, and determine the server operation abnormality coefficient.
[0089] According to an embodiment of the present invention, determining the server operation abnormality coefficient according to the conventional response time, the conventional error rate and the performance parameter includes: determining the server operation abnormality coefficient according to formula (3): ,
[0090] (3)
[0091] in, , , , and is the preset weight, if is the conditional function, is the response time, is the normal response time, is the error rate, is the normal error rate, For data traffic, is the preset data flow threshold, is the system load, To preset the system load threshold, is the number of concurrent users, The preset concurrent user number threshold.
[0092] According to one embodiment of the present invention, in formula (3), the conditional function The value of includes the following two cases, when it satisfies When the condition is met, the response time is less than the normal response time, and the value of the condition function is 0. When the condition is met, the response time is greater than or equal to the normal response time, and the value of the condition function is , Indicates the relative difference between the response time and the regular response time. The larger the ratio, the longer the response time of the API server. Abnormally long response time may indicate that the system is under attack or resource exhaustion, which may lead to business data leakage.
[0093] According to one embodiment of the present invention, in formula (3), the conditional function The value of includes the following two cases, when it satisfies When the condition is met, the error rate is less than the normal error rate, and the value of the condition function is 0. When the condition is met, the error rate is greater than or equal to the normal error rate, and the value of the conditional function is , Indicates the relative difference between the error rate and the normal error rate. The larger the ratio, the higher the error rate of the API server. A higher error rate may indicate that the API is under attack or has configuration errors, which may endanger the security of business data.
[0094] According to one embodiment of the present invention, in formula (3), the conditional function The value includes the following quantities in case, when the When the data flow rate is less than the preset data flow rate threshold, the value of the condition function is 0. When the condition is met, the data flow is greater than or equal to the preset data flow threshold, and the value of the condition function is , Indicates the relative gap between data traffic and the preset data traffic threshold. The larger the ratio, the greater the data traffic. Abnormally large data traffic may indicate data leakage or unauthorized data access, which may endanger the security of business data.
[0095] According to one embodiment of the present invention, in formula (3), the conditional function The value of includes the following two cases, when satisfying When the system load is less than the preset system load threshold, the value of the condition function is 0. When the system load is greater than or equal to the preset system load threshold, the value of the conditional function is , Indicates the relative difference between the system load and the preset system load threshold. The larger the ratio, the greater the system load. A high system load may indicate that the system is under attack or has a performance bottleneck, which may endanger the security of business data.
[0096] According to one embodiment of the present invention, in formula (3), the conditional function The value of includes the following two cases, when satisfying When the condition is met, the number of concurrent users is less than the preset concurrent user threshold, the value of the condition function is 0. When the condition is met, the number of concurrent users is greater than or equal to the preset concurrent user threshold, and the value of the condition function is , Indicates the relative difference between the number of concurrent users and the preset concurrent user threshold. The larger the ratio, the more concurrent users there are. Too high a number of concurrent users may cause system crashes or slow responses, or may be used to cover up malicious behavior, which may endanger the security of business data.
[0097] In this way, the server operation abnormality coefficient can be determined based on the regular response time, regular error rate and performance parameters. During the calculation process, the operation status of the API service can be evaluated based on five aspects: response time status, error rate status, data flow status, system load status and number of concurrent users of the API service, thereby improving the comprehensiveness and accuracy of the server operation abnormality coefficient.
[0098] According to an embodiment of the present invention, in step S106, if the server operation abnormality coefficient is greater than a set server operation abnormality coefficient threshold, the abnormal information is recorded, the server status is checked, and the API server is repaired and verified.
[0099] For example, if the server operation abnormality coefficient is greater than the set server operation abnormality coefficient threshold, immediately capture and record the abnormal information, preliminarily determine the cause of the abnormality based on the abnormal information (for example, network problems, permission problems, and server internal errors), check the status page or monitoring tool of the API server to understand the real-time status of the server, including CPU usage, memory usage, disk space, and network bandwidth, check the log files of the API server, analyze the specific cause and context of the abnormality, and based on the troubleshooting results, fix the problem of the API server or adjust the configuration. After the repair, conduct sufficient testing to verify whether the problem has been resolved.
[0100] According to one embodiment of the present invention, in step S107, the encryption protocol of the API interface is obtained.
[0101] For example, determine the encryption protocol of the API interface through the official documentation of the API.
[0102] According to an embodiment of the present invention, in step S108, it is determined whether the network environment configuration needs to be changed according to the encryption protocol.
[0103] According to one embodiment of the present invention, step S108 includes:
[0104] If the API interface is not encrypted using the HTTPS protocol, migrate the API to HTTPS, or use a virtual private network or dedicated network for data transmission;
[0105] If the API interface is not encrypted using the HTTPS protocol and the API interface does not support HTTPS, you can use SFTP or SSH tunnel to transfer data.
[0106] For example, if the API interface is not encrypted using the HTTPS protocol, migrate the API to HTTPS, install an SSL / TLS certificate on the server, and configure the server to support HTTPS connections. HTTPS protects the security of data transmission by establishing an encrypted channel between the client and the server. If the API interface is not encrypted using the HTTPS protocol and the API interface does not support HTTPS, consider using other secure transmission protocols (such as SFTP, SSH tunnel, etc.) to transmit data. These protocols provide an additional layer of security to reduce the risk of data being intercepted during transmission.
[0107] According to the API-based business data security protection method of the embodiment of the present invention, the abnormal conditions of API requests and the abnormal conditions of API servers can be comprehensively analyzed according to the request log information and performance parameters of the API server, and the API request abnormality coefficient and the server operation abnormality coefficient can be obtained. Further, based on the API request abnormality coefficient, the server operation abnormality coefficient and the encryption protocol of the API interface, the protection measures for business data security are determined, thereby improving the efficiency and effect of business data security protection. When determining the request time abnormality coefficient, the request time abnormality coefficient can be determined according to the request time. During the calculation process, the abnormal conditions of the API request time are evaluated according to the time period of the API request and whether a large number of API requests appear in a short period of time, thereby improving the comprehensiveness and accuracy of the request time abnormality coefficient. When determining the requester abnormality coefficient, the requester abnormality coefficient can be determined according to the request source IP address, the legal IP address and the identity authentication identification result. During the calculation process, the requester information can be analyzed according to the legal status of the IP address and the legal status of the identity authentication information, thereby improving the comprehensiveness and accuracy of the requester abnormality coefficient. When determining the server operation abnormality coefficient, the server operation abnormality coefficient can be determined based on the normal response time, normal error rate and performance parameters. During the calculation process, the operation status of the API service can be evaluated based on five aspects: response time status, error rate status, data flow, system load status and number of concurrent users of the API service, thereby improving the comprehensiveness and accuracy of the server operation abnormality coefficient.
[0108] Figure 2 A block diagram of an API-based business data security protection system according to an embodiment of the present invention is exemplarily shown, and the system includes:
[0109] The log information module obtains the request log information of the API server, wherein the request log information includes: request time, requester information, request parameters and response result;
[0110] A request exception module determines an API request exception coefficient based on the request log information;
[0111] The abnormality repair module records the abnormal information, updates, repairs and continuously monitors if the abnormality coefficient of the API request is greater than the set API request abnormality coefficient threshold;
[0112] A performance parameter module, which obtains the performance parameters of the API server within a time period, wherein the performance parameters include: response time, error rate, data flow, system load, and number of concurrent users;
[0113] An operation abnormality module determines an operation abnormality coefficient of the server according to the performance parameters;
[0114] A server repair module, if the server operation abnormality coefficient is greater than a set server operation abnormality coefficient threshold, records abnormal information, checks the server status, and repairs and verifies the API server;
[0115] Encryption protocol module, obtains the encryption protocol of the API interface;
[0116] The configuration change module determines whether the network environment configuration needs to be changed according to the encryption protocol.
[0117] The present invention may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.
[0118] It should be understood by those skilled in the art that the embodiments of the present invention described above and shown in the accompanying drawings are only examples and do not limit the present invention. The purpose of the present invention has been fully and effectively achieved. The functional and structural principles of the present invention have been demonstrated and explained in the embodiments, and the embodiments of the present invention may be deformed or modified in any way without departing from the principles.
Claims
1. A business data security protection method based on API, characterized in that: include: Obtain the request log information of the API server, wherein the request log information includes: request time, requester information, request parameters and response result; Determine the API request abnormality coefficient according to the request log information; If the API request abnormality coefficient is greater than the set API request abnormality coefficient threshold, record the abnormal information, and update, repair and continuously monitor; Obtaining performance parameters of the API server within a time period, wherein the performance parameters include: response time, error rate, data flow, system load, and number of concurrent users; Determining a server operation abnormality coefficient according to the performance parameters; If the server operation abnormality coefficient is greater than the set server operation abnormality coefficient threshold, record the abnormal information, check the server status, and repair and verify the API server; Get the encryption protocol of the API interface; Determining whether it is necessary to change the network environment configuration according to the encryption protocol; Determine the API request abnormality coefficient based on the request log information, including: Determine the HTTP status code according to the response result; Determine known abnormal status codes; Determine the IP address of the request source according to the requester information; Determine the legitimate IP addresses of the intended client and user groups; Determine the identity verification result according to the requester information; Determine parameter verification results and sensitive information check results according to the request parameters; Determine the response content verification result and the error information identification result according to the response result; Determine the API request abnormality coefficient according to the HTTP status code, the known abnormal status code, the request source IP address, the legal IP address, the identity authentication identification result, the parameter verification result, the sensitive information check result, the response content verification result, the error information identification result and the request time; Determine the API request abnormality coefficient according to the HTTP status code, the known abnormal status code, the request source IP address, the legal IP address, the identity authentication identification result, the parameter verification result, the sensitive information check result, the response content verification result, the error information identification result and the request time, including: Determining a request time anomaly coefficient according to the request time; Determine the requester abnormality coefficient according to the request source IP address, the legal IP address and the identity verification result; Determine an abnormal status code identification result according to the HTTP status code and the known abnormal status code; Determine a request response abnormality coefficient according to the abnormal status code identification result, the response content verification result and the error information identification result; Determining a request parameter abnormality coefficient according to the parameter verification result and the sensitive information inspection result; Determine an API request abnormality coefficient according to the request time abnormality coefficient, the requester abnormality coefficient, the request response abnormality coefficient, and the request parameter abnormality coefficient; Determining a request time abnormality coefficient according to the request time includes: According to the formula , Determine the request time anomaly coefficient , where if is the conditional function and max is the maximum value function. is the request time of the i-th API request, To set non-peak business hours, is the kth window time period, is the preset API request number threshold, K is the number of window time periods, k≤K, n is the number of API requests in the time period, i≤n, k, K, i and n are all positive integers; Determining the requester abnormality coefficient according to the request source IP address, the legal IP address and the identity verification result includes: Determine a request source IP address vector according to the request source IP address; Determine a legal IP address vector according to the legal IP address; According to the formula , Determine the requester anomaly coefficient , where max is the maximum value function, min is the minimum value function, and if is the conditional function. is the source IP address of the i-th API request. is the IP address vector of the i-th request source, is the jth legal IP address, is the jth legal IP address vector, for The transposed vector of is the authentication result of the ith API request. , m is the number of legal IP addresses, j≤m, n is the number of API requests in a time period, i≤n, m, j, n and i are all positive integers; Determine the server operation abnormality coefficient according to the performance parameter, including: Obtaining historical performance parameters of the API server in multiple historical time periods, wherein the historical performance parameters include: historical response time and historical error rate; Determining a regular response time based on the historical response time; Determining a regular error rate based on the historical error rate; Determining a server operation abnormality coefficient according to the conventional response time, the conventional error rate and the performance parameter; Determining a server operation abnormality coefficient according to the normal response time, the normal error rate, and the performance parameter includes: According to the formula , Determine the server operation abnormality coefficient ,in, , , , and is the preset weight, if is the conditional function, is the response time, is the normal response time, is the error rate, is the normal error rate, For data traffic, is the preset data flow threshold, is the system load, To preset the system load threshold, is the number of concurrent users, To preset the concurrent user number threshold; Based on the encryption protocol, determine whether the network environment configuration needs to be changed, including: If the API interface is not encrypted using the HTTPS protocol, migrate the API to HTTPS, or use a virtual private network or dedicated network for data transmission; If the API interface is not encrypted using the HTTPS protocol and the API interface does not support HTTPS, you can use SFTP or SSH tunnel to transfer data.
2. An API-based business data security protection system for executing the method described in claim 1, characterized in that: include: The log information module obtains the request log information of the API server, wherein the request log information includes: request time, requester information, request parameters and response result; A request exception module determines an API request exception coefficient based on the request log information; The abnormality repair module records the abnormal information, updates, repairs and continuously monitors if the abnormality coefficient of the API request is greater than the set API request abnormality coefficient threshold; A performance parameter module, which obtains the performance parameters of the API server within a time period, wherein the performance parameters include: response time, error rate, data flow, system load, and number of concurrent users; An operation abnormality module determines an operation abnormality coefficient of the server according to the performance parameters; A server repair module, if the server operation abnormality coefficient is greater than a set server operation abnormality coefficient threshold, records abnormal information, checks the server status, and repairs and verifies the API server; Encryption protocol module, obtains the encryption protocol of the API interface; The configuration change module determines whether the network environment configuration needs to be changed according to the encryption protocol.
Citation Information
Patent Citations
Satellite-borne system software protection method based on redundant API interface
CN112052117A
Dynamic information protection method and device based on API interface
CN115270191A
Timestamp-based API replay attack defense system and method
CN110611564A
Method, device, equipment and product for identifying abnormal calling of API (Application Program Interface) gateway
CN114389834A
Method for detecting abnormal API request based on API session
CN117527438A
