A method and device for transmitting encrypted traffic mirroring

By offloading encrypted HTTPS traffic in the Nginx server and forming a mirrored traffic data frame, the problem of poor detection of encrypted traffic mirroring in the existing technology is solved, system performance and security are improved, and effective detection of large throughput traffic is achieved. .

CN118509252BActive Publication Date: 2024-09-17国网思极网安科技(北京)有限公司 +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410936183.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-09-17
Estimated Expiration
2044-07-12

AI Technical Summary

Technical Problem

When existing WAF equipment mirrors encrypted traffic through TAP switches, the detection effect of bypass security equipment is poor, and comprehensive security detection cannot be effectively performed.

Method used

Load the software in the Nginx server, unload the encrypted HTTPS traffic into plain text, and temporarily store the TCP quadruple data through the system buffer and cache to form a mirror traffic data frame and send it to the bypass security device to ensure the HTTP layer of the mirror traffic Information is consistent with real traffic.

Benefits of technology

It improves system performance, stability and security, reduces memory usage, enables effective detection of large-throughput encrypted traffic, and enhances the protective effect of bypass security equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118509252B
    Figure CN118509252B
Patent Text Reader

Abstract

The present invention discloses a method and device for outward transmission of encrypted traffic mirroring, which relates to the field of network security technology. The method includes: receiving encrypted traffic of HTTPS request; in the access stage, buffering and storing the header and body of the decrypted HTTPS request to obtain first buffer data; temporarily storing TCP four-tuple data through system cache; in the content stage, buffering and storing the header and body of the HTTPS response, which together with the first buffer data constitute the second buffer data; in the log stage, decomposing the second buffer data into TCP streams to form mirror traffic data frames, and sending the mirror traffic to bypass security equipment. The present invention can achieve high-performance, low-memory consumption, and high-stability bypass plaintext traffic detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network security technology, and in particular to a method and device for outward transmission of encrypted traffic mirroring. Background Art

[0002] Network security devices can protect the network from unauthorized access and attacks, and ensure the confidentiality, integrity and availability of network data. These devices enable users to keep abreast of network status by monitoring network traffic, connections and sessions. Common network security devices include Web Application Firewall WAF, Intrusion Prevention System IPS, Intrusion Detection System IDS, etc. Among them, Web Application Firewall WAF can decrypt traffic data, filter and block network traffic, and ensure that the site can resist malicious users and robot attacks according to rules and policies, block bad traffic, and let good traffic pass.

[0003] In the prior art, WAF devices often use TAP switches to mirror a copy of traffic from the switch to a bypass security device for detection. However, since the mirrored traffic is encrypted at this time, the detection effect of the bypass security device is poor. Summary of the invention

[0004] In view of the above defects or deficiencies in the prior art, the present invention provides a method and device for outbound mirroring of encrypted traffic, which loads the software method of the present invention in the Nginx server to unload the encrypted HTTPS traffic into plain text and convert it into HTTP traffic to achieve outbound mirroring of network traffic, so that the bypass security device can perform comprehensive security detection on the traffic. The present invention simplifies memory usage, ensures real-time reception and transmission, efficiently utilizes resources, greatly improves the performance, stability and security of the system, and is particularly suitable for scenarios where large-throughput encrypted traffic needs to be connected to the bypass security device for detection.

[0005] One aspect of the present invention provides a method for outbound transmission of encrypted traffic mirroring, which is used for an Nginx server. The method comprises the following steps:

[0006] Receive encrypted traffic from HTTPS requests;

[0007] When the HTTPS request processing enters the access stage of the Nginx server, the header and body of the decrypted plaintext traffic of the HTTPS request are buffered and stored in the system buffer to obtain the first buffer data; and the TCP four-tuple data of the HTTPS request is temporarily stored in the system cache until the TCP long connection state ends;

[0008] When the HTTPS request processing enters the content stage of the Nginx server, the header and body of the decrypted plaintext traffic of the HTTPS response are stored in the system buffer, and together with the first buffer data, constitute the second buffer data;

