HTTP message transparent security processing system and method supporting local cryptographic machine
By introducing kernel interception module and password service middleware into the HTTP message processing system, the local password machine is called for transparent and secure processing of HTTP messages, the problem of inability to effectively use the local password machine in the existing technology is solved, and business applications are not required to be changed It can realize the secure delivery of HTTP messages, reducing development costs.
Patent Information
- Application Number
- CN202411046973.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2044-08-01
AI Technical Summary
The prior art cannot effectively call the local cipher machine to implement the secure processing of HTTP messages, resulting in insufficient support for HTTPS in non-commercial cipher algorithms, increasing the complexity of business code and development costs.
A transparent and secure processing system for HTTP messages that support local password machines is designed. Through the kernel interception module and HTTP proxy service module on the client and server side, the password service middleware is used to call the local password machine for encryption and decryption processing of HTTP messages, realizing transparency. safe handling.
It realizes the interception and processing of HTTP messages in a completely transparent way for business applications, reduces development costs, and solves the problem of insufficient support for HTTPS in non-commercial password algorithms.
Smart Images

Figure CN118573481B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software design and development, and more specifically to a HTTP message transparent security processing system and method supporting a local cipher machine. Background Art
[0002] At present, the secure processing of HTTP messages is generally achieved through the HTTPS protocol. HTTPS is a network protocol that can perform encrypted transmission and identity authentication, which is constructed by HTTP plus the TLS / SSL protocol. It mainly uses digital certificates, encryption algorithms, asymmetric keys and other technologies to complete HTTP data transmission encryption and achieve HTTP data transmission security protection. HTTPS mainly consists of two parts: HTTP+SSL / TLS, which means that a layer of module for processing encrypted information is added to HTTP. Before transmitting information, the server and the client will negotiate a session key, and the HTTP message data transmitted afterwards will be encrypted based on the session key.
[0003] The interception of HTTP messages can generally be achieved by using filters defined in the J2EE specification. Filters are part of the J2EE standard specification, and all Java Web applications support Filters. Similar to Servlets, Filters are also Web application components that can be bound to a Web application. However, unlike other Web application components, Filters have a chain call relationship in the container. They start executing before the Servlet processor. When an external Http request message arrives, it first passes through the Filter chain and is passed to the Servlet after processing. The opposite is true for response messages, so that the Filter can monitor and modify request / response messages. Another benefit of the Filter is that the Web application does not need to recompile the code, and only a simple configuration is required to load the Filter.
[0004] In order to solve the problem of secure transmission of HTTP messages, the industry currently often replaces the HTTP protocol with the HTTPS protocol. This technical implementation is simple and widely used, but there is an obvious defect that HTTPS has poor support for non-commercial cryptographic algorithms and cannot be integrated conveniently and friendly. Especially in specific projects, the application server is often equipped with a local cryptographic machine (or local cryptographic module), and HTTP message security processing often requires calling the local cryptographic machine, and the cryptographic algorithms in the cryptographic machine are also non-commercial cryptographic algorithms. At this time, HTTPS seems a bit powerless.
[0005] In addition, since it is impossible to call the local cipher machine through HTTPS to implement HTTP security processing, in most cases, in a typical J2EE project, a filter is often explicitly declared in the business, and the local cipher machine is manually called in the filter to perform security processing on the body content in the HTTP message. A large amount of code that is irrelevant to the business itself is added to the business code, greatly increasing the complexity of the business code.
[0006] Therefore, there is an urgent need to provide a security processing system that supports a local cryptographic machine, which can call the local cryptographic machine to perform security processing on intercepted HTTP messages, and can intercept HTTP messages sent and received by business applications in a completely transparent manner to the business applications. Summary of the invention
[0007] In view of this, the present invention provides a transparent and secure HTTP message processing system and method that supports a local cryptographic machine, which at least solves some of the above-mentioned technical problems. By using the present invention, on the one hand, it is possible to implement secure processing of intercepted HTTP messages by calling a local cryptographic machine, and on the other hand, it is possible to implement interception of HTTP messages sent and received by business applications in a manner that is completely transparent to the business applications.
[0008] To achieve the above object, the technical solution adopted by the present invention is:
[0009] In a first aspect, the present invention provides an HTTP message transparent security processing system supporting a local cryptographic machine, comprising: a client and a server, wherein the client and the server both comprise: a kernel interception module, an HTTP proxy service module and a cryptographic service middleware; the HTTP proxy service module comprises: an HTTP message processing module and a security processing component; wherein:
[0010] In the client, the kernel interception module is used to intercept HTTP messages, and redirect HTTP messages to the HTTP proxy service module according to the interception strategy; the HTTP proxy service module receives HTTP messages, wherein the HTTP message processing module is used to extract HTTP plaintext messages, and call the security processing component to perform security processing on the HTTP plaintext messages, the security processing interface is provided by the cryptographic service middleware, and the cryptographic service middleware calls the local cryptographic machine to implement the cryptographic algorithm processing logic; after the HTTP plaintext message is processed, HTTP ciphertext is formed, and the HTTP proxy service module sends the HTTP ciphertext, and the kernel interception module intercepts the message again, and according to the interception strategy, the HTTP ciphertext is sent to the server through the network;
[0011] On the server side, the kernel interception module is used to intercept HTTP ciphertext, and redirect the HTTP ciphertext to the HTTP proxy service module according to the interception strategy; the HTTP proxy service module receives the HTTP ciphertext, wherein the HTTP message processing module is used to extract the HTTP ciphertext message, and call the security processing component to perform security processing on the HTTP ciphertext message, the security processing interface is provided by the cryptographic service middleware, and the cryptographic service middleware calls the local cryptographic machine to implement the cryptographic algorithm processing logic; after the HTTP ciphertext message is processed, HTTP plaintext is formed, the HTTP proxy service module sends the HTTP plaintext, and the kernel interception module intercepts the message again, and according to the interception strategy, the HTTP plaintext is sent to the server.
[0012] Preferably, in the system, HTTP messages are transmitted via TCP connections, and on the client side, the interception strategy of the core interception module is: intercept all TCP data packets sent by the local machine whose source port number is in a preset interval and whose destination port number is a first preset port, and redirect these data packets to a second preset port.
[0013] Preferably, at the server end, the interception strategy of the core interception module is: intercept all TCP data packets received by the local machine whose destination port number is the first preset port, and redirect these data packets to the second preset port.
[0014] Preferably, the kernel interception module intercepts and redirects the corresponding data packets of the TCP connection ultimately used by the HTTP message; the TCP connection between the client and the server is intercepted and tampered with to form three TCP connections, namely, the connection between the client and the client agent, the connection between the client agent and the server agent, and the connection between the server agent and the server; the HTTP message reaches the server from the client through the above three connections in sequence.
[0015] Preferably, the interception process of the kernel interception module is divided into three stages, specifically:
[0016] 1) Connection between client and client proxy: The client initiates a TCP connection request to the server. The kernel interception module intercepts the data packet and redirects it to the client proxy. The client proxy receives the TCP connection request and completes the three-way handshake to establish a TCP connection with the client.
[0017] 2) Connection between the client proxy and the server proxy: After the client proxy establishes a connection with the client, it extracts the server information from the received HTTP message and then sends a TCP connection request to the server. The server kernel interception module intercepts the TCP connection request and redirects it to the server proxy. The server proxy receives the TCP connection request and completes the three-way handshake to establish a TCP connection with the client proxy.
[0018] 3) Connection between the server-side proxy and the server: After the server-side proxy establishes a connection with the client-side proxy, it extracts the server information from the received HTTP message, and then sends a TCP connection request to the server, and the server establishes a TCP connection with the server-side proxy.
[0019] Preferably, the cryptographic service middleware integrates the local cryptographic machine in a plug-in form, and the upper layer of the interface library of different cryptographic machines introduces adapter plug-ins. Each adapter plug-in follows a unified cryptographic service interface SPI and is dynamically integrated into the cryptographic service middleware through configuration.
[0020] In a second aspect, the present invention further provides a method for transparently and securely processing HTTP messages supporting a local cryptographic machine, using the above-mentioned HTTP message transparently and securely processing system supporting a local cryptographic machine to perform transparently and securely processing HTTP messages, the method comprising:
[0021] On the client side, HTTP messages are intercepted by the kernel interception module, and the HTTP messages are redirected to the HTTP proxy service module according to the interception strategy; the HTTP proxy service module receives the HTTP message, extracts the HTTP plaintext message through the HTTP message processing module, and calls the security processing component to perform security processing on the HTTP plaintext message. The security processing interface is provided by the cryptographic service middleware, and the cryptographic algorithm processing logic is implemented by calling the local cryptographic machine through the cryptographic service middleware; after the HTTP plaintext message is processed, the HTTP ciphertext is formed, and the HTTP proxy service module sends the HTTP ciphertext. The kernel interception module intercepts the message again, and according to the interception strategy, the HTTP ciphertext is sent to the server through the network;
[0022] On the server side, HTTP ciphertext is intercepted by the kernel interception module, and the HTTP ciphertext is redirected to the HTTP proxy service module according to the interception strategy; the HTTP proxy service module receives the HTTP ciphertext, extracts the HTTP ciphertext message through the HTTP message processing module, and calls the security processing component to perform security processing on the HTTP ciphertext message. The security processing interface is provided by the cryptographic service middleware, and the cryptographic algorithm processing logic is implemented by calling the local cryptographic machine through the cryptographic service middleware; after the HTTP ciphertext message is processed, HTTP plaintext is formed, and the HTTP proxy service module sends the HTTP plaintext. The kernel interception module intercepts the message again, and according to the interception strategy, the HTTP plaintext is sent to the server.
[0023] Compared with the prior art, the present invention has at least the following beneficial technical effects:
[0024] 1. The present invention discloses a transparent and secure HTTP message processing system and method that supports a local cryptographic machine. The security processing component in the present invention combined with the cryptographic service middleware can realize secure processing of HTTP messages by calling a local cryptographic machine, thereby solving the problem that the prior art cannot call a local cryptographic machine to perform secure processing of HTTP messages.
[0025] 2. The present invention can be used to intercept HTTP messages sent and received by business applications in a completely transparent manner; the HTTP proxy module in the present invention intercepts HTTP messages in a kernel manner and performs secure processing on HTTP messages, which completely achieves the secure transmission of HTTP messages without any modification to the application. This allows the application to only focus on its own business functions without having to put too much energy into how to ensure the secure transmission of HTTP messages, thereby reducing development costs.
[0026] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0027] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0029] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0030] Figure 1 A schematic diagram of the overall framework of an HTTP message transparent security processing system supporting a local cryptographic machine provided in an embodiment of the present invention.
[0031] Figure 2 A schematic diagram of the HTTP message interception processing flow provided by an embodiment of the present invention.
[0032] Figure 3 A schematic diagram of the HTTP message security processing flow provided by an embodiment of the present invention.
[0033] Figure 4 A schematic diagram of the principle of integrating and adapting a local cryptographic machine in a plug-in form provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations. In addition, various serial numbers, etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0035] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0036] See also Figure 1 As shown, the embodiment of the present invention provides a HTTP message transparent security processing system supporting a local cryptographic machine, including: a client and a server; at the client and server, the framework of the HTTP message transparent security processing system is generally divided into three modules: a kernel interception module, an HTTP proxy service module, and a cryptographic service middleware, and the HTTP proxy service module further includes two components: an HTTP message processing module and a security processing component. Figure 1As shown in the figure, a service consumer (client) initiates an HTTP call. The HTTP message passes through the HTTP message transparent security processing framework to form HTTP ciphertext and is sent to the service provider (server) through the network. The HTTP message transparent security processing system framework of the service provider (server) restores the HTTP ciphertext to HTTP plaintext and submits it to the service provider instance.
[0037] Combination Figure 1 As shown, the specific working principle of a HTTP message transparent security processing system supporting a local cryptographic machine of the present invention is described in detail below:
[0038] 1. The overall process of transparent and secure processing of HTTP messages:
[0039] (1) Service consumer side:
[0040] ①. The service consumer (SC) instance on the service consumer side initiates an HTTP call to the service provider (SP) instance on the service provider side;
[0041] ②. The HTTP message sent by SC is intercepted by the kernel interception module on this server. According to the interception strategy, the HTTP message is redirected to the HTTP proxy service;
[0042] ③. The HTTP proxy service receives the HTTP message, the HTTP message processing module extracts the HTTP plaintext message, and then calls the security processing component;
[0043] ④. The security processing component performs security processing such as data encryption and signing on HTTP messages. During the security processing, the data encryption and signing interfaces are supported by the cryptographic service middleware, which calls the local cryptographic machine to implement the real cryptographic algorithm processing logic;
[0044] ⑤. After the HTTP message is processed, HTTP ciphertext is formed. The HTTP proxy service sends the HTTP ciphertext, and the kernel interception module intercepts the message again. According to the interception strategy, the HTTP ciphertext is released and sent to the service provider through the network.
[0045] (2) Service provider side:
[0046] ①. When HTTP ciphertext reaches the service provider, it is first intercepted by the kernel interception module. According to the interception strategy, the HTTP ciphertext is redirected to the HTTP proxy service;
[0047] ②. The HTTP proxy service receives the HTTP message, the HTTP message processing module extracts the HTTP ciphertext, and then calls the security processing component;
[0048] ③. The security processing component performs security processing such as decryption and signature verification on HTTP messages. During the security processing process, interfaces such as data decryption and signature verification are supported by the cryptographic service middleware, and the cryptographic service middleware calls the local cryptographic machine to implement the real cryptographic algorithm processing logic.
[0049] ④. After the HTTP message is processed, HTTP plain text is formed. The HTTP proxy sends the HTTP plain text, and the kernel interception module intercepts the message again. According to the interception strategy, the HTTP plain text is sent to the service instance SP of this server.
[0050] In the embodiment of the present invention, after processing the HTTP request, the SP returns an HTTP response message. The security processing flow of the HTTP response message is similar to that of the HTTP request message, and this process will not be repeated here.
[0051] 2. HTTP message interception and processing transparent to business applications:
[0052] (I) Interception strategy configuration:
[0053] In the embodiment of the present invention, before the encryption process is performed, the policy configuration interface of the kernel interception module must first be started to configure the interception policy information. The interception policy information is divided into client policy information and server policy information. A host can be used only as a client or only as a server, or as both a client and a server. When a host is used as both a client and a server, it should be noted that the configured client proxy port number and server proxy port number must be different. The client policy information and the server policy information are described below.
[0054] In the embodiment of the present invention, the specific content of the client policy information may be as follows:
[0055] xml.client.agentport=8888;
[0056] xml.client.dstport.list.count=1;
[0057] xml.client.sportrange=20000:61000;
[0058] xml.client.dstport.list.1=8008;
[0059] The above client policy information is described as follows:
[0060] 1) xml.client.agentport=8888, indicating that the port number of the client's HTTP agent is 8888;
[0061] 2) xml.client.dstport.list.count=1, which means that the client only intercepts data packets with a destination port number of a certain value sent by the local machine. If this value is configured as 2, it means that the client only intercepts data packets with a destination port number of two values sent by the local machine. These two values are specified by xml.client.dstport.list.1 and xml.client.dstport.list.2 respectively.
[0062] 3) xml.client.sportrange=20000:61000, which means that the client only intercepts packets with source port range of 20000-61000 from the local machine, and allows packets with source port range outside this range (even if the destination port number is the value specified by xml.client.dstport.list.x);
[0063] 4) xml.client.dstport.list.1=8008, which means that the client intercepts the data packets sent by the local machine with the destination port number of 8008 and the source port number in the range specified by the xml.client.sportrange configuration item.
[0064] In the embodiment of the present invention, the overall meaning of the configuration information is to intercept all TCP data packets with source port numbers between 20000-61000 and destination port number 8008 sent by the local machine, and redirect these data packets to port 8888 of the local machine.
[0065] The specific content of the server-side policy information can be as follows:
[0066] xml.server.agentport=8888;
[0067] xml.server.dstport.list.count=1;
[0068] xml.server.dstport.list.1=8008;
[0069] The above server-side policy information is described in detail as follows:
[0070] 1) xml.server.agentport=8888, indicating that the port number of the HTTP agent on the server side is 8888;
[0071] 2) xml.server.dstport.list.count=1, which means that the server only intercepts the data packets with a certain destination port number received by the local machine. If this value is configured as 2, it means that the client only intercepts the data packets with two destination port numbers received by the local machine. These two values are specified by xml.server.dstport.list.1 and xml.server.dstport.list.2 respectively.
[0072] 3) xml.server.dstport.list.1=8008, which means that the server intercepts the data packets with the destination port number of 8008 received by the local machine.
[0073] In the embodiment of the present invention, the overall meaning of the configuration information is to intercept all TCP data packets with the destination port number 8008 received by the local machine, and redirect these data packets to the 8888 port of the local machine.
[0074] (II) HTTP message interception process:
[0075] In the embodiment of the present invention, HTTP data packets are transmitted via TCP connections. Therefore, in the Netfilter framework of the operating system, the corresponding data packets of the TCP connection ultimately used by the HTTP message are intercepted and redirected, so that the HTTP message can be transparently intercepted and redirected. The transparent interception and processing of the HTTP message is mainly achieved by transparently intercepting the TCP connection used for the transmission of the HTTP message. The original TCP connection between the client and the server is intercepted and tampered to form three TCP connections, namely, the connection between the client and the client agent, the connection between the client agent and the server agent, and the connection between the server agent and the server. The HTTP message reaches the server from the client through the above three connections in sequence. The HTTP message can be encrypted and decrypted on the client agent and the server agent, but from the client's point of view, it is directly communicating with the server, so the transparent interception of the HTTP message is achieved.
[0076] The HTTP message interception process is as follows Figure 2 The following takes the example of the service consumer (client) port 8080 on 192.168.19.22 requesting service from the service provider (server) port 8008 on 192.168.19.33 as an example for detailed explanation.
[0077] HTTP message interception processing is mainly divided into three stages:
[0078] 1) Connection between client and client proxy: The client (192.168.19.22:8080) initiates a TCP connection request to the server (192.168.19.33:8008). The kernel interception module intercepts the data packet and redirects it to the client proxy service (192.168.19.22:8888). The client proxy receives the TCP connection request and completes the three-way handshake to establish a TCP connection with the client. During this process, the kernel interception module modifies both the IP message sent by the client and the IP message sent by the client proxy to the client, so that the client sees that the TCP connection it has just established is a connection established with the server, but in fact the connection is a connection established between the client and the client proxy. Therefore, the interception is transparent to the client.
[0079] 2) Connection between the client proxy and the server proxy: After the client proxy establishes a connection with the client, it extracts the server information from the received HTTP message and then sends a TCP connection request to the server (at this time, the source port number is greater than 61000, and the client kernel interception module will allow it). The server kernel interception module intercepts the TCP connection request and redirects it to the server proxy (192.168.19.33:8888). The server proxy receives the TCP connection request and completes the three-way handshake to establish a TCP connection with the client proxy. In this process, because the server kernel interception module modifies the IP message sent by the client proxy and the IP message sent by the server proxy to the client proxy, the client proxy may see that the TCP connection it has just established is a connection established with the server, but in fact the connection is a connection established between the client proxy and the server proxy server.
[0080] 3) Connection between the server-side proxy and the server: After the server-side proxy establishes a connection with the client-side proxy, it extracts the server information from the received HTTP message and then sends a TCP connection request to the server. The server establishes a TCP connection with the server-side proxy.
[0081] 3. HTTP message security processing:
[0082] In the embodiment of the present invention, the HTTP proxy service module includes an HTTP message processing module and a security processing component. The HTTP message processing module extracts the HTTP plain text message sent by the kernel interception module, and then calls the security processing component; the security processing component calls the cryptographic service middleware to perform security processing such as data encryption and signature on the HTTP message to obtain the HTTP ciphertext message.
[0083] The present invention implements HTTP message encryption, signature and other security processing through security processing components to process HTTP plain text messages. First, the HTTP message processing module receives the HTTP message, and then the Handler processor calls the cryptographic service middleware to perform security processing such as encryption and signature on the HTTP message. After obtaining the HTTP message ciphertext, it is sent to the memory interception module; the HTTP message security processing process is as follows: Figure 3 shown.
[0084] 4. Integrate and adapt the local cipher machine in the form of plug-ins:
[0085] In an embodiment of the present invention, taking into account the differences in the cryptographic service interfaces provided by different models of local cryptographic machines, and in order to make the system framework have good scalability, a cryptographic service middleware is introduced into the HTTP message security processing system framework. The cryptographic service middleware integrates the local cryptographic machine in a plug-in form, and adapter plug-ins are introduced into the upper layer of the interface library of different cryptographic machines. Each adapter plug-in follows a unified cryptographic service interface SPI and is dynamically integrated into the cryptographic service middleware through configuration.
[0086] See also Figure 4 As shown, the cryptographic service middleware provides a unified cryptographic service interface API and SPI to the upper-layer HTTP message security processing component. The API is responsible for providing a unified cryptographic service interface to the upper layer (HTTP message security processing component), and the SPI is responsible for providing a unified cryptographic service interface to the lower layer (adapter plug-in). In order to facilitate unified processing, the API and SPI in the present invention adopt the same set of interface specifications. The definition of the interface specification is completely designed based on the requirements of the upper-layer business application for cryptographic services and has nothing to do with the specific cryptographic equipment at the bottom layer.
[0087]
[0088] Table 1 above lists some main interface names and descriptions in the interface specification. For different cryptographic machines, the present invention develops corresponding adapter plug-ins, which follow the specification of the unified cryptographic service interface SPI, integrate the interface library provided by the adapter cryptographic machine, and then integrate into the framework according to the plug-in integration specification of the cryptographic service middleware. The plug-in integration framework dynamically loads and calls the specified adapter plug-in according to the configuration file information.
[0089] From the description of the above embodiments, those skilled in the art can know that the present invention provides a HTTP message transparent security processing system supporting a local cryptographic machine, which has the following advantages:
[0090] 1. Provides a HTTP message security processing framework that can integrate a local cryptographic machine; The present invention designs a HTTP message transparent security processing system framework. The security processing components in the system combined with the cryptographic service middleware can realize the secure processing of HTTP messages by calling the local cryptographic machine. The cryptographic service middleware also adopts the plug-in concept to realize the integration of different local cryptographic machines, which solves the need to integrate local cryptographic machines to realize HTTP message security processing in some specified projects.
[0091] 2. Greatly reduces the development cost of business applications to implement secure processing of HTTP messages: The HTTP proxy module in the system framework of the present invention intercepts HTTP messages in a kernel manner and performs secure processing on HTTP messages, which completely achieves secure transmission of HTTP messages without any modification to the application. This allows the application to only focus on its own business functions without having to put too much energy into how to ensure the secure transmission of HTTP messages, greatly reducing development costs.
[0092] Furthermore, an embodiment of the present invention also provides a method for transparently and securely processing HTTP messages supporting a local cryptographic machine, which uses a system for transparently and securely processing HTTP messages supporting a local cryptographic machine in the above embodiment to perform transparently and securely processing HTTP messages, and the method includes:
[0093] On the client side, HTTP messages are intercepted by the kernel interception module, and the HTTP messages are redirected to the HTTP proxy service module according to the interception strategy; the HTTP proxy service module receives the HTTP message, extracts the HTTP plaintext message through the HTTP message processing module, and calls the security processing component to perform security processing on the HTTP plaintext message. The security processing interface is provided by the cryptographic service middleware, and the cryptographic algorithm processing logic is implemented by calling the local cryptographic machine through the cryptographic service middleware; after the HTTP plaintext message is processed, the HTTP ciphertext is formed, and the HTTP proxy service module sends the HTTP ciphertext. The kernel interception module intercepts the message again, and according to the interception strategy, the HTTP ciphertext is sent to the server through the network;
[0094] On the server side, HTTP ciphertext is intercepted by the kernel interception module, and the HTTP ciphertext is redirected to the HTTP proxy service module according to the interception strategy; the HTTP proxy service module receives the HTTP ciphertext, extracts the HTTP ciphertext message through the HTTP message processing module, and calls the security processing component to perform security processing on the HTTP ciphertext message. The security processing interface is provided by the cryptographic service middleware, and the cryptographic algorithm processing logic is implemented by calling the local cryptographic machine through the cryptographic service middleware; after the HTTP ciphertext message is processed, HTTP plaintext is formed, and the HTTP proxy service module sends the HTTP plaintext. The kernel interception module intercepts the message again, and according to the interception strategy, the HTTP plaintext is sent to the server.
[0095] The embodiment of the present invention provides a method for transparent and secure processing of HTTP messages that supports a local cryptographic machine. Its implementation principle and the technical effects produced are the same as those of the aforementioned system embodiment. For the sake of brief description, for parts not mentioned in this embodiment, reference can be made to the corresponding contents in the aforementioned system embodiment, which will not be repeated here.
[0096] In addition, an embodiment of the present invention also provides a storage medium on which one or more programs readable by a computing device are stored, and the one or more programs include instructions. When the instructions are executed by the computing device, the computing device executes a method for transparent and secure processing of HTTP messages that supports a local cryptographic machine in the above-mentioned embodiment.
[0097] Examples of computer-readable storage media include: read-only memory (ROM), random-access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random-access memory (RAM), dynamic random-access memory (DRAM), static random-access memory (SRAM), flash memory, non-volatile memory, CD-ROM, DVD-ROM, Blu-ray or optical disk storage, hard disk drive (HDD), solid-state drive (SSD), card-type memory (such as a multimedia card, a secure digital (SD) card, or an extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid-state disk, and any other device configured to store a computer program and any associated data, data files, and data structures in a non-transitory manner and provide the computer program and any associated data, data files, and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be executed in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files, and data structures are distributed on a networked computer system, so that the computer program and any associated data, data files, and data structures are stored, accessed, and executed in a distributed manner by one or more processors or computers.
[0098] It should be understood by those skilled in the art that embodiments of the present invention may be provided as systems, methods or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0099] It should be noted that the word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention can be implemented by means of hardware comprising several distinct components, and by means of a suitably programmed computer.
[0100] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0101] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A HTTP message transparent security processing system supporting a local cryptographic machine, comprising: The client and server are characterized in that the client and server both include: a kernel interception module, an HTTP proxy service module and a cryptographic service middleware; the HTTP proxy service module includes: an HTTP message processing module and a security processing component; wherein: In the client, the kernel interception module is used to intercept HTTP messages, and redirect HTTP messages to the HTTP proxy service module according to the interception strategy; the HTTP proxy service module receives HTTP messages, wherein the HTTP message processing module is used to extract HTTP plaintext messages, and call the security processing component to perform security processing on the HTTP plaintext messages, the security processing interface is provided by the cryptographic service middleware, and the cryptographic service middleware calls the local cryptographic machine to implement the cryptographic algorithm processing logic; after the HTTP plaintext message is processed, HTTP ciphertext is formed, and the HTTP proxy service module sends the HTTP ciphertext, and the kernel interception module intercepts the message again, and according to the interception strategy, the HTTP ciphertext is sent to the server through the network; On the server side, the kernel interception module is used to intercept HTTP ciphertext, and redirect the HTTP ciphertext to the HTTP proxy service module according to the interception strategy; the HTTP proxy service module receives the HTTP ciphertext, wherein the HTTP message processing module is used to extract the HTTP ciphertext message, and call the security processing component to perform security processing on the HTTP ciphertext message, the security processing interface is provided by the cryptographic service middleware, and the cryptographic service middleware calls the local cryptographic machine to implement the cryptographic algorithm processing logic; after the HTTP ciphertext message is processed, the HTTP plaintext is formed, the HTTP proxy service module sends the HTTP plaintext, and the kernel interception module intercepts the message again, and according to the interception strategy, the HTTP plaintext is sent to the server; The interception process of the kernel interception module is divided into three stages, specifically: 1) Connection between client and client proxy: The client initiates a TCP connection request to the server. The kernel interception module intercepts the data packet and redirects it to the client proxy. The client proxy receives the TCP connection request and completes the three-way handshake to establish a TCP connection with the client. 2) Connection between the client proxy and the server proxy: After the client proxy establishes a connection with the client, it extracts the server information from the received HTTP message and then sends a TCP connection request to the server. The server kernel interception module intercepts the TCP connection request and redirects it to the server proxy. The server proxy receives the TCP connection request and completes the three-way handshake to establish a TCP connection with the client proxy. 3) Connection between the server-side proxy and the server: After the server-side proxy establishes a connection with the client-side proxy, it extracts the server information from the received HTTP message, and then sends a TCP connection request to the server, and the server establishes a TCP connection with the server-side proxy.
2. According to claim 1, a HTTP message transparent security processing system supporting a local cryptographic machine is characterized in that: In this system, HTTP messages are transmitted via TCP connections. On the client side, the kernel interception module has an interception strategy of intercepting all TCP packets sent by the local machine whose source port number is within a preset interval and whose destination port number is a first preset port, and redirecting these packets to a second preset port.
3. The HTTP message transparent security processing system supporting local cryptographic machine according to claim 2 is characterized in that: On the server side, the interception strategy of the kernel interception module is: intercept all TCP data packets received by the local machine whose destination port number is the first preset port, and redirect these data packets to the second preset port.
4. The HTTP message transparent security processing system supporting local cryptographic machine according to claim 3 is characterized in that: The kernel interception module intercepts and redirects the corresponding data packets of the TCP connection that the HTTP message finally uses; The TCP connection between the client and the server is intercepted and tampered to form three TCP connections, namely the connection between the client and the client proxy, the connection between the client proxy and the server proxy, and the connection between the server proxy and the server. HTTP messages go from the client to the server through the above three connections in sequence.
5. The HTTP message transparent security processing system supporting local cryptographic machine according to claim 1 is characterized in that: The cryptographic service middleware integrates local cryptographic machines in a plug-in form, and adapter plug-ins are introduced into the upper layer of the interface library of different cryptographic machines. Each adapter plug-in follows a unified cryptographic service interface SPI and is dynamically integrated into the cryptographic service middleware through configuration.
6. A method for transparent and secure processing of HTTP messages supporting a local cryptographic machine, characterized in that: Using the HTTP message transparent and secure processing system supporting a local cryptographic machine as claimed in claim 1, HTTP message transparent and secure processing is performed, the method comprising: On the client side, HTTP messages are intercepted by the kernel interception module, and the HTTP messages are redirected to the HTTP proxy service module according to the interception strategy; the HTTP proxy service module receives the HTTP message, extracts the HTTP plaintext message through the HTTP message processing module, and calls the security processing component to perform security processing on the HTTP plaintext message. The security processing interface is provided by the cryptographic service middleware, and the cryptographic algorithm processing logic is implemented by calling the local cryptographic machine through the cryptographic service middleware; after the HTTP plaintext message is processed, the HTTP ciphertext is formed, and the HTTP proxy service module sends the HTTP ciphertext. The kernel interception module intercepts the message again, and according to the interception strategy, the HTTP ciphertext is sent to the server through the network; On the server side, HTTP ciphertext is intercepted by the kernel interception module, and the HTTP ciphertext is redirected to the HTTP proxy service module according to the interception strategy; the HTTP proxy service module receives the HTTP ciphertext, extracts the HTTP ciphertext message through the HTTP message processing module, and calls the security processing component to perform security processing on the HTTP ciphertext message. The security processing interface is provided by the cryptographic service middleware, and the cryptographic algorithm processing logic is implemented by calling the local cryptographic machine through the cryptographic service middleware; after the HTTP ciphertext message is processed, HTTP plaintext is formed, and the HTTP proxy service module sends the HTTP plaintext. The kernel interception module intercepts the message again, and according to the interception strategy, the HTTP plaintext is sent to the server.
7. A method for transparent and secure processing of HTTP messages supporting a local cryptographic machine according to claim 6, characterized in that: HTTP messages are transmitted via TCP connections. In the client, the kernel interception module has an interception strategy of: intercepting all TCP packets sent by the local machine whose source port number is in a preset interval and whose destination port number is a first preset port, and redirecting these packets to a second preset port.
8. A method for transparent and secure processing of HTTP messages supporting a local cryptographic machine according to claim 7, characterized in that: On the server side, the interception strategy of the kernel interception module is: intercept all TCP data packets received by the local machine whose destination port number is the first preset port, and redirect these data packets to the second preset port.
9. A method for transparent and secure processing of HTTP messages supporting a local cryptographic machine according to claim 8, characterized in that: The kernel interception module intercepts and redirects the corresponding data packets of the TCP connection that the HTTP message finally uses; The TCP connection between the client and the server is intercepted and tampered to form three TCP connections, namely the connection between the client and the client proxy, the connection between the client proxy and the server proxy, and the connection between the server proxy and the server. HTTP messages go from the client to the server through the above three connections in sequence.
