Interface call request processing method and device, equipment, medium and program product
By pre-issuing keys and encryption algorithms in the service grid using sidecar containers, and performing secure verification on the service request side, the verification failure problem caused by certificate expiration is solved, and meticulous control of interface-level permissions is achieved , improves the security and flexibility of interface call requests.
Patent Information
- Application Number
- CN202411069015.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-08-06
AI Technical Summary
The existing service mesh (Istio) relies on certificates in interface call verification, resulting in certificate expiration and verification failure. The permission configuration is not meticulous enough to be meticulous to the interface level.
By pre-issuing keys and encryption algorithms in the sidecar container, generating and transmitting verification information as request headers for interface call requests, performing security verification on the service request side, avoiding the use of certificates, and permission configuration and synchronization are carried out through the Security Policy Management Center. , ensure meticulous control of interface call permissions.
It solves the verification failure problem caused by certificate expiration, and implements permission control at the interface level, improving the security and flexibility of interface call requests.
Smart Images

Figure CN119045926A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of request processing, and in particular to an interface call request processing method, device, equipment, medium and program product. Background Art
[0002] As the number of existing backend microservices increases, when using cloud platforms and service meshes (Istio) to manage and control backend microservices, unified interface call permissions are required for management, as well as more flexible permission configuration and more detailed permission verification mechanisms.
[0003] The interface call verification of the existing service grid (Istio) uses the SSL (Secure socket layer) protocol, that is, the mTLS (Mutual Transport Layer Security) system. The sidecar container and the grid management end use the SDS (Secret Discovery Service) protocol to issue and authenticate certificates. However, the certificates of this method have an expiration date and must be replaced regularly. Failure to update in time will cause the verification to fail. At the same time, the permissions for interface verification management in this method are not detailed enough and can only be limited to the application level, not the interface level. Summary of the invention
[0004] The present application provides an interface call request processing method, apparatus, device, medium and program product, which avoids the use of service grid certificates, thereby avoiding the problem of verification failure caused by failure to update the certificate in time, resulting in certificate expiration.
[0005] In the first aspect, the present application provides an interface call request processing method, which is executed by a sidecar container of a service request end, including: receiving an interface call request sent by an application container in the container group where the sidecar container is located; encrypting the identification information and security node number of the service request end according to a key and an encryption algorithm to generate verification information; wherein the key and the encryption algorithm are pre-issued to the sidecar container of each container group by a security management system; using the verification information as a request header of the interface call request, and sending the interface call request to a service provider, so that the service provider parses the request header in the interface call request to obtain the verification information, and performs security verification on the service request end.
[0006] On the second aspect, the present application also provides an interface call request processing method, which is executed by the sidecar container of the service provider, including: receiving an interface call request sent by the service requester, and parsing the interface call request; obtaining verification information from the request header of the interface call request; wherein the verification information is generated by the sidecar container of the service requester according to a key and an encryption algorithm, encrypting the identification information and security node number of the service requester; and verifying the service requester according to the verification information.
[0007] In the third aspect, the present application also provides an interface call request processing method, which is executed by a security policy management center, including: determining the type of permission configuration information for an interface that requires permission configuration; wherein the type of permission configuration information includes reflecting the type of service request end that is allowed to call the interface or reflecting the type of service request end that is not allowed to call the interface; determining the service request end according to the type of the permission configuration information, and generating permission configuration information based on the interface and the corresponding service request end; synchronizing the permission configuration information to a grid server, and the grid server sends the permission configuration information to the side car container in each container group, so that the side car container performs interface call request processing according to the permission configuration information.
[0008] In the fourth aspect, the present application also provides an interface call request processing device, which is applied to the sidecar container of the service request end, including: an interface call request receiving module, which is used to receive the interface call request sent by the application container in the container group where the sidecar container is located; a verification information generating module, which is used to encrypt the identification information and security node number of the service request end according to a key and an encryption algorithm to generate verification information; wherein the key and the encryption algorithm are pre-sent to the sidecar container of each container group by the security management system; an interface call request sending module, which is used to use the verification information as the request header of the interface call request, and send the interface call request to the service provider, so that the service provider parses the request header in the interface call request to obtain the verification information, and performs security verification on the service request end.
[0009] In the fifth aspect, the present application also provides an interface call request processing device, which is applied to the sidecar container of the service provider end, including: an interface call request parsing module, which is used to receive the interface call request sent by the service request end and parse the interface call request; a verification information acquisition module, which is used to obtain verification information from the request header of the interface call request; wherein the verification information is generated by the sidecar container of the service request end according to a key and an encryption algorithm, encrypting the identification information and security node number of the service request end; a service request end verification module, which is used to verify the service request end according to the verification information.
[0010] In the sixth aspect, the present application also provides an interface call request processing device, which is applied to a security policy management center, including: a permission configuration information type determination module, which is used to determine the type of permission configuration information for an interface that requires permission configuration; wherein the type of the permission configuration information includes reflecting the type of service request end that is allowed to call the interface or reflecting the type of service request end that is not allowed to call the interface; a permission configuration information generation module, which is used to determine the service request end according to the type of the permission configuration information, and generate permission configuration information according to the interface and the corresponding service request end; a permission configuration information synchronization module, which is used to synchronize the permission configuration information to a grid server, and the grid server sends the permission configuration information to the sidecar container in each container group.
[0011] The interface call request processing method, apparatus, device, medium and program product provided in the present application receive an interface call request sent by an application container in the container group where the sidecar container is located; encrypt the identification information and security node number of the service request end according to the key and encryption algorithm to generate verification information; wherein the key and the encryption algorithm are pre-issued to the sidecar container of each container group by the security management system; use the verification information as the request header of the interface call request, and send the interface call request to the service provider, so that the service provider parses the request header in the interface call request to obtain the verification information, and performs security verification on the service request end. The above scheme generates verification information through the key and encryption algorithm pre-issued to the sidecar container by the security management system, thereby avoiding the use of service grid certificates, thereby avoiding the problem of failure to update the certificate in time, resulting in verification failure caused by certificate expiration. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0013] Figure 1 A flowchart of an interface call request processing method executed by a sidecar container of a service request end provided in Embodiment 1 of the present application;
[0014] Figure 2 A timing diagram of sending an interface call request provided in Example 1 of the present application;
[0015] Figure 3 A flowchart of an interface call request processing method executed by a sidecar container of a service provider provided in Embodiment 2 of the present application;
[0016] Figure 4A flowchart of another method for processing an interface call request executed by a sidecar container of a service provider provided in Embodiment 3 of the present application;
[0017] Figure 5 A verification timing diagram of an interface call request provided in Example 3 of the present application;
[0018] Figure 6 A flowchart of an interface call request processing method executed by a security policy management center provided in Embodiment 4 of the present application;
[0019] Figure 7 A timing diagram for synchronously sending permission configuration information provided in Embodiment 4 of the present application;
[0020] Figure 8 A complete flowchart of a specific implementation of an interface call request processing method provided in Example 5 of the present application;
[0021] Fig. 9 A system architecture diagram of an interface call request processing method provided in Embodiment 5 of the present application;
[0022] Fig.10 A schematic diagram of the structure of an interface call request processing device of a sidecar container configured at a service request end provided in Embodiment 6 of the present application;
[0023] Fig.11 A schematic diagram of the structure of an interface call request processing device of a sidecar container configured on a service provider end provided in Embodiment 7 of the present application;
[0024] Fig.12 A schematic diagram of the structure of an interface call request processing device configured in a security policy management center provided in Embodiment 8 of the present application;
[0025] Fig.13 This is a schematic diagram of the structure of an electronic device provided in Example 9 of the present application.
[0026] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0027] The exemplary embodiments will be described in detail here, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation methods described in the following exemplary embodiments do not represent all implementation methods consistent with the present application. On the contrary, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims. The acquisition, transmission, storage, use, processing, etc. of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0028] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0029] Terminology explanation:
[0030] Service Mesh: As the infrastructure layer for communication between services, Service Mesh is a lightweight, high-performance network proxy that can provide secure, fast, and reliable communication between services. Service Mesh is deployed together with the actual application, but is transparent to the application.
[0031] Istio: A fully open source service mesh built as a transparent layer on existing distributed applications. It is also a platform that provides a variety of APIs (Application Programming Interface) and can be integrated with any logging platform, monitoring system or policy system.
[0032] Grid server: used to manage the sidecar container, has a long link with the sidecar container, and is used to issue rules, configuration, addressing and other information.
[0033] Sidecar container: An important container design pattern that can provide additional services or functions to the application container without modifying the application code.
[0034] Pod: The smallest deployable computing unit in a container orchestration system, which can contain one or more containers that share the same network namespace, storage volumes, and other resources.
[0035] JWT: JOSN Web Token, is an open standard that defines a compact, self-contained way to securely transmit information between parties as a JSON (JavaScript Object Nctation) object.
[0036] SA: A server used to issue keys and security policies. The security SDK (Software Development Kit) can encrypt and decrypt data based on the keys and security policies issued by it.
[0037] Embodiment 1
[0038] Figure 1 A flowchart of a method for processing an interface call request performed by a sidecar container on a service request side is provided for the first embodiment of the present application. The embodiment of the present application may be applicable to situations where interface call requests are processed. Typically, the embodiment of the present application may be applicable to situations where interface call requests between different service objects in the same cloud container are processed. The method may be executed by an interface call request processing device applied to a sidecar container on a service request side, and the interface call request processing device may be implemented in the form of hardware and / or software, and the interface call request processing device may be configured in an electronic device. Figure 1 As shown, the method is executed by the sidecar container of the service request end, and includes:
[0039] S110: Receive an interface call request sent by an application container in the same container group as the sidecar container.
[0040] Among them, the sidecar container is an important container design pattern that can provide additional services or functions for the application container without modifying the application code. The application container is a modern deployment strategy that can run on different operating systems and hardware platforms to provide a variety of interface services. Generally speaking, the sidecar container and the application container are generally located in the same container group, so that the sidecar container can assist the application container when the application container provides interface services. In an embodiment of the present application, the reasons for generating an interface call request can be diverse, such as business logic needs, data acquisition and synchronization, event-driven architecture, asynchronous processing, user interaction, etc. Taking business logic needs as an example, an online shopping application may need to call a payment service to process a user's payment request.
[0041] Since the sidecar container and the application container are in the same container group, that is, in the Pod, when the application container sends an interface call request, the sidecar container can receive the interface call request issued by the application container through the network interface localhost inside the Pod. This method is relatively simple and direct. In some cases, it is also possible to create a ClusterIP type Service to achieve communication between the sidecar container and the application container to receive the interface call request sent by the application container, but this method will increase additional network overhead and complexity. In an embodiment of the present application, the Istio service grid is used, so the reception of the interface call request sent by the application container can also be achieved through the traffic management and inter-service communication functions provided by the service grid.
[0042] In an embodiment of the present application, after receiving an interface call request sent by an application container in the container group where the sidecar container is located, the method further includes:
[0043] Acquire the information of the service provider in the interface call request; determine the address of the service provider according to the information of the service provider, and send the interface call request to the service provider based on the address of the service provider.
[0044] The service provider is the provider of the service required in the interface call request, and is usually located in the same cloud container as the service requester. The service provider information in the interface call request generally includes the service name, version and other information, which is used to identify the service provider.
[0045] In an embodiment of the present application, when an application container wants to call the interface of a service, it usually needs to know the address of the service provider. Therefore, after receiving the interface call request issued by the application container, it is necessary to first parse the interface call request and obtain the information of the service provider in the interface call request, such as the service name, version, etc., and use this to determine the address of the service provider, and then send the interface call request to the service provider based on the address of the service provider.
[0046] For example, after obtaining the information of the service provider in the interface call request, the sidecar container of the service request end can send a query request containing the information to the service registration center based on the information of the service provider, such as the service name and version, and obtain the address information of the service provider from the detailed content of the service provider returned by the service registration center.
[0047] For another example, a correspondence table between the service provider information and the server address is pre-established, and after obtaining the service provider information in the interface call request, the address information of the service provider is determined in the correspondence table according to the information.
[0048] S120. Encrypt the identification information and security node number of the service request end according to the key and encryption algorithm to generate verification information; wherein the key and encryption algorithm are pre-sent by the security management system to the sidecar container of each container group.
[0049] Among them, the identification information of the service request end is the service metadata information of the service request end, which is used to identify the service request end. The security node number of the service request end is used to identify the encryption algorithm of the service request end. The security node numbers of different service request ends are different, and the encryption algorithms are also different. In the embodiment of the present application, the security management system is SA, which is used to issue keys and encryption algorithms. The encryption algorithm can use MD5, SHA256, etc. In the embodiment of the present application, the identification information and security node number of the service request end are encrypted according to the key and encryption algorithm through JWT to generate verification information.
[0050] In an embodiment of the present application, according to a key and an encryption algorithm, the identification information and the security node number of the service request end are encrypted to generate verification information, including:
[0051] Generate a header data portion of the verification information according to the type of the verification information; generate a payload data portion of the verification information according to the identification information and the security node number; sign the identification information and the security node number according to the key and encryption algorithm to generate a signature data portion of the verification information.
[0052] Among them, in the JWT encryption method, the header data part is used to describe the metadata of the JWT, the payload data part is used to transmit the data that needs to be transmitted, and the signature data part is a signature of the header data part and the payload part, which is used to encrypt the first two parts of information.
[0053] In the embodiment of the present application, since the verification information is generated by JWT encryption, the type of verification information is JWT, which can be used as the header data part of the verification information. The identification information of the service request end is used to identify the service request end, so that the service provider can clearly know that the service request end provides services. The security node number is used to identify the encryption algorithm of the service request end, so that the service provider can accurately parse the encrypted verification information. Therefore, the identification information and the security node number can be used as the payload data part of the verification information. Afterwards, according to the key and encryption algorithm pre-issued by the security management system, the header data part and the effective data payload part can be signed, that is, encrypted, through the security verification toolkit SDK integrated in the sidecar container of the service request end, to generate the signature data part of the verification information.
[0054] Compared with the prior art that uses certificates and TLS for encryption, in the embodiment of the present application, the security management system SA pre-delivers the key and encryption algorithm to the sidecar container, and encrypts the information through the security SDK integrated in the sidecar container, thereby avoiding the use of service grid certificates and eliminating the need to worry about the problem of failure to update the certificate in time and causing the verification to become invalid. In the embodiment of the present application, before encrypting the identification information and the security node number of the service request end according to the key and encryption algorithm to generate verification information, the method further includes:
[0055] Receive the key and encryption algorithm corresponding to each sidecar container pre-issued by the security management system; and retrieve the key and encryption algorithm corresponding to the sidecar container from the key and encryption algorithm issued by the security management system according to the security node number of the sidecar container.
[0056] In the embodiment of the present application, when the security management system SA pre-issues the key and encryption algorithm, it is necessary to establish a secure communication channel between itself and each sidecar container to ensure that the key and encryption algorithm are not stolen or tampered with during the transmission process. After receiving the key and encryption algorithm, each sidecar container needs to store the received key and encryption algorithm securely to prevent unauthorized access. In the embodiment of the present application, the key and encryption algorithm pre-issued to each sidecar container by the security management system SA include the key and encryption algorithm to be used by different service request ends when encrypting information. Since the key and encryption algorithm to be used by different service request ends when encrypting information are different, and the key and encryption algorithm to be used by the service request end are identified using the security node number of the sidecar container, the key and encryption algorithm corresponding to the sidecar container can be retrieved from the key and encryption algorithm issued by the security management system according to the security node number of the sidecar container, that is, the security node number of the service request end, and the information to be sent by the sidecar container is encrypted.
[0057] In the embodiment of the present application, before encrypting the identification information and the security node number of the service request end according to the key and the encryption algorithm to generate verification information, the method further includes:
[0058] A security policy is received from a security management system; wherein the security policy is used to indicate the steps for executing the interface call request processing method; a security verification toolkit is generated by packaging the interface for executing the security policy according to the security policy, so as to execute the interface call request processing method based on the security verification toolkit.
[0059] The security policy is used to indicate the steps of executing the interface call request processing method, specifically, the steps related to information encryption and decryption in the interface call request processing method. The security verification toolkit, i.e., the security SDK, is integrated into each sidecar container and is used to execute the interface call request processing method, specifically, the steps related to information encryption and decryption in the interface call request processing method.
[0060] In an embodiment of the present application, the security management system is also used to issue security policies to indicate relevant steps in the interface call request. After receiving the security policy, each sidecar container first determines the interface required to execute the security policy according to the security policy, and then packages the determined interface to generate a security verification toolkit SDK, and integrates it into itself, so that when generating verification information, the header data part and the effective data payload part of the verification information are signed and encrypted through the security SDK to generate the signature data part of the verification information, and when the service request end acts as the service provider, the verification information is decrypted through the security SDK.
[0061] S130. Use the verification information as a request header of the interface call request, and send the interface call request to the service provider, so that the service provider parses the request header in the interface call request to obtain the verification information, and performs security verification on the service requester.
[0062] In the embodiment of the present application, after the verification information is generated, the verification information can be added to the header information of the interface call request, so that it serves as the request header of the interface call information, and the interface call request after adding the verification information is sent to the service provider, so that the service provider parses the request header in the interface call request to obtain the verification information and performs security verification on the service requester. For example, Figure 2 A timing diagram of sending an interface call request is shown, such as Figure 2 As shown in the figure, service A is the service request end, and service B is the service provider end. When the sidecar container of service A receives the interface call request sent by the application container of service A, it first determines the address of service B, and then generates verification information as the request header of the interface call request based on the service metadata and security node number of service A, and finally sends the interface call request to service B.
[0063] In an embodiment of the present application, after the service provider receives the interface call request sent by the service requester, the service provider can parse the interface call request through the sidecar container of the service provider, obtain the verification information from the request header of the interface call request, and perform security verification on the identity and authority of the service requester based on the verification information. It can be understood that the above process includes decryption of the encrypted verification information, and the decryption of the encrypted verification information is also performed through the security management system SA and the security SDK, avoiding the use of service grid certificates, and there is no need to worry about the failure to update the certificate in time, resulting in the failure of verification caused by the expiration of the certificate.
[0064] In an embodiment of the present application, the method further includes:
[0065] Establishing communication with the grid service end through a long link; receiving permission configuration information sent by the grid service end to determine whether the application sending the interface call request to the service request end has access rights according to the permission configuration information.
[0066] Among them, the grid server is used to manage the sidecar container, and has a long link with the sidecar container to issue rules, configuration, addressing and other information. In the embodiment of the present application, the long link can be performed through GRPC. The permission configuration information is used to describe the permissions of the application that sends the interface call request, which can be configured through the security policy management center and issued through the grid server.
[0067] In an embodiment of the present application, the service request end may also serve as a service provider for other service request ends. When the service request end serves as a service provider for other service request ends, it may authenticate the application that sends an interface call request to the service request end based on the permission configuration information issued by the grid server that communicates with it through a long link, that is, verify whether it has the interface call permission.
[0068] The embodiment of the present application receives an interface call request sent by an application container in the same container group as the sidecar container; according to the key and encryption algorithm, the identification information and security node number of the service request end are encrypted to generate verification information; wherein the key and encryption algorithm are pre-distributed to the sidecar container of each container group by the security management system; the verification information is used as the request header of the interface call request, and the interface call request is sent to the service provider, so that the service provider parses the request header in the interface call request to obtain the verification information, and performs security verification on the service request end. The above scheme generates verification information through the key and encryption algorithm pre-distributed to the sidecar container by the security management system, thereby avoiding the use of service grid certificates, thereby avoiding the problem of failure to update the certificate in time, resulting in verification failure caused by certificate expiration.
[0069] Embodiment 2
[0070] Figure 3 A flowchart of a method for processing an interface call request executed by a sidecar container on a service provider side is provided for Embodiment 2 of the present application. Embodiments of the present application may be applicable to situations where interface call requests are processed. Typically, embodiments of the present application may be applicable to situations where interface call requests between different service objects located in the same cloud container are processed. The method may be executed by an interface call request processing device applied to a sidecar container on the service provider side, and the interface call request processing device may be implemented in the form of hardware and / or software, and the interface call request processing device may be configured in an electronic device. For content not described in detail in the embodiments of the present application, such as explanations of terms, etc., please refer to the above embodiments for details. Figure 3 As shown, the method includes:
[0071] S210: Receive an interface call request sent by a service request end, and parse the interface call request.
[0072] Among them, the design of the containerized architecture enables both the service request end and the service provider end to adopt a layout that combines sidecar containers and application containers. Similar to the service request end, the service provider end also includes sidecar containers and application containers in the same container group, which has high flexibility and scalability.
[0073] In an embodiment of the present application, after the sidecar container at the service request end encrypts the verification information and adds it to the interface call request header as the request header of the interface call request, the interface call request can be sent to the service provider according to the predetermined address of the service provider. The sidecar container at the service provider intercepts and receives the interface call request sent by the service request end, and parses the received interface call request to ensure that the format of the interface call request meets the expected specifications. In actual applications, the communication between the service request end and the service provider end may be carried out through protocols such as HTTP and GRPC, which can be selected according to the actual situation, and the embodiment of the present application does not limit this.
[0074] S220. Obtain verification information from the request header of the interface call request; wherein the verification information is generated by the sidecar container of the service request end by encrypting the identification information and the security node number of the service request end according to the key and the encryption algorithm.
[0075] In the embodiment of the present application, after the sidecar container of the service request end encrypts the identification information and the security node number of the service request end according to the key and the encryption algorithm to generate the verification information, the verification information is added to the header information of the interface call request, so that it is used as the request header of the interface call information. Therefore, after the sidecar container of the service provider receives the interface call request sent by the service request end, the verification information can be obtained from the request header of the interface call request to verify the service request end according to the verification information. At the same time, since the verification information is transmitted in the request header of the interface call request, it does not interfere with the main content of the interface call request, making the parsing and processing of the interface call request simpler and more efficient.
[0076] S230: Verify the service requester according to the verification information.
[0077] Among them, the verification information obtained from the request header of the interface call request is still in an encrypted state. Before verifying the service request end according to the verification information, the encrypted verification information needs to be decrypted to verify the service request end according to the relevant content in the decrypted verification information. In the embodiment of the present application, the above decryption process is performed through the security management system SA and the security SDK, avoiding the use of the service grid certificate, and there is no need to worry about the failure to update the certificate in time, resulting in the failure of verification caused by the expiration of the certificate.
[0078] In an embodiment of the present application, the service request end is verified according to the verification information, which can be performed from two aspects: the verification information itself and the content in the decrypted verification information. Starting from the verification information itself, the integrity of the verification information can be verified to determine whether the verification information has been tampered with during the transmission process, so as to verify the identity of the service request end. Starting from the content in the decrypted verification information, the authority of the service request end can be verified according to the relevant content of the service request end in the verification information. By verifying the service request end according to the verification information, the security of the service can be ensured.
[0079] The solution in the embodiment of the present application receives an interface call request sent by a service request end, and parses the interface call request; obtains verification information from the request header of the interface call request; wherein the verification information is generated by encrypting the identification information and the security node number of the service request end by the sidecar container of the service request end according to the key and encryption algorithm; and verifies the service request end according to the verification information. The above solution generates verification information by using the key and encryption algorithm pre-sent to the sidecar container by the security management system, thereby avoiding the use of service grid certificates, thereby avoiding the problem of failure to update certificates in a timely manner, resulting in verification failure caused by certificate expiration.
[0080] Embodiment 3
[0081] Figure 4 This is a flowchart of another method for processing an interface call request executed by a sidecar container on a service provider side, provided in Embodiment 3 of the present application. This embodiment is optimized based on the above embodiment.
[0082] like Figure 4 As shown, the method of this embodiment specifically includes the following steps:
[0083] S310: Receive an interface call request sent by a service requester, and parse the interface call request.
[0084] S320. Obtain verification information from the request header of the interface call request; wherein the verification information is generated by encrypting the identification information and security node number of the service request end by the sidecar container of the service request end according to the key and the encryption algorithm.
[0085] S330. Based on the key and encryption algorithm pre-issued by the security management system, the server request end is authenticated according to the verification information.
[0086] In the embodiment of the present application, the sidecar container of the service provider also has the decryption algorithm corresponding to the key and encryption algorithm pre-issued by the security management system, as well as the security SDK integrated in the sidecar container. The sidecar container can decrypt the verification information through the security SDK according to the key and encryption algorithm pre-issued by the security management system, and authenticate the server request end according to the decrypted verification information. The above decryption process is performed through the security management system SA and the security SDK, avoiding the use of service grid certificates, and there is no need to worry about the failure to update the certificate in time, resulting in the failure of verification caused by the expiration of the certificate.
[0087] In an embodiment of the present application, based on the key and encryption algorithm pre-issued by the security management system, the server request end is authenticated according to the verification information, including:
[0088] The verification information is decrypted based on the key pre-issued by the security management system and the decryption algorithm corresponding to the encryption algorithm; the signature data part of the verification information is verified according to the identification information and the security node number in the payload data part of the verification information.
[0089] Among them, the decryption algorithm corresponding to the encryption algorithm can be determined by the security node number in the payload data part. It can be understood that the security node number is used to identify the encryption algorithm used by the service request end. The encryption algorithm used by the service request end can be determined through the security node number, and then the corresponding decryption algorithm can be determined.
[0090] In the embodiment of the present application, the verification information is generated by JWT encryption, and the encrypted part is mainly the signature data part of the verification information. After determining the decryption algorithm corresponding to the encryption algorithm, the signature data part of the verification information can be decrypted according to the key and the decryption algorithm. At the same time, since the signature data part is generated by encrypting the header data part and the payload data part, the signature data part of the verification information can be verified by comparing the identification information and the security node number of the payload data part transmitted in plain text with the corresponding content of the decrypted signature data part, and judging whether the verification information has been tampered with during the transmission process, so as to complete the identity authentication of the server request end.
[0091] In an embodiment of the present application, verifying the signature data portion of the verification information according to the identification information and the security node number in the payload data portion of the verification information includes:
[0092] According to the security node number, the key and the encryption algorithm corresponding to the sidecar container of the service request end are retrieved from the key and the encryption algorithm issued by the security management system; based on the key and the encryption algorithm, the identification information and the security node number in the payload data part of the verification information are signed; the signed result is compared with the signature data part of the verification information, and the signature data part of the verification information is verified.
[0093] In the embodiment of the present application, the keys and encryption algorithms pre-distributed by the security management system SA to each sidecar container include the keys and encryption algorithms to be used by different service requesters when encrypting information. Therefore, the sidecar container of the service provider can retrieve the keys and encryption algorithms corresponding to the sidecar container of the service requester from the keys and encryption algorithms pre-distributed to the local by the security management system SA according to the security node number of the service requester. Afterwards, through the security SDK integrated in the sidecar container, the identification information and the security node number in the payload data part of the verification information are signed based on the key and encryption algorithm corresponding to the sidecar container of the service requester. Finally, by comparing the signed result with the signature data part of the verification information, it is determined whether the contents of the two are consistent, so as to verify the signature data part of the verification information.
[0094] S340: Verify the interface calling authority of the service requesting end according to the identification information in the verification information.
[0095] The identification information is the service metadata information of the service request end, which is transmitted in plain text through the payload data part of the verification information and is used to uniquely identify the service request end.
[0096] In an embodiment of the present application, verifying the interface call authority of the service request end according to the identification information in the verification information includes:
[0097] The identification information is obtained from the payload portion of the verification information; and it is determined whether the service request end has the interface calling authority according to the authority configuration information sent by the grid service end and the identification information.
[0098] In an embodiment of the present application, after obtaining the identification information of the service request end from the payload data portion transmitted in plain text, the sidecar container of the service provider can authenticate the service request end determined by the identification information according to the permission configuration information issued by the grid service end communicating with it through a long link, that is, verify whether it has the interface call permission. It should be noted that the permission configuration information may include multiple authentication rules. If any authentication rule is not satisfied, the interface call request is terminated, and an error code or error message indicating that the interface call failed is returned to the service request end. If all of them are satisfied, it means that the service request end has the interface call permission.
[0099] In an embodiment of the present application, after determining whether the service request end has the interface call permission according to the permission configuration information sent by the grid service end and the identification information, the method further includes:
[0100] If the service request end has the interface call permission, the interface call request is sent to the application container in the container group where the sidecar container is located, so that the application container processes the interface call request.
[0101] In the embodiment of the present application, if the service requester has the interface call permission, the sidecar container of the service provider will determine that the service requester is legal and trusted. At this time, the sidecar container forwards the interface call request to the application container in the same container group so that the application container processes the interface call request. In the embodiment of the present application, using the Istio service grid, the interface call request can be forwarded from the sidecar container to the application container through the traffic management and inter-service communication functions provided by the service grid.
[0102] For example, Figure 5 A verification sequence diagram of an interface call request is shown, such as Figure 5 As shown in the figure, service A is the service requester, service B is the service provider, and when the sidecar container of service B receives the interface call request sent by service A, it parses the interface call request, obtains the verification information from the request header of the interface call request, authenticates the server requester based on the verification information, verifies the interface call authority of the service requester based on the identification information, and finally sends the interface call request to service B.
[0103] The scheme in the embodiment of the present application receives an interface call request sent by the service request end, and parses the interface call request; obtains verification information from the request header of the interface call request; wherein the verification information is generated by encrypting the identification information and security node number of the service request end by the sidecar container of the service request end according to the key and encryption algorithm; authenticates the server request end according to the verification information based on the key and encryption algorithm pre-issued by the security management system; and verifies the interface call authority of the service request end according to the identification information in the verification information. The above scheme decrypts the verification information through the key and encryption algorithm pre-issued to the sidecar container by the security management system, and then authenticates the identity and interface call authority of the server request end, avoiding the use of service grid certificates, thereby avoiding the problem of failure to update the certificate in time, resulting in the failure of verification caused by the expiration of the certificate.
[0104] Embodiment 4
[0105] Figure 6 A flowchart of an interface call request processing method performed by a security policy management center is provided for the fourth embodiment of the present application. The embodiments of the present application may be applicable to situations where interface call requests are processed. Typically, the embodiments of the present application may be applicable to situations where interface call requests between different service objects located in the same cloud container are processed. The method may be executed by an interface call request processing device applied to a security policy management center, and the interface call request processing device may be implemented in the form of hardware and / or software, and the interface call request processing device may be configured in an electronic device. For content not described in detail in the embodiments of the present application, such as explanations of terms, etc., please refer to the above embodiments for details. Figure 6 As shown, the method includes:
[0106] S410. Determine the type of permission configuration information for the interface that needs permission configuration; wherein the type of permission configuration information includes a service request end that is allowed to call the interface or a service request end that is not allowed to call the interface.
[0107] Among them, when the type of permission configuration information is a service request end that allows calling an interface, only the service request ends that are explicitly listed can call the interface. This type has high security and low flexibility. When the type of permission configuration information is a service request end that does not allow calling an interface, unless explicitly prohibited, any service request end may attempt to call the interface. This type has low security and high flexibility.
[0108] In an embodiment of the present application, the interface that needs to be configured with permissions can be analyzed through the security policy management center to understand the functions and services provided by the interface, and to evaluate the security requirements of the interface, such as data sensitivity, business importance, etc., to determine the strictness of the permission configuration. Afterwards, the type of permission configuration information of the interface can be determined based on the analysis results of the interface. If the security requirements of the interface are very high, or only a specific service request end needs to be called, then the type of permission configuration information can be determined as a service request end that allows the interface to be called. If the interface needs to prevent the call of certain specific service request ends, the type of limited configuration information can be determined as a service request end that does not allow the interface to be called, so as to clearly specify which service request ends are prohibited from calling the interface. By determining the type of interface permission configuration information in the security policy management center, the interface call permission can be controlled more flexibly, and the control granularity is more detailed. After the service provider knows the information of the service request end, it can be clear whether the service request end can call this interface.
[0109] In the embodiment of the present application, before determining the type of permission configuration information for the interface that needs to be configured for permission, the method further includes:
[0110] All interfaces that can be provided by all container groups are collected through the grid service end; in response to the interface selection operation of the user on the visual interface of the security policy management center, the interface that needs to be configured with permissions is determined.
[0111] In an embodiment of the present application, all services and container groups within the cluster can be monitored through the grid server, and the interface information corresponding to each service can be automatically collected and sorted through the service discovery and reflection mechanism to collect all interfaces that can be provided by all container groups. After the collection is completed, the collected interface information can be stored in a central database for subsequent query and display. In an embodiment of the present application, a user-friendly visual interface can be built in the security policy management center to display the information of all collected interfaces, and provide search, filtering and classification functions to help users quickly locate the interfaces of interest. Users can browse and select interfaces that need to be configured with permissions through the visual interface. The visual interface can support multiple selections so that users can determine multiple interfaces that need to be configured with permissions at one time.
[0112] S420: Determine the service request end according to the type of the authority configuration information, and generate the authority configuration information according to the interface and the corresponding service request end.
[0113] In an embodiment of the present application, after clarifying the permission configuration type of the interface, it is possible to identify which service request terminals need to be included in the permission configuration based on the purpose and business logic of the interface, and generate permission configuration information based on the interface and the corresponding service request terminal. It should be noted that when generating permission configuration information, only the minimum permissions required to complete its task should be granted to the service request terminal, which helps to reduce potential risks. In addition, after generating the permission configuration information, the permission configuration can be reviewed regularly to ensure that they still meet business needs and security requirements. In an embodiment of the present application, permission configuration information is generated based on the interface and the corresponding service request terminal, including:
[0114] A filter template is created according to the permission configuration information, and the filter template is bound to a preset container group to create a filter for the permission configuration information.
[0115] The filter is used to filter the service request end that sends the interface call request to the service provider end according to the permission configuration information, and prevent the service request end that does not have the interface call permission from calling the interface. The filter template is used to dynamically generate a specific filter instance according to the permission configuration information.
[0116] In an embodiment of the present application, a filter template is created according to the permission configuration information. The filter code can be written in an appropriate programming language (such as Python) so that it can receive the permission configuration information as input and execute the filtering logic according to the permission configuration information. Then, the fixed part and the variable part in the filter code are separated, and the variable part is defined as a template parameter. Through the above process, the creation of the filter template can be completed. After that, the filter template is bound to the preset container group to create a filter about the permission configuration information. As the permission configuration information of the interface is different, the value of the template parameter is also different, and filter instances with different configurations can be generated.
[0117] In an embodiment of the present application, determining a service request end according to the type of the permission configuration information, and generating permission configuration information according to the interface and the corresponding service request end include:
[0118] If the type of the permission configuration information reflects the type of the service request end that is allowed to call the interface, then determine the service request end that is allowed to access the interface; associate the interface with the identification information of the service request end that is allowed to access the interface, and generate permission configuration information, so that when the sidecar container determines that the identification information of the service request end belongs to the identification information corresponding to the interface in the permission configuration information, it determines that the service request end has access rights to the corresponding interface.
[0119] In an embodiment of the present application, when the type of permission configuration information is a type that reflects the service request end that is allowed to call the interface, only the service request end that is explicitly listed can call the interface. At this time, the service request end that is allowed to access the interface can be determined first, and then the interface can be associated with the identification information of the service request end that is allowed to access the interface to generate the permission configuration information. After the sidecar container of the service provider obtains the identification information of the service provider in the interface call request, it can determine whether the service request end has access rights to the corresponding interface by determining whether the identification information belongs to the identification information corresponding to the interface in the permission configuration information of the service provider, that is, whether the identification information has an association relationship with the corresponding interface of the service provider, and when it is determined that the identification information of the service request end belongs to the identification information corresponding to the interface in the permission configuration information, it can determine that the service request end has access rights to the corresponding interface.
[0120] In an embodiment of the present application, determining a service request end according to the type of the permission configuration information, and generating permission configuration information according to the interface and the corresponding service request end include:
[0121] If the type of the permission configuration information is a type that reflects a service request end that is not allowed to call the interface, then the service request end that is not allowed to access the interface is determined, or the service request end that is allowed to access the interface is removed from all service request ends to obtain the service request end that is not allowed to access the interface; the interface is associated with the identification information of the service request end that is not allowed to access the interface, and permission configuration information is generated, so that the sidecar container determines that the service request end has access rights to the corresponding interface when it is determined that the identification information of the service request end does not belong to the identification information corresponding to the interface in the permission configuration information.
[0122] In an embodiment of the present application, when the type of permission configuration information is a type that reflects a service request end that is not allowed to call the interface, unless explicitly prohibited, any service request end may attempt to call the interface. At this time, the service request end that is not allowed to access the interface can be determined first, or, when there are many service request ends that are not allowed to access the interface, the service request end that is allowed to access the interface is removed from all service request ends, and then the interface is associated with the identification information of the service request end that is not allowed to access the interface to generate permission configuration information. After the sidecar container of the service provider obtains the identification information of the service provider in the interface call request, it can determine whether the service request end has access rights to the corresponding interface by determining whether the identification information belongs to the identification information corresponding to the interface in the permission configuration information of the service provider, that is, whether the identification information has an association relationship with the corresponding interface of the service provider, and when it is determined that the identification information of the service request end does not belong to the identification information corresponding to the interface in the permission configuration information, it is determined that the service request end has access rights to the corresponding interface.
[0123] S430. Synchronize the permission configuration information to the grid server, so that the grid server sends the permission configuration information to the side car container in each container group, so that the side car container parses the request header in the interface call request to obtain verification information, and then processes the interface call request according to the permission configuration information and the verification information.
[0124] Among them, the verification information is generated by the sidecar container of the service request end encrypting the identification information and the security node number of the service request end according to the key and encryption algorithm; the key and encryption algorithm are pre-sent to the sidecar container of each container group by the security management system.
[0125] In an embodiment of the present application, after configuring the permission configuration information type of the interface through the security policy management center and generating the permission configuration information, the permission configuration information can be synchronized to the grid server, and the grid server can send the permission configuration information to the sidecar container in each container group through a long link. After receiving the permission configuration information sent by the grid server and parsing the request header of the received interface call request to obtain verification information, the sidecar container can process the interface call request according to the permission configuration information and verification information, and realize the identity authentication and permission verification of the service request end that sends the interface call request.
[0126] In an embodiment of the present application, synchronizing the permission configuration information to the grid server, and the grid server sending the permission configuration information to the sidecar container in each container group, so that the sidecar container performs interface call request processing according to the permission configuration information, including:
[0127] For each combination of applications, components, services and interfaces, the permission configuration information corresponding to the combination is determined according to the type of the permission configuration information; the permission configuration information corresponding to each combination is synchronized to the grid service end, so that the grid service end sends the permission configuration information corresponding to each combination to the service provider that provides the service corresponding to the combination.
[0128] For the combination of applications and services, you can determine the basic permission configuration for the entire application or service level, such as which services are public and which require authentication. For the combination of services and interfaces, you can define detailed permission configuration for each interface under a service, such as which services can call which interfaces and perform which operations. For the combination of components and interfaces, if there are independent components in the architecture, you can define permission configuration for the interaction between the component and the interface.
[0129] In an embodiment of the present application, for each combination of applications, components, services and interfaces, the overall permission configuration information corresponding to each combination can be determined according to the type of the new configuration, and the permission configuration information corresponding to each combination can be synchronized to the grid server, so that the permission configuration information corresponding to each combination can be sent to the service provider that provides the corresponding service of the combination in a targeted manner on the grid server.
[0130] For example, Figure 7 A timing diagram of synchronous delivery of permission configuration information is shown, such as Figure 7 As shown, after the security policy management center generates the permission configuration information, the permission configuration information is synchronized to the grid server, and the permission configuration information is sent to the sidecar containers in each container group through the grid server.
[0131] The scheme in the embodiment of the present application determines the type of permission configuration information for the interface that needs to be configured with permissions; wherein the type of permission configuration information includes a service request end that is allowed to call the interface or a service request end that is not allowed to call the interface; the service request end is determined according to the type of permission configuration information, and permission configuration information is generated according to the interface and the corresponding service request end; the permission configuration information is synchronized to the grid server, so that the grid server sends the permission configuration information to the sidecar container in each container group, so that the sidecar container parses the request header in the interface call request to obtain verification information, and then processes the interface call request according to the permission configuration information and the verification information. The above scheme can control the interface call permission more flexibly and with more detailed control granularity by determining the type of interface permission configuration information in the security policy management center. After the service provider knows the information of the service request end, it can clarify whether the service request end can call the interface of the service provider end.
[0132] Embodiment 5
[0133] Figure 8A complete flowchart of a specific implementation of an interface call request processing method provided in Embodiment 5 of the present application, Fig. 9 This is a system architecture diagram of an interface call request processing method provided in Example 5 of the present application. In the embodiment of the present application, the service request end is service A, the service provider end is service B, and the security policy management center is SA. Figure 8 As shown, the method of this embodiment specifically includes the following steps:
[0134] S510. Generate permission configuration information through the security policy center, synchronize the permission configuration information to the grid server, and the grid server sends the permission configuration information to the sidecar containers of service A and service B.
[0135] S520. The security management system pre-sends the key and encryption algorithm to the sidecar containers of service A and service B.
[0136] S530. The sidecar container of service A receives the interface call request sent by the application container in the same container group as the sidecar container, and encrypts the identification information and security node number of service A according to the key and encryption algorithm to generate verification information, uses the verification information as the request header of the interface call request, and sends the interface call request to service B.
[0137] S540. The sidecar container of service B receives the interface call request sent by service A, parses the interface call request, obtains verification information from the request header of the interface call request, and verifies service A according to the verification information.
[0138] S550. If service A has the interface call permission, an interface call request is sent to the application container in the same container group as the sidecar container of service B, so that the application container of service B processes the interface call request.
[0139] Embodiment 6
[0140] Fig.10 This is a schematic diagram of the structure of an interface call request processing device provided in Embodiment 6 of the present application. The device can execute the interface call request processing method executed by the sidecar container of the service request end in the present application. Fig.10 As shown, the device is configured in an electronic device corresponding to the sidecar container of the service request end, and includes: an interface call request receiving module 610, a verification information generating module 620 and an interface call request sending module 630;
[0141] The interface call request receiving module 610 is used to receive an interface call request sent by an application container in the container group where the sidecar container is located;
[0142] The verification information generation module 620 is used to encrypt the identification information and the security node number of the service request end according to the key and the encryption algorithm to generate verification information; wherein the key and the encryption algorithm are pre-issued by the security management system to the sidecar container of each container group;
[0143] The interface call request sending module 630 is used to send the interface call request to the service provider using the verification information as the request header of the interface call request, so that the service provider parses the request header in the interface call request to obtain the verification information and performs security verification on the service requester.
[0144] In some embodiments, the verification information generation module 620 encrypts the identification information and the security node number of the service request end according to the key and the encryption algorithm to generate verification information, specifically including: generating a header data portion of the verification information according to the type of the verification information; generating a payload data portion of the verification information according to the identification information and the security node number; signing the identification information and the security node number according to the key and the encryption algorithm to generate a signature data portion of the verification information.
[0145] In some embodiments, the device also includes: a long link communication establishment module, used to establish communication with the grid server through a long link; an access permission determination module, used to receive permission configuration information sent by the grid server, so as to determine whether the application sending the interface call request to the service request end has access permissions based on the permission configuration information.
[0146] In some embodiments, the device also includes: a service provider information acquisition module, used to obtain the information of the service provider in the interface call request; a service provider address determination module, used to determine the address of the service provider based on the information of the service provider, so as to send the interface call request to the service provider based on the address of the service provider.
[0147] In some embodiments, the device further includes: a key and encryption algorithm receiving module, which is used to receive the keys and encryption algorithms corresponding to each sidecar container pre-issued by the security management system; a key and encryption algorithm retrieval module, which is used to retrieve the key and encryption algorithm corresponding to the sidecar container from the keys and encryption algorithms issued by the security management system according to the security node number of the sidecar container.
[0148] In some embodiments, the device also includes: a security policy receiving module, used to receive a security policy from a security management system; wherein the security policy is used to indicate the steps of executing the interface call request processing method; a security verification toolkit generation module, used to generate a security verification toolkit according to the security policy package to execute the interface of the security policy, so as to execute the interface call request processing method based on the security verification toolkit.
[0149] An interface call request processing device provided in an embodiment of the present application can execute the communication fault handling method provided in an embodiment of the present application and executed by the sidecar container of the service request end.
[0150] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. For example, the interface call request receiving module 610 can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above interface call request receiving module 610. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0151] Embodiment 7
[0152] Fig.11 This is a schematic diagram of the structure of an interface call request processing device provided in Embodiment 7 of the present application. The device can execute the interface call request processing method executed by the sidecar container of the service provider in the present application. Fig.11 As shown, the device is configured in an electronic device corresponding to the sidecar container of the service provider, and includes: an interface call request parsing module 710, a verification information acquisition module 720 and a service request end verification module 730;
[0153] The interface call request parsing module 710 is used to receive the interface call request sent by the service request end and parse the interface call request;
[0154] The verification information acquisition module 720 is used to obtain the verification information from the request header of the interface call request; wherein the verification information is generated by encrypting the identification information and the security node number of the service request end according to the key and the encryption algorithm of the sidecar container of the service request end;
[0155] The service request end verification module 730 is used to verify the service request end according to the verification information.
[0156] In some embodiments, the service request end verification module 730 verifies the service request end based on the verification information, specifically including: authenticating the service request end based on the key and encryption algorithm pre-issued by the security management system and the verification information; and verifying the interface call authority of the service request end based on the identification information in the verification information.
[0157] In some embodiments, according to the key and encryption algorithm pre-issued by the security management system, the server request end is authenticated according to the verification information, including: decrypting the verification information according to the key pre-issued by the security management system and the decryption algorithm corresponding to the encryption algorithm; verifying the signature data part of the verification information according to the identification information in the payload data part of the verification information and the security node number.
[0158] In some embodiments, the signature data portion of the verification information is verified based on the identification information and the security node number in the payload data portion of the verification information, including: retrieving the key and the encryption algorithm corresponding to the sidecar container of the service request end from the key and the encryption algorithm issued by the security management system based on the security node number; signing the identification information and the security node number in the payload data portion of the verification information based on the key and the encryption algorithm; comparing the signed result with the signature data portion of the verification information to verify the signature data portion of the verification information.
[0159] In some embodiments, the interface calling authority of the service request end is verified based on the identification information in the verification information, including: obtaining the identification information from the payload data portion of the verification information; and determining whether the service request end has the interface calling authority based on the permission configuration information sent by the grid server and the identification information.
[0160] In some embodiments, after determining whether the service request end has interface call permission based on the permission configuration information sent by the grid service end and the identification information, it also includes: if the service request end has interface call permission, sending the interface call request to the application container in the container group where the sidecar container is located, so that the application container processes the interface call request.
[0161] An interface call request processing device provided in an embodiment of the present application can execute the interface call request processing method provided in an embodiment of the present application and executed by the sidecar container of the service provider.
[0162] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. For example, the interface call request parsing module 710 can be a separately established processing element, or it can be integrated in a chip of the above device for implementation. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above interface call request parsing module 710. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0163] Embodiment 8
[0164] Fig.12 This is a schematic diagram of the structure of an interface call request processing device provided in Embodiment 8 of the present application. The device can execute the interface call request processing method executed by the security policy management center in the present application. Fig.12 As shown, the device is configured in an electronic device corresponding to a security policy management center, and includes: a permission configuration information type determination module 810, a permission configuration information generation module 820, and a permission configuration information synchronization module 830;
[0165] The permission configuration information type determination module 810 is used to determine the type of permission configuration information for the interface that needs permission configuration; wherein the type of the permission configuration information includes the type of the service request end that reflects the permission to call the interface or the type of the service request end that reflects the prohibition of calling the interface;
[0166] The permission configuration information generating module 820 is used to determine the service request end according to the type of the permission configuration information, and generate the permission configuration information according to the interface and the corresponding service request end;
[0167] The permission configuration information synchronization module 830 is used to synchronize the permission configuration information to the grid server, and the grid server sends the permission configuration information to the sidecar container in each container group, so that the sidecar container parses the request header in the interface call request to obtain the verification information, and then processes the interface call request according to the permission configuration information and the verification information;
[0168] Among them, the verification information is generated by encrypting the identification information and security node number of the service request end by the sidecar container of the service request end according to the key and encryption algorithm; the key and the encryption algorithm are pre-sent to the sidecar container of each container group by the security management system.
[0169] In some embodiments, the permission configuration information generation module 820 generates permission configuration information according to the interface and the corresponding service request end, specifically including: creating a filter template according to the permission configuration information, and binding the filter template to a preset container group to create a filter for the permission configuration information.
[0170] In some embodiments, the permission configuration information synchronization module 830 synchronizes the permission configuration information to the grid server, and the grid server sends the permission configuration information to the sidecar container in each container group, so that the sidecar container performs interface call request processing according to the permission configuration information, including: for each combination of application, component, service and interface, determining the permission configuration information corresponding to the combination according to the type of the permission configuration information; synchronizing the permission configuration information corresponding to each combination to the grid server, so that the grid server sends the permission configuration information corresponding to each combination to the service provider that provides the service corresponding to the combination.
[0171] In some embodiments, the device also includes: an interface collection module, which is used to collect all interfaces that can be provided by all container groups through the grid server; an interface determination module, which is used to respond to the user's interface selection operation on the visual interface of the security policy management center and determine the interface that needs to be configured with permissions.
[0172] In some embodiments, the permission configuration information generation module 820 determines the service request end according to the type of the permission configuration information, and generates permission configuration information according to the interface and the corresponding service request end, including: if the type of the permission configuration information is a type that reflects the type of service request end that is allowed to call the interface, then determining the service request end that is allowed to access the interface; associating the interface with the identification information of the service request end that is allowed to access the interface, and generating permission configuration information, so that the sidecar container determines that the service request end has access rights to the corresponding interface when it is determined that the identification information of the service request end belongs to the permission configuration information.
[0173] In some embodiments, the permission configuration information generation module 820 determines the service request end according to the type of the permission configuration information, and generates permission configuration information according to the interface and the corresponding service request end, including: if the type of the permission configuration information is a type that reflects a service request end that is not allowed to call the interface, then determining the service request end that is not allowed to access the interface, or removing the service request end that is allowed to access the interface from all service request ends to obtain the service request end that is not allowed to access the interface; associating the interface with the identification information of the service request end that is not allowed to access the interface, and generating permission configuration information, so that the sidecar container determines that the service request end has access rights to the corresponding interface when it determines that the identification information of the service request end does not belong to the identification information corresponding to the interface in the permission configuration information.
[0174] An interface call request processing device provided in an embodiment of the present application can execute the interface call request processing method provided in an embodiment of the present application and executed by a security policy management center.
[0175] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the permission configuration information type determination module 810 can be a separately established processing element, or it can be integrated in a chip of the above device for implementation. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above permission configuration information type determination module 810. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0176] Embodiment 9
[0177] Fig.13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.13 As shown, the electronic device may include: a transceiver 121 , a processor 122 , and a memory 123 .
[0178] The processor 122 executes the computer execution instructions stored in the memory, so that the processor 122 executes the scheme in the above embodiment. The processor 122 can be a general-purpose processor, including a central processing unit CPU, a network processor (network processor, NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0179] The memory 123 is connected to the processor 122 via a system bus and completes communication between them. The memory 123 is used to store computer program instructions.
[0180] The transceiver 121 may be used to obtain tasks to be executed and configuration information of the tasks to be executed.
[0181] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory.
[0182] The electronic device provided in the embodiment of the present application may be the terminal device of the above embodiment.
[0183] An embodiment of the present application also provides a chip for executing instructions, which is used to execute the technical solution of the interface call request processing method in the above embodiment.
[0184] An embodiment of the present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the technical solution of the interface call request processing method of the above embodiment.
[0185] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, it can implement the technical solution of the interface call request processing method in the above embodiment.
[0186] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0187] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for processing an interface call request, characterized in that: Executed by the sidecar container on the service request side, including: Receive an interface call request sent by an application container in the container group where the sidecar container is located; According to the key and encryption algorithm, the identification information and the security node number of the service request end are encrypted to generate verification information; wherein the key and the encryption algorithm are pre-issued by the security management system to the sidecar container of each container group; The verification information is used as a request header of an interface call request, and the interface call request is sent to a service provider, so that the service provider parses the request header in the interface call request to obtain the verification information and performs security verification on the service requester.
2. The method according to claim 1, characterized in that According to the key and the encryption algorithm, the identification information and the security node number of the service request end are encrypted to generate verification information, including: Generate a header data portion of the verification information according to the type of the verification information; Generate a payload data portion of the verification information according to the identification information and the security node number; The identification information and the security node number are signed according to the key and encryption algorithm to generate a signature data portion of the verification information.
3. The method according to claim 1, characterized in that The method further comprises: Establish communication with the grid server through a long link; The permission configuration information sent by the grid service end is received to determine whether the application sending the interface call request to the service request end has access rights according to the permission configuration information.
4. The method according to claim 1, characterized in that After receiving the interface call request sent by the application container in the container group where the sidecar container is located, the method further includes: Obtaining information about the service provider in the interface call request; The address of the service provider is determined according to the information of the service provider, so as to send the interface calling request to the service provider based on the address of the service provider.
5. The method according to claim 1, characterized in that Before encrypting the identification information and the security node number of the service request end according to the key and the encryption algorithm to generate verification information, the method further includes: Receive the keys and encryption algorithms corresponding to each sidecar container pre-issued by the security management system; According to the security node number of the sidecar container, the key and encryption algorithm corresponding to the sidecar container are retrieved from the key and encryption algorithm issued by the security management system.
6. The method according to claim 1, characterized in that Before encrypting the identification information and the security node number of the service request end according to the key and the encryption algorithm to generate verification information, the method further includes: Receiving a security policy from a security management system; wherein the security policy is used to indicate the steps of executing the interface call request processing method; The interface for executing the security policy is packaged according to the security policy to generate a security verification toolkit, so as to execute the interface call request processing method based on the security verification toolkit.
7. A method for processing an interface call request, characterized in that: Executed by the sidecar container on the service provider side, including: Receive an interface call request sent by a service request end, and parse the interface call request; Acquire verification information from the request header of the interface call request; wherein the verification information is generated by encrypting the identification information and the security node number of the service request end by the sidecar container of the service request end according to the key and the encryption algorithm; The service requesting end is verified according to the verification information.
8. The method according to claim 7, characterized in that Verifying the service request end according to the verification information includes: Based on the key and encryption algorithm pre-issued by the security management system, the server request end is authenticated according to the verification information; The interface calling authority of the service request end is verified according to the identification information in the verification information.
9. The method according to claim 8, characterized in that Based on the key and encryption algorithm pre-issued by the security management system, the server request end is authenticated according to the verification information, including: Decrypting the verification information based on the key pre-issued by the security management system and the decryption algorithm corresponding to the encryption algorithm; The signature data portion of the verification information is verified based on the identification information and the security node number in the payload data portion of the verification information.
10. The method according to claim 9, characterized in that Verifying the signature data portion of the verification information according to the identification information and the security node number in the payload data portion of the verification information includes: Retrieve the key and the encryption algorithm corresponding to the sidecar container of the service request end from the key and the encryption algorithm issued by the security management system according to the security node number; Based on the key and the encryption algorithm, signing the identification information and the security node number in the payload data portion of the verification information; The signed result is compared with the signature data portion of the verification information, and the signature data portion of the verification information is verified.
11. The method according to claim 8, characterized in that Verifying the interface calling authority of the service request end according to the identification information in the verification information includes: Acquire the identification information from the payload data portion of the verification information; According to the authority configuration information sent by the grid service end and the identification information, it is determined whether the service request end has the interface calling authority.
12. The method according to claim 11, characterized in that After determining whether the service request end has the interface calling authority according to the authority configuration information sent by the grid service end and the identification information, the method further includes: If the service request end has the interface call permission, the interface call request is sent to the application container in the container group where the sidecar container is located, so that the application container processes the interface call request.
13. A method for processing an interface call request, characterized in that: Executed by a security policy management center, the method includes: For the interface that needs to be configured with permissions, determine the type of permission configuration information; wherein the type of permission configuration information includes reflecting the type of the service request end that is allowed to call the interface or reflecting the type of the service request end that is not allowed to call the interface; Determine a service request end according to the type of the permission configuration information, and generate permission configuration information according to the interface and the corresponding service request end; Synchronize the permission configuration information to the grid server, and the grid server sends the permission configuration information to the sidecar container in each container group, so that the sidecar container parses the request header in the interface call request to obtain verification information, and then processes the interface call request according to the permission configuration information and the verification information; Among them, the verification information is generated by encrypting the identification information and security node number of the service request end by the sidecar container of the service request end according to the key and encryption algorithm; the key and the encryption algorithm are pre-sent to the sidecar container of each container group by the security management system.
14. The method according to claim 13, characterized in that Generate permission configuration information according to the interface and the corresponding service request end, including: A filter template is created according to the permission configuration information, and the filter template is bound to a preset container group to create a filter for the permission configuration information.
15. The method according to claim 13, characterized in that Synchronizing the permission configuration information to the grid server includes: For each combination of application, component, service and interface, determine the permission configuration information corresponding to the combination according to the type of the permission configuration information; The authority configuration information corresponding to each combination is synchronized to the grid service end, so that the grid service end sends the authority configuration information corresponding to each combination to the service provider end that provides the service corresponding to the combination.
16. The method according to claim 13, characterized in that Before determining the type of permission configuration information for the interface that needs permission configuration, the method further includes: Collecting all interfaces that can be provided by all container groups through the grid server; In response to an interface selection operation by a user on a visual interface of the security policy management center, an interface requiring permission configuration is determined.
17. The method according to claim 13, characterized in that Determining a service request end according to the type of the permission configuration information, and generating permission configuration information according to the interface and the corresponding service request end, including: If the type of the permission configuration information reflects the type of the service request end that is allowed to call the interface, determining the service request end that is allowed to access the interface; The interface is associated with identification information of a service request end that is allowed to access the interface, and permission configuration information is generated, so that when the sidecar container determines that the identification information of the service request end belongs to the permission configuration information, it determines that the service request end has access rights to the corresponding interface.
18. The method according to claim 13, characterized in that Determining a service request end according to the type of the permission configuration information, and generating permission configuration information according to the interface and the corresponding service request end, including: If the type of the permission configuration information is a type reflecting a service request end that is allowed to call the interface, determining a service request end that is not allowed to access the interface, or removing the service request end that is allowed to access the interface from all service request ends to obtain a service request end that is not allowed to access the interface; The interface is associated with identification information of a service request end that is not allowed to access the interface, and permission configuration information is generated, so that when the sidecar container determines that the identification information of the service request end does not belong to the identification information corresponding to the interface in the permission configuration information, it is determined that the service request end has access rights to the corresponding interface.
19. An interface call request processing device, characterized in that: The electronic devices corresponding to the sidecar container configured on the service request end include: An interface call request receiving module, used to receive an interface call request sent by an application container in the container group where the sidecar container is located; A verification information generation module is used to encrypt the identification information and the security node number of the service request end according to the key and the encryption algorithm to generate verification information; wherein the key and the encryption algorithm are pre-issued by the security management system to the sidecar container of each container group; The interface call request sending module is used to use the verification information as the request header of the interface call request and send the interface call request to the service provider, so that the service provider parses the request header in the interface call request to obtain the verification information and performs security verification on the service requester.
20. An interface call request processing device, characterized in that: The electronic devices corresponding to the sidecar container configured on the service provider side include: The interface call request parsing module is used to receive the interface call request sent by the service request end and parse the interface call request; A verification information acquisition module is used to obtain verification information from the request header of the interface call request; wherein the verification information is generated by encrypting the identification information and security node number of the service request end according to the key and encryption algorithm of the sidecar container of the service request end; The service request end verification module is used to verify the service request end according to the verification information.
21. An interface call request processing device, characterized in that: The electronic devices corresponding to the security policy management center include: A permission configuration information type determination module, used to determine the type of permission configuration information for an interface that needs permission configuration; wherein the type of permission configuration information includes a type of service request end that reflects the permission to call the interface or a type of service request end that reflects the prohibition of calling the interface; A permission configuration information generating module, used to determine the service request end according to the type of the permission configuration information, and generate the permission configuration information according to the interface and the corresponding service request end; A permission configuration information synchronization module is used to synchronize the permission configuration information with the grid server, and the grid server sends the permission configuration information to the sidecar container in each container group, so that the sidecar container parses the request header in the interface call request to obtain verification information, and then processes the interface call request according to the permission configuration information and the verification information; Among them, the verification information is generated by encrypting the identification information and security node number of the service request end by the sidecar container of the service request end according to the key and encryption algorithm; the key and the encryption algorithm are pre-sent to the sidecar container of each container group by the security management system.
22. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the interface call request processing method executed by the sidecar container of the service request end as described in any one of claims 1-6, or implements the interface call request processing method executed by the sidecar container of the service provider end as described in any one of claims 7-12, or implements the interface call request processing method executed by the security policy management center as described in any one of claims 13-18.
23. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer execution instructions, which, when executed by a processor, are used to implement the interface call request processing method executed by the sidecar container of the service request end as described in any one of claims 1-6, or to implement the interface call request processing method executed by the sidecar container of the service provider end as described in any one of claims 7-12, or to implement the interface call request processing method executed by the security policy management center as described in any one of claims 13-18.
24. A computer program product, characterized in that It includes a computer program, which, when executed by a processor, implements the interface call request processing method executed by the sidecar container of the service request end as described in any one of claims 1 to 6, or implements the interface call request processing method executed by the sidecar container of the service provider end as described in any one of claims 7 to 12, or implements the interface call request processing method executed by the security policy management center as described in any one of claims 13 to 18.
Citation Information
Patent Citations
Application program license management system and method
CN113742660A
Transaction method based on block chain, electronic equipment and storage medium
CN116663024A
Key management method and device, storage medium and computer equipment
CN117081839A
Cloud-based identity management and authentication system for containers and applications
US20190349357A1
Methods and systems for securing containerized applications
US20210281548A1