[0009] When the HTTPS request processing enters the log stage of the Nginx server, the second buffered data is decomposed into a TCP stream, an Ethernet header and an IP header are added to the TCP stream to form a mirrored traffic data frame, and the mirrored traffic data frame is sent to the bypass security device through the original socket; wherein the TCP stream is consistent with the TCP layer information of the real traffic, and the HTTP layer information of the mirrored traffic data frame is consistent with the HTTP layer information of the real traffic.

[0010] Furthermore, the TCP layer information of the real traffic includes TCP message header information.

[0011] Furthermore, the HTTP layer information includes the URL, request method, header of the request message, response status code, header of the response message and request body.

[0012] Furthermore, the Nginx server maintains a TCP long connection state with the client during the entire HTTPS session.

[0013] Furthermore, the Nginx server is also used to parse and process HTTP / 2 traffic and ensure that the mirrored HTTP / 2 traffic is consistent with the real traffic.

[0014] Another aspect of the present invention further provides an encrypted traffic mirroring outbound device for use in an Nginx server, the device comprising:

[0015] A receiving module, configured to receive encrypted traffic of HTTPS requests;

[0016] The request buffer module is configured to, when the HTTPS request processing enters the access phase of the Nginx server, store the header and body of the decrypted plaintext traffic of the HTTPS request through the system buffer to obtain the first buffer data; and temporarily store the TCP four-tuple data of the HTTPS request through the system cache until the TCP long connection state ends;

[0017] a response buffer module configured to store the header and body of the decrypted plaintext traffic of the HTTPS response into the system buffer when the HTTPS request processing enters the content phase of the Nginx server, and to form second buffer data together with the first buffer data;

[0018] The mirror traffic outbound module is configured to decompose the second buffered data into a TCP stream when the HTTPS request processing enters the log stage of the Nginx server, add an Ethernet header and an IP header to the TCP stream to form a mirror traffic data frame, and send the mirror traffic data frame to the bypass security device through the original socket; wherein the TCP stream is consistent with the TCP layer information of the real traffic, and the HTTP layer information of the mirror traffic data frame is consistent with the HTTP layer information of the real traffic.

[0019] Furthermore, the TCP layer information of the real traffic includes TCP message header information.

[0020] Furthermore, the HTTP layer information includes URL, request method, request message header, response status code, response message header and request body.

[0021] Furthermore, the Nginx server maintains a long connection state with the client during the entire HTTPS session.

[0022] Furthermore, the Nginx server is also used to parse and process HTTP / 2 traffic and ensure that the mirrored HTTP / 2 traffic is consistent with the real traffic.

[0023] The invention provides a method and device for outward transmission of encrypted traffic mirroring, which has the following beneficial effects:

[0024] (1) Improved network performance. By processing encrypted traffic inside the Nginx server, unnecessary encryption and decryption processes in the network are reduced, improving network performance and throughput. By mirroring plaintext traffic, part of the security detection work can be transferred to the bypass security device, and bypass plaintext traffic detection can be achieved while achieving full-link encryption.

[0025] (2) Save memory consumption and improve processing efficiency. By caching only the TCP session state instead of the entire HTTP request body or response body, memory usage is greatly reduced, ensuring that the system's memory consumption can be kept at a low level, avoiding performance degradation or system crashes caused by insufficient memory; because only the TCP session state is cached, the system can process and send data immediately after receiving it, without waiting for the entire request body or response body to be fully received. The method of receiving and sending at the same time effectively reduces memory consumption and improves the system's response speed and processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0027] Figure 1 It is a system logic diagram of an encrypted traffic mirroring outbound method and device provided by an embodiment of the present application;

[0028] Figure 2 It is a flowchart of a method for outward transmission of encrypted traffic mirroring provided by an embodiment of the present application;

[0029] Figure 3 It is a structural diagram of an encrypted traffic mirroring outbound device provided by an embodiment of the present application;

[0030] Figure 4 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0031] 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. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0032] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.

[0033] It should be understood that although the terms first, second, third, etc. may be used to describe the acquisition modules in the embodiments of the present invention, the acquisition modules should not be limited to these terms. These terms are only used to distinguish the acquisition modules from each other.

