Application program interface security protection method and device and electronic equipment
By setting the decoy API in the API gateway or client application, the interface path of the API call request is determined, and the problem of difficulty in detecting low-frequency attacks in the existing technology is solved, and the security improvement and attack prevention of API calls are achieved.
Patent Information
- Application Number
- CN202310505445.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-06
- Publication Date
- 2024-11-08
AI Technical Summary
The existing technology is difficult to detect and prevent low-frequency and hidden attacks of APIs in a timely manner. Attackers bypass the detection of traditional security products by forging legal traffic, making it difficult to ensure API security.
Set up the decoy API in advance in the API gateway or client application, and determine whether it is an exception call by matching the interface path of the call request. If it matches, block the request and return the exception call prompt information to prevent API attacks.
Effectively distinguish attack traffic from legal traffic, improve the security of API calls, cover application scenarios in C/S and B/S modes, and ensure the security of API calls.
Smart Images

Figure CN118916124A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the field of computer technology, and more particularly to a method, device, and electronic device for protecting application program interface security. Background Art
[0002] With the development of computer and Internet technology, Internet applications have become more diversified and complex, and application services have become a significant trend. More and more applications provide application programming interfaces (APIs) for the demand side to call. APIs are usually simple and open to facilitate calls. However, these characteristics of APIs also provide malicious hackers with multiple ways to access company data, and can even be used to cause large-scale business interruptions. When providing API call services to the outside world, in order to prevent APIs from being maliciously attacked and affecting business, it is often necessary to perform security protection on the APIs.
[0003] In the prior art, the method of traffic analysis attack is mainly used to detect anomalies, and security protection systems are deployed in the enterprise environment, such as IDS (Intrusion Detection System), IPS (Intrusion Prevention System) and WAF (Web Application Firewall) and other security products. For API security, by continuously collecting high-frequency API traffic (high-frequency illegal traffic can clearly highlight the difference from legal traffic, the characteristics are more significant than low-frequency abnormal behavior, and the false alarm rate is lower), and making a large amount of uninterrupted analysis, the source IP address, user, device and session related to API traffic are extracted. Suspected attack behaviors, and multiple models are established to analyze attack characteristics. This method is based on the inconsistency between the characteristics of abnormal traffic and the characteristics of legal traffic. However, in some special environments such as enterprise environments, attackers may ambush early and conduct passive target detection at a low frequency and covertly in order to bypass the detection logic of existing traditional security products. On the other hand, attackers are good at starting with the client control software, reverse engineering the code of the client terminal control software, and using security technologies such as binary analysis to study the function list of the client and server APIs and the way the two communicate. Then they try to forge legitimate API calls to perform passive analysis and low-frequency attacks to evade detection by most existing security products (because this type of attack is usually disguised as legitimate traffic, and the frequency is relatively low, bypassing the detection mechanism). The detection logic of existing products cannot detect this attack method in time, and cannot achieve the purpose of early attack prevention.
[0004] Therefore, how to provide a solution that can detect abnormal attacks on APIs in a timely and accurate manner is a technical problem that urgently needs to be solved in this field. Summary of the invention
[0005] The embodiments of this specification provide a method, apparatus, device, storage medium, and computer program product for application program interface security protection, which can implement security protection for API calls and improve the security of API calls.
[0006] On the one hand, an embodiment of this specification provides a method for application program interface security protection, the method comprising:
[0007] Receiving a call request, wherein the call request includes a target application program interface to be called;
[0008] According to the calling request, obtaining a target interface path of the target application program interface;
[0009] Determine whether the target interface path matches the interface path of at least one pre-set bait application interface. If so, determine that the call request is an abnormal call request, block the call request and return abnormal call prompt information; wherein the bait application interface is an abnormal application interface pre-set in the application interface gateway and / or client application.
[0010] Another aspect provides an application program interface security protection device, the device comprising:
[0011] A request receiving module, used for receiving a call request, wherein the call request includes a target application program interface to be called;
[0012] A path acquisition module, used for acquiring a target interface path of the target application program interface according to the call request;
[0013] The abnormal call protection module is used to determine whether the target interface path matches the interface path of at least one pre-set bait application interface. If it matches, the call request is determined to be an abnormal call request, the call request is blocked and abnormal call prompt information is returned; wherein the bait application interface is an abnormal application interface pre-set in the application interface gateway and / or client application.
[0014] Another aspect provides an electronic device, including: a processor;
[0015] a memory for storing instructions executable by the processor;
[0016] Wherein, the processor is configured to execute the instructions to implement any of the above-mentioned methods for application program interface security protection.
[0017] On the other hand, a computer-readable storage medium is provided, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute any of the above-mentioned methods for protecting application program interface security.
[0018] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method of application program interface security protection provided in the above various optional implementations.
[0019] The method, apparatus, device, storage medium, and computer program product provided by the embodiments of this specification have the following technical effects:
[0020] The method for application program interface security protection provided in the embodiments of this specification sets a decoy API in advance in the API gateway or client application. After receiving the API call request, it determines whether the call request triggers the decoy API based on the interface path in the call request. When it is detected that the call of the decoy API is triggered, it can be considered that the call request is an abnormal call request, and the call request can be blocked and abnormal call prompt information can be returned, thereby preventing API attacks and improving the security of API calls. In addition, by setting the decoy API in the API gateway or client application, the application scenarios in both C / S and B / S modes can be covered to ensure the security of API calls. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions and advantages of the embodiments of this specification or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 It is a schematic diagram of an application environment of a method for application program interface security protection provided by an embodiment of this specification;
[0023] Figure 2 It is a schematic diagram of the configuration interface of a zero-trust gateway in one embodiment of this specification;
[0024] Figure 3 It is a schematic diagram of the configuration interface of a business site in a zero-trust gateway in one embodiment of this specification;
[0025] Figure 4 It is a schematic diagram of a configuration interface for adding resources in a zero-trust gateway in one embodiment of this specification;
[0026] Figure 5 This is a schematic diagram of the configuration interface of the business system in the zero-trust gateway in one embodiment of this specification;
[0027] Figure 6 It is a schematic diagram of a configuration interface of a gateway accessible to a business system in a zero-trust gateway in one embodiment of this specification;
[0028] Figure 7 This is a schematic diagram of a policy control configuration interface in a zero-trust gateway in one embodiment of this specification;
[0029] Figure 8 It is a schematic diagram of a configuration interface of a trusted application in a zero-trust gateway in one embodiment of this specification;
[0030] Fig. 9 This is a schematic diagram of the login interface of the zero-trust office system in one embodiment of this specification;
[0031] Fig.10 This is a schematic diagram of the security protection interface after logging into the zero-trust office system in one embodiment of this specification;
[0032] Fig.11 This is a schematic diagram of the principle of API calling in a scenario example of this manual;
[0033] Fig.12 It is a flowchart of a method for application program interface security protection provided by an embodiment of this specification;
[0034] Fig.13 This is a schematic diagram of the principle flow of API security protection in one embodiment of this specification;
[0035] Fig.14 It is a structural diagram of an application program interface security protection device provided in an embodiment of this specification;
[0036] Fig.15 It is a block diagram of an electronic device for application program interface security protection provided by an embodiment of this specification;
[0037] Fig.16 It is a block diagram of another electronic device for application program interface security protection provided in an embodiment of this specification. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of this specification.
[0039] It should be noted that the terms "first", "second", etc. in the description and claims of the embodiments of this specification and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of this specification described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0040] See also Figure 1 , Figure 1 It is a schematic diagram of an application environment of a method for application program interface security protection provided in an embodiment of this specification, and the application environment may at least include a server 100 and a terminal 200.
[0041] In an optional embodiment, server 100 can be used to perform application program interface security protection processing. Server 100 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.
[0042] In an optional embodiment, the terminal 200 can be used as a client to send an API call request to the server 100. Specifically, the terminal 200 may include but is not limited to smart phones, desktop computers, tablet computers, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices, vehicle terminals, smart TVs and other types of electronic devices; it may also be software running on the above electronic devices, such as applications, applets, etc. The operating system running on the electronic device in the embodiments of this specification may include but is not limited to Android system, IOS system, Linux, Windows, etc.
[0043] In addition, it should be noted that Figure 1What is shown is merely an application environment of a method for application program interface security protection, and the embodiments of this specification are not limited to the above.
[0044] In the embodiments of this specification, the server 100 and the terminal 200 may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of this specification.
[0045] Application Programming Interface (API) can be understood as some predefined interfaces or functions, which are composed of basic information of the interface or function, request paths of the front-end and back-end, parameters, and request-related protocols. Applications can generally encapsulate their own service capabilities into APIs and open them up for callers to use. For example, different business functions can be encapsulated into different APIs for callers to call. However, because APIs are usually simple and open, attackers may obtain relevant data by attacking APIs. Therefore, security protection is required for API calls.
[0046] With the rapid development of business, in order to cope with the rapid changes in business while ensuring system stability, API gateways are usually introduced to uniformly manage various business APIs to achieve decoupling of internal enterprise systems. On the other hand, in order to build an ecosystem, enterprises usually provide internal systems or service capabilities to partners in the form of standard APIs through API gateways. API gateways can be understood as API management tools located between the front-end and back-end service sets, and are part of the API management system. The API gateway intercepts all incoming requests and then sends them out through the API management system. It is equivalent to a reverse proxy, which is used to receive various API calls, integrate and process the various back-end services required for these calls, and return the corresponding results.
[0047] Figure 2 This is a schematic diagram of the principle of API calling in a scenario example in this manual. Taking the client application accessing the backend service through the API gateway as an example (of course, there is also a mode of accessing the backend service through the B / S (Browser / Server) mode, and the service-side nodes calling each other's API through rpc (Remote Procedure Call) communication), the overall process is as follows Figure 2 As shown. Enterprises use business services, data access, etc. as backend services, and register the interfaces provided to the outside in the API gateway, which is open to API callers. Before calling the API, the API caller needs to obtain the request information of the target API from the API provider or reference documents, including the access domain name, request method, protocol, request path, and related parameters. After the request traffic is distributed by the load balancer, it reaches the API gateway, which distributes the request to the corresponding backend service, such as Figure 2The process of step 1 and step 2 shown in the figure. When the response traffic of the backend service is received by the API gateway, the API gateway will pass the response result to the API caller, that is, the client application. The response result can include the status code, response message header and message body, etc., completing the overall process of the API call, such as Figure 2 The process of step 3 and step 4 shown is also a commonly used method for managing API calls.
[0048] Figure 2 What is shown is the normal API request process. In some application scenarios, such as enterprise environments, there is such an attack behavior. The attacker will first take various methods to break through the enterprise office environment and lie dormant there. At the same time, passive target detection is carried out in a low frequency and covert manner, starting from the client control software, by reverse engineering the code of the client's application including the terminal control software, and using security technologies such as binary analysis to study the function list of the client and server APIs and the way the two communicate, and then try to forge a legitimate API call to perform passive analysis and low-frequency attacks. Because this type of attack is usually disguised as legitimate traffic and the frequency control is relatively low, it can bypass the detection mechanism of most existing security products.
[0049] Taking the zero-trust gateway system as an example, this paper introduces the application scenarios of API call security protection. With the rapid development of information technology and the popularization of the Internet, the frequency of network attacks is increasing, and the traditional network security model and architecture may no longer meet the current complex and changing security needs. Zero-trust gateways have emerged as the times require. Zero-trust gateways are a new type of network security solution. Its basic concept is to be skeptical of all users, devices and applications, and not to trust anyone, any device and any situation. Unlike the traditional network security model, the zero-trust model abandons the inherent trust model and regards any request as an unsafe "zero-trust" state. Only truly verified users and devices can access the required applications and resources. Zero-trust gateways provide users and devices with all-round and efficient security protection through multiple security measures such as mandatory access control, dynamic authentication and traffic detection. It can optimize and adjust security policies based on elements such as user identity, device status, network location, access behavior and application security status, and perform strict identity authentication and access authorization on all access attempts, effectively preventing any unauthorized access and ensuring the security of the target system and network. For this zero-trust network architecture, how to provide security protection for API calls is an important task.
[0050] Figure 3 : is a schematic diagram of the configuration interface of a zero-trust gateway in an embodiment of this specification, such as Figure 3As shown, the name, configuration, and preferred IP (Internet Protocol) address of the gateway can be configured. Figure 4 is a schematic diagram of a configuration interface of a business site in a zero-trust gateway in an embodiment of this specification, Figure 5 This is a schematic diagram of a configuration interface for adding resources in a zero-trust gateway in one embodiment of this specification. Figure 6 : is a schematic diagram of a configuration interface of a business system in a zero-trust gateway in an embodiment of this specification, such as Figure 4 , Figure 5 , Figure 6 As shown, business sites (domain names or IP addresses) can be configured or added in the front-end interface, and accessible business systems can also be edited. Figure 7 Schematic diagram of a configuration interface in which a business system can access a gateway in a zero-trust gateway in one embodiment of this specification, such as Figure 7 As shown in the figure, when the administrator configures the zero-trust policy on the management side, he can configure a different accessible gateway for each business system. Figure 8 Schematic diagram of the policy control configuration interface in a zero-trust gateway in one embodiment of this specification. Figure 8 As shown, the administrator can implement traffic filtering based on the combined policy control of user (identity)-application-target business system, support wildcard domain names, IP segments, and multiple ports, and can achieve inheritance and expansion based on the user organizational structure. Fig. 9 : is a schematic diagram of a configuration interface for a trusted application in a zero-trust gateway in an embodiment of this specification, such as Fig. 9 As shown, the configuration of the trusted application may include process name, signature information, version, process MD5 (Message-Digest Algorithm, message digest algorithm) and sha256 (a hash algorithm), etc. Fig.10 : is a schematic diagram of a login interface of a zero-trust office system in an embodiment of this specification, such as Fig.10 As shown, the zero-trust gateway can be applied to the enterprise office system. When the zero-trust office is enabled, the end user can log in to the office system of the zero-trust gateway by scanning the code to realize the zero-trust office function. Fig.11 : is a schematic diagram of the security protection interface after logging into the zero-trust office system in one embodiment of this specification, such as Fig.11 As shown, after logging into the zero-trust office system, users can freely choose security protection strategies to ensure safety.
[0051] Depend on Figure 3-Figure 11It can be seen that the zero-trust gateway system can be composed of a client, a server, and a management end. The management end can configure and manage the zero-trust gateway and policy information. Users can log in to the server through the client. This mode can be understood as a C / S (Client / Server) mode. In this zero-trust gateway system, it is generally necessary to perform identity authentication, device verification, authorization prevention, traffic detection and other operations to perform system security detection and ensure the security of the system. However, some attackers will reverse engineer the code of the client's terminal control software, and use security technologies such as binary analysis to study the function list of the client and server APIs and the way the two communicate, and then try to forge legitimate API calls to perform passive analysis and low-frequency attacks to evade detection by most existing security products. For this scenario, timely prevention and detection of abnormal API calls is an important means to ensure system security.
[0052] The embodiments of this specification provide a method for application program interface security protection, which pre-sets a bait API and distinguishes attack traffic from user legitimate traffic by detecting the calls of the bait API. It is not affected by the frequency of illegal traffic and can be regarded as an abnormal API call as long as it is hit and provided to the security team for key analysis.
[0053] The following describes a method for protecting application program interface security in an embodiment of this specification. Fig.12 It is a flowchart of a method for application program interface security protection provided by an embodiment of this specification. This specification provides method operation steps such as the embodiment or flowchart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only execution order. When the actual system or server product is executed, it can be executed in sequence or in parallel according to the method shown in the embodiment or the accompanying drawings (for example, in a parallel processor or multi-threaded processing environment). This method can be applied to an application program interface gateway, that is, the above-mentioned Figure 2 The API gateway in the system, or the business system containing the API gateway, includes multiple business API interfaces, and users can obtain the corresponding business functions or data of the corresponding business by calling the business API interfaces. Fig.12 As shown, the method may include:
[0054] S1202: Receive a call request, where the call request includes a target application program interface to be called.
[0055] In the specific implementation process, one or more application programming interfaces (APIs) can be deployed in the system. Different APIs can correspond to different businesses, such as Figure 2 As shown in the figure, different APIs can correspond to different resource servers. Users can access different services by initiating requests to call different APIs, or Figure 2 As shown, calling different APIs can access different resource servers or obtain data from different resource servers. The caller can initiate a call request through a client or a browser, and the call request may include relevant information about the target API to be called, i.e., the target application program interface, such as the name or identifier or domain name of the target application program interface. Of course, the call request may also include other information such as the request method, protocol, request path, and request parameters of the target application program interface, which are not specifically limited in the embodiments of this specification.
[0056] S1204: According to the calling request, a target interface path of the target application program interface is obtained.
[0057] In the specific real-time process, after receiving the call request, the target interface path of the target application interface requested in the call request can be obtained. The interface path can be understood as the specific URL of the API, and the corresponding API can be found through the path. The target interface path can be understood as the URL of the target application interface. For example: https: / / api.example.com / v1 / zoos can be understood as an interface path.
[0058] S1206: Determine whether the target interface path matches the interface path of at least one pre-set bait application interface. If so, determine that the call request is an abnormal call request, block the call request and return abnormal call prompt information; wherein the bait application interface is an abnormal application interface pre-set in the application interface gateway and / or client application.
[0059] In the specific implementation process, the embodiments of this specification pre-set one or more decoy application program interfaces, namely, decoy APIs, in the application program interface gateway or client application program. The decoy API can be understood as an abnormal application program interface that is different from the normal available application program interface. Figure 2The API gateway in it is mainly used to manage APIs. The client application can be understood as the application in the client (such as: smart phones, tablet computers, smart wearable devices, etc.). Setting the bait API in the client application is mainly suitable for API call scenarios under the C / S mode. According to actual usage needs, the bait API can be set only in the API gateway or only in the client application, or it can be set in the API gateway and the client application at the same time. The bait API set in the API gateway and the client application can be the same or different, and can be set specifically based on actual usage needs. By pre-setting the bait API in the API gateway or the client application, two major scenarios of API calls in the C / S mode and API calls in the B / S mode accessed by the client application can be covered at the same time. Among them, the number of bait APIs can be set according to actual needs, and the embodiments of this specification do not make specific limitations.
[0060] The decoy API in the embodiments of this specification can be understood as an application program interface for distinguishing normal calls from abnormal calls. Its format can be the same or similar to that of a normal API, but the specific content is different from that of a normal API, such as: the path, parameters, etc. are not exactly the same as those of a normal API, and there is no corresponding business or service. A normal API can be understood as an application program interface registered with an API gateway. A normal API corresponds to a specific business function or service, and the caller can use the service or business function corresponding to the normal API by calling a normal API. Referring to the records of the above embodiments, it can be known that a general normal API needs to be registered in the API gateway first, and the caller needs to obtain the request information of the target API to be called through the API provider or reference document before calling the API. In other words, a normal caller can obtain the relevant information of the normal API before calling the API, and initiate a call request based on the relevant information of the normal API. However, the attacker cannot obtain the relevant information of the normal API, and can only reverse engineer the code of the terminal control software of the client or use security technologies such as binary analysis to study the function list of the client and server APIs and the way the two communicate, etc., in an attempt to forge a legitimate API for calling. The decoy API is not in the list of normal APIs. Therefore, normal API callers generally do not call the decoy API. However, attackers cannot obtain relevant information about the normal API and may call the decoy API as a normal API.
[0061] After obtaining the target interface path of the target API requested to be called in the call request, the target interface path can be matched with the interface path of the pre-set bait API. If the target interface path matches the interface path of at least one bait API, it is determined that the bait API is triggered, and it can be considered that the current caller is not a normal caller. It is determined that the current call request is an abnormal call request, and the preset response result can be directly returned, such as: abnormal call prompt information, that is, the current call request will not be sent to the back-end service, and the current call request is intercepted. Usually, the abnormal call prompt information will only inform the caller that an error has occurred in the current call request, but will not inform the caller of the reason for the error. If it is determined that the current call request is not an abnormal call request, the call request will be forwarded to the back-end service, and the server corresponding to the target application interface will respond to the call request and return the corresponding data.
[0062] Of course, after identifying the current call request as an abnormal call request, an alarm can also be sent to the server to remind the server to pay attention to the terminal device that initiated the call request, or the terminal device or address that initiated the call request can be marked to manage subsequent call requests of the terminal device. In addition, different security processing rules can be set according to specific application scenarios, and abnormal call requests can be processed differently based on different security processing rules, which is not specifically limited in the embodiments of this specification.
[0063] Among them, the service end can be a server that manages the business corresponding to the API interface. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and the embodiments of this specification are not limited here.
[0064] In some embodiments of this specification, after determining that the call request is an abnormal call request, the method further includes:
[0065] Obtaining request information of the call request, wherein the request information includes at least one of a request parameter, a request source address, and an identity credential;
[0066] The characteristics of the caller initiating the abnormal call request are determined based on the request information.
[0067] In the specific implementation process, after identifying that the current call request is an abnormal call request, the request information of the call request can be obtained, such as at least one of the request parameters, the request source address, and the identity credentials, among which the request parameters can be understood as the specific parameters in the call request, the request source address can be understood as the source address of the call request, and the identity credentials can be understood as the credential information for identity authentication when the call request is initiated, such as a key or an identity identifier, etc. Of course, other request information can also be obtained, and the embodiments of this specification do not make specific limitations. Attack paths can be collected based on these request information as basic data for analyzing abnormal calls, laying a data foundation for the security protection of the API. For example: collect request information of multiple abnormal call requests, analyze the characteristics of the caller who initiated the abnormal call request based on the request information, and analyze the requesters of other call requests based on the characteristics of the caller who initiated the abnormal call request, so as to identify abnormal calls as early as possible, thereby laying a data foundation for the security protection of the API and playing a certain preventive effect on API attacks. Among them, the method for determining the characteristics of the caller who initiates the abnormal call request based on the request information can be selected according to actual needs, such as: an intelligent learning model can be used to learn the characteristics of the request information of different abnormal call requests, or the characteristics of the abnormal caller can be analyzed based on expert experience, etc. This manual does not make specific limitations.
[0068] In addition, in some embodiments of the present specification, after determining that the call request is an abnormal call request, the method further includes:
[0069] Collecting call data of the requesting end device that initiates abnormal call requests, if the number of times the requesting end device calls the bait application program interface within a specified time is greater than a preset number, or if the requesting end device initiates a call request to a normal application program interface after initiating a specified number of call requests for the bait application program interface program, the requesting end device is marked as an attacking device;
[0070] Intercept the call request of the attacking device.
[0071] In the specific implementation process, after determining that the call request is an abnormal call request, the request-side device that initiates the abnormal call request can be marked, and the subsequent call data of the request-side device that initiates the abnormal call request can be counted. If the number of times the request-side device calls the bait API within a specified time is greater than a preset number, the request-side device can be marked as an attack device; or after the request-side device initiates a call to a specified number of bait APIs, it initiates a call to a normal API, then the request-side device can be marked as an attack device, and security operations such as intercepting the call request of the attack device can be performed. For example: the current and subsequent call requests of other APIs of the attack device can be intercepted, and abnormal call information can be returned. If it is a device from the enterprise office network, the server can be further linked to execute corresponding disposal measures such as forced terminal logout and transfer to the enterprise isolation network. Among them, parameters such as preset number, specified number, preset time, etc. can be set according to actual needs, and the embodiments of this specification do not make specific limitations.
[0072] When it is detected that an attacker has triggered a call to a decoy API, the attack path of the malicious attacker to the enterprise API can be collected in advance by obtaining the request information. Furthermore, by monitoring the request-side device that initiates the abnormal call request, counting its call data, marking the more dangerous request-side devices, and intercepting all requests initiated by the dangerous request-side devices, the security of the API call can be ensured. For example, if it is subsequently detected that traffic from the same access terminal then initiates a call request for a normal business API, the current and all subsequent API call requests from the terminal can be automatically blocked. The method provided in the embodiments of this specification can effectively monitor API attacks that are forged as legitimate API calls and low-frequency executions, and achieves early perception of attack behaviors and collection of attack paths, which has a certain preventive effect on API attacks.
[0073] The embodiments of this specification provide a method for application program interface security protection, by setting a decoy API in advance in an API gateway or client application, after receiving an API call request, based on the interface path in the call request, to determine whether the call request triggers the decoy API, when it is detected that the call of the decoy API is triggered, it can be considered that the call request is an abnormal call request, the call request can be blocked and abnormal call prompt information can be returned, thereby preventing API attacks and improving the security of API calls. In addition, by setting a decoy API in an API gateway or client application, application scenarios in both C / S and B / S modes can be covered to ensure the security of API calls.
[0074] In addition, the embodiments of this specification may provide different preset methods of the bait API, and the details may refer to the records of the following embodiments:
[0075] In some embodiments of the present specification, the method of pre-setting the decoy application program interface in the application interface gateway includes:
[0076] A specified number of pre-buried application programming interfaces are set in the application programming interface gateway; wherein the pre-buried application programming interfaces are independent of normal application programming interfaces;
[0077] The embedded application program interface and / or the application program interface corresponding to the interface subpath of the embedded application program interface is set as a decoy application program interface.
[0078] In the specific implementation process, the server administrator or API provider can set a batch of APIs independent of the normal business interface as bait APIs in the API gateway, and can choose whether the sub-paths of this batch of APIs (for example: if / trade / query is set as a bait API, then / trade / query / abc, / trade / query / de, / trade / query / abc / check and other paths with it as the prefix API are its sub-paths) are automatically marked as bait APIs. In other words, a specified number of pre-embedded application program interfaces can be preset in the API gateway, and the pre-embedded application program interfaces are independent of the normal application program interfaces, that is, the format of the pre-embedded application program interfaces is the same or similar to that of the normal application program interfaces, but they do not belong to the normal application program interfaces. For example: based on the list of normal application program interfaces in the API gateway, one or more APIs that are different from all APIs in the list can be set as pre-embedded application program interfaces. The pre-embedded application program interface can be used as a bait API, and the pre-embedded application program interface and the interface corresponding to the interface sub-path of the pre-embedded application program interface can also be used as a bait API. Among them, the interface sub-path of the pre-embedded application program interface can be understood as a path with the interface path of the pre-embedded application program interface as the prefix, and its content after the prefix.
[0079] For example, if the server administrator or API provider sets the embedded application program interface including / corp.com / finance, you can select only the API that absolutely matches the path as the decoy API, that is, / corp.com / finance as the decoy API. You can also select all APIs whose path prefix matches the path as decoy APIs, such as / corp.com / finance / admin, / corp.com / finance / account, etc. as decoy APIs.
[0080] It should be noted that in this scenario, there is no association relationship such as prefix matching between the decoy API and the normal business API, so as to avoid the hit logic of the decoy API interfering with the normal request and response of the business API.
[0081] The embodiments of this specification implement the expansion of the decoy API by setting an API that is independent of the normal API interface as a decoy API in the API gateway, and by setting the interface sub-path of the decoy API, thereby realizing the function of batch setting the decoy API in the API gateway by only setting a small number of independent interfaces. When it is detected that the decoy API is called, it can be considered that the call is an abnormal call, and it can be detected that the attacker first takes various methods to break through the application environment of the application interface, lurks in it, and at the same time performs passive target detection at a low frequency and covertly, thereby preventing API attacks.
[0082] In some other embodiments of the present specification, the method of pre-setting a decoy application program interface in an application interface gateway includes:
[0083] Selecting a preset number of normal application programming interfaces from the application programming interface list published by the application programming interface gateway as candidate application programming interfaces;
[0084] The application program interface corresponding to the interface subpath of the candidate application program interface is set as the decoy application program interface.
[0085] In the specific implementation process, the server administrator or API provider can choose whether the sub-path of this batch of normal business APIs is automatically marked as bait API when the API gateway normally publishes the external API list. That is to say, when the API gateway publishes the API, a certain number (the specific number can be set based on actual needs, and this specification embodiment does not make specific restrictions) of normal APIs can be selected from the API list as candidate APIs, and the API corresponding to the interface sub-path of the candidate API is used as a bait API. The meaning of the interface sub-path is similar to the record in the above embodiment, and will not be repeated here. Of course, in general, the interface sub-path of the candidate API in the embodiment of this specification is different from the path of the normal API in the application program interface list in the API gateway. An interface that is independent of other normal interfaces can be selected as a candidate API, that is, there is no sub-path for the candidate API in the normal API list, and the interface corresponding to the interface path prefixed with the interface path of the candidate API is used as a bait API. In other words, the candidate API itself belongs to a normal API, but the interface prefixed with the interface path of the candidate API is a bait API. To ensure security, after configuring the interface sub-path of the candidate API, the interface sub-path of the candidate API can be compared with the path of the normal API in the application program interface list, and the interface sub-path of the candidate API that is the same as the path of the normal API can be deleted.
[0086] For example, if a business API released by a server administrator or API provider is / corp.com / ticket / query, the API corresponding to the subpath of this business API (the path prefix is the path of the business API), such as / corp.com / ticket / query / admin, can be used as a decoy API.
[0087] The embodiment of this specification selects some APIs from the normal API list in the API gateway as candidate APIs, and sets the APIs corresponding to the interface subpaths of the candidate APIs as decoy APIs in the API gateway. The format of the decoy API configured in this way meets the format requirements of the API, and the subpath is expanded directly based on the normal API in the API gateway, so that the decoy API can be set up quickly and accurately, without spending too much time and energy on the format of the decoy API, etc., laying a data foundation for the security protection of the API.
[0088] In some other embodiments of the present specification, the method of pre-setting a decoy application program interface in an application interface gateway includes:
[0089] After receiving a publishing request for publishing a new application program interface or an updating request for updating an application program interface, obtaining the latest normal application program interface list;
[0090] Use an API outside the latest normal API list as a decoy API;
[0091] Determining whether the target interface path matches the interface path of at least one preset decoy application program interface includes:
[0092] Determine whether the target interface path matches the interface path in the normal application interface list; if not, determine that the target interface path matches the interface path of the decoy application interface.
[0093] In the specific implementation process, each time the server administrator or API provider publishes a new API or changes an existing API in the API gateway, the API gateway can automatically treat all APIs other than the normal business API as bait APIs. This setting may require the administrator or API provider to check the setting switch before the API gateway can automatically execute. Specifically, after receiving a request to publish a new application interface or an update request to update an application interface, the API gateway can obtain the latest list of normal application interfaces after the new API is published or the API is updated. Based on the normal application interface list, all APIs outside the normal application interface list are used as bait APIs. Referring to the records of the above embodiments, generally, the APIs that can be used will be registered in the API gateway, that is, the API gateway can save the currently available APIs, and the API caller can also obtain the relevant information of the target API that it wants to call when calling the API. Under normal circumstances, normal API callers can see the list of APIs that can be used normally, select the API they want to call from it, and will not call APIs outside the list.
[0094] In this scenario, after receiving a call request, the target interface path of the target application interface to be called by the call request can be compared with the interface path in the normal application interface list. If the target application interface is different from the interface path in the normal application interface list, it can be considered that the target interface path matches the interface path of the bait API, and the call request is determined to be an abnormal call request.
[0095] Generally speaking, callers will not call APIs other than normal APIs. Attackers may try to call different APIs through some means to try to obtain relevant information of normal APIs. In this way, the attacker may call APIs other than normal APIs during the attempt. The embodiment of this specification directly uses all APIs other than normal APIs that the API gateway considers to be usable as bait APIs. When it is detected that a user calls the bait API, it can be considered as an abnormal call, thereby achieving security protection for the API. This method can realize the rapid setting of the bait API, without the need for technical personnel to set the format and content of the bait API, reducing the setting time of the bait API and improving data processing efficiency.
[0096] It should be noted that this method of using abnormal APIs as bait APIs when updating or releasing new APIs is more suitable for scenarios with a small number of API lists. This method is to mark normal APIs and use APIs other than those marked as bait APIs. If the number of normal APIs is relatively small, the effect of quickly setting up bait APIs can be achieved.
[0097] In some other embodiments of this specification, the method for setting a decoy application program interface in a client application program includes:
[0098] Setting a predetermined number of decoy application program interfaces in the client application program and setting normal calling parameters of the decoy application program interfaces;
[0099] Determining whether the target interface path matches the interface path of at least one preset decoy application program interface also includes:
[0100] If the target interface path is consistent with the interface path of the decoy application interface pre-set in the client application, the request parameters of the call request are obtained. If the request parameters are different from the normal call parameters, the call request is determined to be an abnormal call request.
[0101] In the specific implementation process, for API calls with front-end and back-end, that is, API calls in C / S mode, the front-end client application acts as the API caller, and the back-end service acts as the API service provider similar to B / S. The embodiments of this specification can pre-embed a batch of decoy APIs in the client application according to the format and data agreed with the back-end, and can choose not to trigger the API call, or set a certain scenario to initiate a call to the decoy API like a normal business API call. In this case, the request parameters for the decoy API may need to be assigned in strict accordance with the format agreed with the back-end, so that the API gateway can distinguish whether it is a normal client decoy API call or an abnormal API process called by a suspected attacker.
[0102] It can be seen that the decoy API set in the client application can also be treated as a normal API call, but the request parameters in the call request need to be the same as the parameters set by the agreement to be determined as a normal API call. When it is detected that a user requests to call the decoy API set in the client application, that is, the interface path in the call request is the same as the path of the decoy API set in the client application, the request parameters of the call request will continue to be obtained to determine whether the request parameters are the same as the normal call parameters set in advance. If they are the same, it is considered a normal call. If they are different, the call request can be considered an abnormal call request and security protection processing can be performed.
[0103] The embodiments of this specification are aimed at the scenario where attackers reverse engineer the code of the client's terminal control software, and use security technologies such as binary analysis to study the function list of the client and server APIs and the way the two communicate, and then try to forge legitimate API calls to perform passive analysis and low-frequency attacks, and set up bait APIs for trapping. The attacker can first perform static reverse analysis and initiate dynamic analysis and interface probing of the API request embedded in the terminal, and may also try to launch further attacks including stealing credentials and other sensitive information by adjusting the parameters of the API. In the embodiments of this specification, pre-embedding the bait API in the client application and constructing a seemingly normal business call to trigger the bait API request is a way to confuse attackers and achieve the purpose of collecting attack paths and blocking further attacks in real time.
[0104] The method for setting the bait API provided in the embodiments of this specification can be selected in one or more forms according to actual needs, and the embodiments of this specification do not make any specific limitations.
[0105] Fig.13 This is a schematic diagram of the principle flow of API security protection in an embodiment of this specification. Fig.13 As shown, the security protection process of the API call in the embodiment of this specification can be referred to as follows:
[0106] According to the above embodiments, the decoy API set by different methods is as follows Fig.13 The process shown in the figure automatically responds to the following. First, the API gateway marks the API request traffic with the following characteristics as Fig.13 The abnormal API request shown is:
[0107] First, requests whose API paths hit the decoy API paths set in the API gateway in the above embodiment are all considered to be invocation requests that trigger the decoy API. Path matching methods include full path matching and prefix matching (for example, the API with the normal business API path as the path prefix is the decoy API).
[0108] The second is the method of setting up a bait API in the client application in the above embodiment. If the API request traffic received by the API gateway is the bait API pre-embedded in the client application, and the request parameter value is the same as the setting, it is regarded as normal API traffic (the client application triggers the call of the bait API according to the set scenario, which is normal logic in itself); if the request parameter value deviates from the setting, for example, some required fields are missing, the content of the parameter value does not match the set value, etc., it is considered to be a tampered bait API call and is regarded as abnormal API traffic.
[0109] The calls in the above two scenarios will be marked as abnormal call requests. Fig.13 Once the abnormal API request shown in the figure is determined as an abnormal API request by the API gateway, the traffic will not be forwarded to the backend service, but will be forwarded to the backend service according to the Fig.13 The order of steps 1 to 2 shown is determined by the API gateway responding to the preset result information, such as returning the abnormal call prompt information. In this process, the API gateway will send audit and alarm data to the server through the process of steps 3 to 4, and provide the API request parameters, request source address, identity credentials, etc. initiated by the suspected attacker to the server as basic data for collecting attacker characteristics. After the set security rules are triggered, for example, the triggered bait API is pre-buried in the terminal application, and the parameter value does not match the preset value, it can be considered that the possibility of attack traffic is high. In addition to executing the corresponding automatic response, it will also be reported as alarm data, and the security operation team will be linked for analysis and disposal.
[0110] In some embodiments of this specification, after determining that a call request is an abnormal call request, in addition to reporting audit data to the server to provide attack analysis data, the triggering of different types of decoy APIs can perform automatic security disposal based on preset security rules. For example: when a device initiates a certain number of decoy API calls and then initiates a normal business API call, in this case, the API gateway can first intercept all API requests from the terminal and respond to the preset error response information. If it is from a device in the enterprise office network, it can further link the server to execute the terminal forced logout and transfer to the enterprise isolation network and other corresponding disposal measures.
[0111] The method for application program interface security protection provided by the embodiment of this specification can set different modes of decoy APIs when the API gateway publishes the API, and collect the attack path information of malicious attackers in the B / S mode by monitoring the call of the decoy API. For API calls with front and back ends (C / S mode), different decoy APIs can be pre-embedded in the client application, and different calling methods of decoy APIs can be set. By detecting requests different from conventional calls, attackers can reverse engineer the code of the client's terminal management software, and use security technologies such as binary analysis to study the function list of the client and server APIs and the way the two communicate, and then try to forge a legitimate API call to perform passive analysis and low-frequency attack. In any case, when it is detected that the attacker has triggered the call of the decoy API, the attack path of the malicious attacker to the enterprise API can be collected in advance by obtaining the request information. The embodiment of this specification can effectively monitor the API attack behavior that is forged as a legitimate API call and low-frequency execution, realize the early perception of the attack behavior of the API call and the collection of the attack path, and play a certain preventive effect on the attack of the API.
[0112] Based on the method of application interface security protection described above, one or more embodiments of this specification also provide a client and server for processing application interface security protection. The client and server may include devices (including distributed systems), software (applications), modules, components, servers, clients, etc. that use the methods described in the embodiments of this specification and are combined with necessary implementation hardware. Based on the same innovative concept, the devices in one or more embodiments provided in the embodiments of this specification are as described in the following embodiments. Since the implementation scheme and method of the device to solve the problem are similar, the implementation of the specific device in the embodiments of this specification can refer to the implementation of the aforementioned method, and the repetitions will not be repeated. As used below, the term "unit" or "module" can implement a combination of software and / or hardware for predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0113] It can be seen from the technical solutions provided in the above embodiments of this specification that the embodiments of this specification also provide a device for application program interface security protection. Fig.14 is a schematic diagram of the structure of an application program interface security protection device provided in an embodiment of this specification, such as Fig.14 As shown, the above device comprises:
[0114] The request receiving module 1410 is used to receive a call request, wherein the call request includes a target application program interface to be called;
[0115] A path acquisition module 1420, configured to acquire a target interface path of the target application program interface according to the call request;
[0116] The abnormal call protection module 1430 is used to determine whether the target interface path matches the interface path of at least one pre-set bait application interface. If it matches, it is determined that the call request is an abnormal call request, the call request is blocked and abnormal call prompt information is returned; wherein, the bait application interface is an abnormal application interface pre-set in the application interface gateway and / or client application.
[0117] Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the method, and will not be elaborated in detail here. The device in the above embodiment may also include other implementation methods according to the description of the method embodiment, and the specific implementation method can refer to the description of the relevant method embodiment, which will not be repeated here one by one.
[0118] Fig.15is a block diagram of an electronic device for application program interface security protection provided by an embodiment of this specification. The electronic device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.15 As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for security protection of an application program interface is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.
[0119] Fig.16 is a block diagram of another electronic device for application program interface security protection provided by an embodiment of this specification. The electronic device may be a server, and its internal structure diagram may be as shown in FIG. Fig.16 As shown. The electronic device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for implementing application program interface security protection is implemented.
[0120] Those skilled in the art will understand that Fig.15 or Fig.16 The structure shown in the figure is merely a block diagram of a portion of the structure related to the embodiment scheme of this specification, and does not constitute a limitation on the electronic device to which the embodiment scheme of this specification is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0121] In an exemplary embodiment, an electronic device is also provided, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement a method for application program interface security protection as in the embodiment of the embodiment of this specification.
[0122] In an exemplary embodiment, a computer-readable storage medium is also provided. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the method for application program interface security protection in the embodiment of the embodiment of this specification.
[0123] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method of application program interface security protection provided in the above various optional implementations.
[0124] It is understandable that in the specific implementation of the embodiments of this specification, user-related data is involved. When the embodiments above the embodiments of this specification are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0125] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the embodiments of this specification may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0126] Those skilled in the art will readily appreciate other implementations of the embodiments of the present specification after considering the specification and practicing the invention disclosed herein. The embodiments of the present specification are intended to cover any variations, uses, or adaptations of the embodiments of the present specification, which follow the general principles of the embodiments of the present specification and include common knowledge or customary technical means in the art that are not disclosed in the embodiments of the present specification. The description and embodiments are to be considered merely as exemplary, and the true scope and spirit of the embodiments of the present specification are indicated by the claims below.
[0127] It should be understood that the embodiments of the present specification are not limited to the precise structures described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the embodiments of the present specification is limited only by the appended claims.
Claims
1. A method for application program interface security protection, characterized in that: The method comprises: Receiving a call request, wherein the call request includes a target application program interface to be called; According to the calling request, obtaining a target interface path of the target application program interface; Determine whether the target interface path matches the interface path of at least one pre-set bait application interface. If so, determine that the call request is an abnormal call request, block the call request and return abnormal call prompt information; wherein the bait application interface is an abnormal application interface pre-set in the application interface gateway and / or client application.
2. The method according to claim 1, characterized in that The method of pre-setting the decoy application program interface in the application interface gateway includes: Setting a specified number of pre-buried application programming interfaces in the application programming interface gateway; wherein the pre-buried application programming interfaces are independent of normal application programming interfaces; The embedded application program interface and / or the application program interface corresponding to the interface sub-path of the embedded application program interface is set as a decoy application program interface.
3. The method according to claim 1, characterized in that The method of pre-setting the decoy application program interface in the application interface gateway includes: Selecting a preset number of normal application programming interfaces from the application programming interface list published by the application programming interface gateway as candidate application programming interfaces; The application program interface corresponding to the interface subpath of the candidate application program interface is set as a decoy application program interface.
4. The method according to claim 1, characterized in that: The method of pre-setting the decoy application program interface in the application interface gateway includes: After receiving a publishing request for publishing a new application program interface or an updating request for updating an application program interface, obtaining the latest normal application program interface list; Using an application program interface outside the latest normal application program interface list as a decoy application program interface; The determining whether the target interface path matches the interface path of at least one preset decoy application program interface includes: Determine whether the target interface path matches the interface path in the normal application interface list; if not, determine that the target interface path matches the interface path of the decoy application interface.
5. The method according to claim 1, characterized in that The method for setting the decoy application program interface in the client application program includes: Setting a predetermined number of decoy application program interfaces in the client application program and setting normal calling parameters of the decoy application program interfaces; The determining whether the target interface path matches the interface path of at least one preset decoy application program interface also includes: If the target interface path is consistent with the interface path of the decoy application interface pre-set in the client application, the request parameters of the call request are obtained. If the request parameters are different from the normal call parameters, the call request is determined to be an abnormal call request.
6. The method according to claim 1, characterized in that After determining that the call request is an abnormal call request, the method further includes: Obtaining request information of the call request, wherein the request information includes at least one of a request parameter, a request source address, and an identity credential; The characteristics of the caller initiating the abnormal call request are determined based on the request information.
7. The method according to claim 1, characterized in that After determining that the call request is an abnormal call request, the method further includes: Collecting call data of the requesting end device that initiates the abnormal call request, if the number of times the requesting end device calls the bait application program interface within a specified time is greater than a preset number, or the requesting end device initiates a call request to a normal application program interface after initiating a specified number of call requests for the bait application program interface program, the requesting end device is marked as an attacking device; Intercept the call request of the attacking device.
8. An application program interface security protection device, characterized in that: The device comprises: A request receiving module, used for receiving a call request, wherein the call request includes a target application program interface to be called; A path acquisition module, used for acquiring a target interface path of the target application program interface according to the call request; The abnormal call protection module is used to determine whether the target interface path matches the interface path of at least one pre-set bait application interface. If it matches, the call request is determined to be an abnormal call request, the call request is blocked and abnormal call prompt information is returned; wherein the bait application interface is an abnormal application interface pre-set in the application interface gateway and / or client application.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method for application program interface security protection as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method for application program interface security protection as described in any one of claims 1 to 7.