[0034] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0035] It should be noted that the directional words such as "upper", "lower", "left", and "right" described in the embodiments of the present invention are described at the angles shown in the drawings and should not be understood as limiting the embodiments of the present invention. In addition, in the context, it should also be understood that when it is mentioned that an element is formed "on" or "under" another element, it can not only be formed directly "on" or "under" another element, but also be formed "on" or "under" another element indirectly through an intermediate element.

[0036] Figure 1 The system logic diagram of the present invention. The system 100 includes a client 101, a DMZ isolation zone 102 and a Web server 103. The DMZ isolation zone 102 includes a load balancing module 1021, a WAF device 1022, an SSL unloading module 1023 and a bypass security device 1024. Among them, the WAF device 1022 is connected in series between the load balancing module 1021 and the SSL unloading module 1023, and the traffic from the client to the WAF device 1022 and the traffic from the WAF device 1022 to the Web server 103 are both encrypted. The Nginx server in the WAF device 1022 loads the software module of the present invention, thereby unloading the encrypted HTTPS traffic into plain text and converting it into HTTP traffic, so as to realize the mirroring of the network traffic and enable the bypass security device to perform comprehensive security detection on the traffic.

[0037] See also Figure 2 Another embodiment of the present invention provides a method for outbound encrypted traffic mirroring, which is used for an Nginx server in a WAF device, and includes the following steps:

[0038] Step S101, receiving encrypted traffic of HTTPS request.

[0039] Specifically, the client sends the encrypted traffic of the HTTPS request to the load balancing module in the DMZ isolation zone, which is then processed by the load balancing module and transmitted to the WAF device. The Nginx server of the WAF device unloads the encrypted HTTPS traffic into plain text.

[0040] Step S102, when the HTTPS request processing enters the access stage to the Nginx server, the header and body of the decrypted plaintext traffic of the HTTPS request are buffered and stored in the system buffer to obtain the first buffer data; and the TCP four-tuple data of the HTTPS request is temporarily stored in the system cache until the TCP long connection state ends.

[0041] Specifically, the process of Nginx processing HTTPS requests, from receiving to processing completion, includes a total of 11 stages, which are:

[0042] Post-read phase: The request has been received and any pre-read data has been processed.

[0043] server-rewrite phase: optional rewriting of the server internal address after matching the server block.

[0044] find-config phase: Determine the requested location.

[0045] Rewrite phase: The requested URI is rewritten again.

[0046] Preaccess phase: operations before access control decisions are made.

[0047] Access stage: Determine whether the request is allowed to continue. User permissions can be set at this stage.

[0048] Post-access phase: operations after the access control decision.

[0049] Try-files phase: Try the file request, and if the file exists, send it to the client.

[0050] Content phase: output response content to the client.

[0051] Log stage: record the request log.

[0052] ssl phase: handles the SSL handshake.

[0053] In this step, when the HTTPS request processing enters the access_phase stage of the Nginx service under the transparent proxy, the Nginx server stores the header and body of the plaintext traffic through the system buffer buffer to obtain the first buffer data; at the same time, the TCP four-tuple data of the HTTPS request is temporarily stored through the system cache cache until the TCP long connection state ends.

[0054] Among them, system buffer and system cache are two completely different concepts. Buffer refers to the buffer zone, and cache refers to the cache. Buffer can be implemented through software settings and memory, and cache is generally a dedicated high-speed cache memory.

[0055] In this step, the buffer is used to cache the header and body of the HTTPS request plaintext traffic. In the following steps, the header and body of the HTTPS response will also be cached. In another stage, the buffered data mirror is sent out. After the data is sent successfully, the data in the buffer is deleted. Although the amount of buffered data is large, the data only exists in the buffer for a short time, so the memory consumption is very small.

[0056] In this step, the system cache is used to temporarily store the TCP four-tuple data of the HTTPS request, that is, the cache temporarily stores the TCP session state. The life cycle of the TCP session state in the cache is the life cycle of the entire TCP long connection, which will span multiple HTTPS requests. Although the life cycle of the cache data is long, the cached TCP session state does not include the complete header (head) and body (body) of the HTTPS request, so the memory usage is very small.

[0057] Step S103, when the HTTPS request processing enters the content stage of the Nginx server, the header and body of the decrypted plaintext traffic of the HTTPS response are stored in the system buffer, and together with the first buffer data, constitute the second buffer data.

[0058] This step is the response processing of the HTTPS request. Specifically, when the Nginx service performs HTTPS response processing, the header and body of the decrypted plaintext traffic of the HTTPS response will also be collected and stored in the system buffer, thereby forming a second buffer data containing the header and body of the HTTPS request and the header and body of the HTTPS response.

[0059] Step S104, when the HTTPS request processing enters the log stage of the Nginx server, the second cache data is decomposed into a TCP stream, an Ethernet header and an IP header are added to the TCP stream to form a mirrored traffic data frame, and the mirrored traffic data frame is sent to the bypass security device through the original socket; wherein the TCP stream is consistent with the TCP layer information of the real traffic, and the HTTP layer information of the mirrored traffic data frame is consistent with the HTTP layer information of the real traffic.

[0060] This step is to decompose and send the buffer data in the system buffer. Specifically, in the log_phase stage after the Nginx service completes the entire HTTPS process, the Nginx service will decompose the previously buffered data into TCP streams, and add Ethernet headers and IP headers to form several mirrored traffic data frames. Then, these mirrored traffic data frames are sent to bypass security devices such as IPS through raw sockets to achieve external text traffic.

[0061] Furthermore, it is necessary to ensure the consistency of real traffic and mirrored traffic, including:

[0062] (1) Ensure IP layer information consistency: During the cache stage of step S102, the Nginx server cache will accurately record the TCP four-tuple metadata of the HTTPS request, including the source IP address and the destination IP address, and ensure that this information will not be modified or lost during subsequent processing and outbound transmission.

[0063] (2) Ensure the consistency of TCP layer information: When the Nginx service converts plaintext traffic into a TCP stream and sends it out, it will maintain the original TCP connection state to ensure that the TCP layer information is consistent with the actual traffic, including the accurate transmission of TCP header information such as sequence number, acknowledgment number, and window size.

[0064] (3) Ensure the consistency of HTTP layer information: By completely collecting the header and body information of the HTTP request and response in the buffer working phase of step S102, and keeping this information unchanged when the mirror is sent out, the HTTP layer information of the mirrored traffic is ensured to be consistent with the real traffic. The HTTP layer information includes the complete transmission of HTTP information such as the URL, request method, request message header, response status code, response message header and request body.

[0065] Furthermore, the Nginx server maintains a persistent connection with the client during the entire HTTPS session, ensuring that the persistent connection is not interrupted, thereby ensuring the consistency of the mirrored traffic and the real traffic. Furthermore, the Nginx server is also used to parse and process HTTP / 2 traffic, and ensure that the mirrored HTTP / 2 traffic is consistent with the real traffic. Since the Nginx service supports client persistent connections and HTTP / 2 protocol processing, it ensures stability and compatibility in different network environments.

[0066] The plaintext mirrored traffic of the encrypted traffic mirroring outbound method of this embodiment is the traffic of the 4-layer TCP protocol, which includes complete HTTP request / HTTP response and TCP session information. It is compatible with bypass security devices and full-flow devices of all manufacturers, and can solve the problem of encrypted traffic detection of bypass security devices.

[0067] This embodiment can bring the following beneficial effects:

[0068] 1. The Nginx service component of the WAF device mirrors a copy of the plaintext traffic to the bypass security device, such as IPS, which can greatly enhance the protection effect of the bypass security device without changing the original network topology.

[0069] 2. Improve system performance

[0070] (1) Reduce encryption and decryption overhead

[0071] By processing encrypted traffic inside the Nginx server, unnecessary encryption and decryption processes in the network are reduced, thereby improving network performance and throughput.

[0072] (2) Improving concurrent processing capabilities

[0073] Utilize the concurrent processing capabilities of the Nginx service to quickly process and send large amounts of traffic.

[0074] (3) Optimizing network load

[0075] By mirroring plaintext traffic, part of the security detection work can be transferred to the bypass security device. While achieving full-link encryption, bypass plaintext traffic detection can also be achieved.

[0076] 3. Improve system stability

[0077] (1) Maintaining connection consistency

[0078] Accurately maintain the client's connection status to ensure that the connection will not be interrupted or reset during the entire session, ensuring the stability and consistency of traffic mirroring.

[0079] (2) Guaranteed protocol compatibility

[0080] It supports client persistent connections and HTTP / 2 protocol processing, ensuring stability and compatibility in different network environments.

[0081] 4. Save memory consumption:

[0082] (1) Reduce memory usage

[0083] By caching only the TCP session state instead of the entire request or response body, memory usage is greatly reduced. This means that even when processing large file upload or download requests, the system's memory consumption can be kept at a low level, avoiding performance degradation or system crashes due to insufficient memory.

[0084] (3) Real-time receiving and sending

[0085] Since only the TCP session state is cached, the system can process and send data immediately when the buffer receives it, without waiting for the entire request or response body to be completely received. This effectively reduces memory consumption and improves the system's response speed and processing efficiency by sending data while the buffer receives it.

[0086] (4) Efficient use of resources

[0087] By streamlining memory usage and real-time processing, the system can more efficiently utilize limited resources, especially in high concurrency and high traffic conditions. This enables the system to better cope with complex network environments and large-scale file transfer requirements, maintaining stability and reliability.

[0088] See also Figure 3 Another embodiment of the present invention further provides an encrypted traffic mirroring external transmission device 200, comprising a receiving module 201, a request buffer module 202, a response buffer module 203, and a mirrored traffic external transmission module 204. The encrypted traffic mirroring external transmission device 200 can execute the encrypted traffic mirroring external transmission method in the above method embodiment.

[0089] Specifically, the encrypted traffic mirroring external transmission device 200 includes:

[0090] The receiving module 201 is configured to receive encrypted traffic of an HTTPS request;

[0091] The request buffer module 202 is configured to, when the HTTPS request processing enters the access phase to the Nginx server, store the header and body of the decrypted plaintext traffic of the HTTPS request through the system buffer to obtain the first buffer data; and temporarily store the TCP four-tuple data of the HTTPS request through the system cache until the TCP long connection state ends;

[0092] The response buffer module 203 is configured to store the header and body of the decrypted plaintext traffic of the HTTPS response into the system buffer when the HTTPS request processing enters the content stage of the Nginx server, and together with the first buffer data, form the second buffer data;

[0093] The mirror traffic outbound module 204 is configured to decompose the second buffered data into a TCP stream when the HTTPS request processing enters the log stage of the Nginx server, add an Ethernet header and an IP header to the TCP stream to form a mirror traffic data frame, and send the mirror traffic data frame to the bypass security device through the original socket; wherein the TCP stream is consistent with the TCP layer information of the real traffic, and the HTTP layer information of the mirror traffic data frame is consistent with the HTTP layer information of the real traffic.

[0094] Furthermore, the TCP layer information of the real traffic includes TCP message header information.

[0095] Furthermore, the HTTP layer information includes URL, request method, request message header, response status code, response message header and request body.

[0096] Furthermore, the Nginx server maintains a long connection state with the client during the entire HTTPS session.

[0097] Furthermore, the Nginx server is also used to parse and process HTTP / 2 traffic and ensure that the mirrored HTTP / 2 traffic is consistent with the real traffic.

[0098] It should be noted that the encrypted traffic mirroring external transmission device 200 provided in this embodiment corresponds to a technical solution that can be used to execute various method embodiments, and its implementation principle and technical effects are similar to the method, which will not be repeated here.

[0099] Figure 4 This is a schematic diagram of the structure of an electronic device 300 provided in another embodiment of the present invention, and the electronic device 300 is used to implement the method for outbound transmission of encrypted traffic mirroring in the method embodiment. The electronic device 300 in the embodiment of the present invention may include but is not limited to a WAF device. Figure 4 The electronic device 300 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0100] like Figure 4 As shown, the electronic device 300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 to a random access memory (RAM) 303 to implement the method of the embodiment of the present invention. In the RAM 303, various programs and data required for the operation of the electronic device 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0101] Typically, the following devices may be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Figure 4 The electronic device 300 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0102] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention also provides a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart, thereby implementing the encrypted traffic mirroring outbound method as described above. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of the embodiment of the present invention are executed.

[0103] The above description is only a preferred embodiment of the present invention. Those skilled in the art should understand that the scope of disclosure involved in the present invention is not limited to the technical solution formed by a specific combination of the above technical features, but also should cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present invention (but not limited to) to form a technical solution.

Claims

1. A method for sending encrypted traffic mirroring, used for Nginx server, characterized in that: include: Receiving encrypted traffic of HTTPS requests, including: the client sends the encrypted traffic of HTTPS requests to the load balancing module in the DMZ isolation zone, and the traffic is processed by the load balancing module and then transmitted to the WAF device. The Nginx server of the WAF device unloads the encrypted HTTPS traffic into plain text; When the HTTPS request processing enters the access stage of the Nginx server, the header and body of the decrypted plaintext traffic of the HTTPS request are buffered and stored in the system buffer to obtain the first buffer data; and the TCP four-tuple data of the HTTPS request is temporarily stored in the system cache until the TCP long connection state ends; When the HTTPS request processing enters the content phase of the Nginx server, the header and body of the decrypted plaintext traffic of the HTTPS response are stored in the system buffer, and together with the first buffer data, constitute the second buffer data; When the HTTPS request processing enters the log stage of the Nginx server, the second buffered data is decomposed into a TCP stream, an Ethernet header and an IP header are added to the TCP stream to form a mirrored traffic data frame, and the mirrored traffic data frame is sent to the bypass security device through the original socket; wherein the TCP stream is consistent with the TCP layer information of the real traffic, and the HTTP layer information of the mirrored traffic data frame is consistent with the HTTP layer information of the real traffic.

2. According to claim 1, a method for outward transmission of encrypted traffic mirroring is characterized in that: The TCP layer information of the real traffic includes TCP message header information.

3. According to claim 1, the method for outward transmission of encrypted traffic mirroring is characterized in that: The HTTP layer information includes URL, request method, header of request message, response status code, header of response message and request body.

4. According to claim 1, a method for outward transmission of encrypted traffic mirroring is characterized in that: The Nginx server maintains a TCP long connection state with the client during the entire HTTPS session.

5. According to claim 1, a method for outward transmission of encrypted traffic mirroring is characterized in that: The Nginx server is also used to parse and process HTTP / 2 traffic and ensure that the mirrored HTTP / 2 traffic is consistent with the real traffic.

6. An encrypted traffic mirror outbound transmission device for the encrypted traffic mirror outbound transmission method of claim 1, used for an Nginx server, characterized in that: include: A receiving module, configured to receive encrypted traffic of HTTPS requests; The request buffer module is configured to, when the HTTPS request processing enters the access phase to the Nginx server, buffer and store the header and body of the decrypted plaintext traffic of the HTTPS request through the system buffer to obtain first buffer data; The TCP four-tuple data of the HTTPS request is temporarily stored in the system cache until the TCP long connection state ends; a response buffer module configured to store the header and body of the decrypted plaintext traffic of the HTTPS response into the system buffer when the HTTPS request processing enters the content phase of the Nginx server, and to form second buffer data together with the first buffer data; The mirror traffic outbound module is configured to decompose the second buffered data into a TCP stream when the HTTPS request processing enters the log stage of the Nginx server, add an Ethernet header and an IP header to the TCP stream to form a mirror traffic data frame, and send the mirror traffic data frame to the bypass security device through the original socket; wherein the TCP stream is consistent with the TCP layer information of the real traffic, and the HTTP layer information of the mirror traffic data frame is consistent with the HTTP layer information of the real traffic.

7. The encrypted traffic mirroring outbound device according to claim 6, characterized in that: The TCP layer information of the real traffic includes TCP message header information.

8. The encrypted traffic mirroring outbound device according to claim 6, characterized in that: The HTTP layer information includes URL, request method, request message header, response status code, response message header and request body.

9. The encrypted traffic mirroring outbound device according to claim 6, characterized in that: The Nginx server maintains a long connection state with the client during the entire HTTPS session.

10. The encrypted traffic mirroring outbound device according to claim 6, characterized in that: The Nginx server is also used to parse and process HTTP / 2 traffic and ensure that the mirrored HTTP / 2 traffic is consistent with the real traffic.