Network security detection method and device for microservice architecture

CN121396574BActive Publication Date: 2026-09-01NO 15 INST OF CHINA ELECTRONICS TECH GRP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511474880.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-15
Publication Date
2026-09-01
Estimated Expiration
2045-10-15

AI Technical Summary

Technical Problem

然而,在微服务架构中,安全威胁的攻击方式日益复杂和多样化,包括容器逃逸、横向渗透、内网攻击、资源滥用等,边界防御如防火墙、入侵检测系统(IDS)等,虽然在阻止外部攻击方面有效,但对微服务内部复杂流量、跨域访问、容器间的动态交互等内部威胁的检测能力较弱

Benefits of technology

[0015]根据本公开的实施例的面向微服务架构的网络安全检测方法及装置,不仅能够识别容器逃逸和横向渗透等复杂攻击,还通过双通道数据采集、动态基线模型和实时流处理技术,实现对内部威胁的实时监控与快速响应。两级响应策略能够确保在不影响整体业务可用性的前提下,迅速处置潜在安全事件,并为后续的取证与分析提供充足的证据支持,在云环境中具有较高的适用性和前瞻性,能够有效提升微服务架构的安全性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121396574B_ABST
    Figure CN121396574B_ABST
Patent Text Reader

Abstract

This disclosure provides a network security detection method and apparatus for microservice architectures. The method includes: collecting communication traffic between virtual machines and network activity trajectories of containers through virtual switch port mirroring and container platform log interfaces, respectively; constructing a dynamic baseline model including a legitimate communication matrix, protocol whitelists, and traffic thresholds; comparing the collected data with the dynamic baseline model using real-time stream processing technology to detect abnormal behavior of containers or virtual machines; and executing different levels of response measures based on the severity of the abnormal behavior threat. This solution can effectively identify and respond to internal attack behaviors such as container escape and lateral movement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments disclosed herein relate to the field of cloud network security, and more specifically, to a network security detection method and apparatus for microservice architecture. Background Technology

[0002] With the rapid development of cloud computing and microservice architectures, more and more enterprises are deploying their applications in cloud environments, leveraging their flexibility and scalability to support rapid business growth. However, while this architecture offers many advantages, it also brings new security challenges. Traditional security measures often focus on perimeter defense, i.e., security monitoring and access control outside the cloud platform. However, in microservice architectures, security threats are becoming increasingly complex and diverse, including container escape, lateral movement, internal network attacks, and resource abuse. Perimeter defenses such as firewalls and intrusion detection systems (IDS), while effective in preventing external attacks, have weaker detection capabilities for internal threats such as complex traffic within microservices, cross-domain access, and dynamic interactions between containers.

[0003] Therefore, a new cloud security solution is needed that can provide more granular and real-time security monitoring, detection, and response mechanisms for complex threats within microservice architectures, especially in identifying lateral movement, container escape, and resource abuse. Summary of the Invention

[0004] The embodiments described herein provide a network security detection method, apparatus, and computer-readable storage medium storing computer programs for microservice architectures, which can promptly identify attack behaviors such as container escape or lateral penetration, and prevent attackers from expanding the attack scope through the internal network.

[0005] According to a first aspect of this disclosure, a network security detection method for microservice architecture is provided, comprising: collecting communication traffic between virtual machines and network activity trajectories of containers through virtual switch port mirroring and container platform log interfaces, respectively; constructing a dynamic baseline model including a legitimate communication matrix, a protocol whitelist, and traffic thresholds; using real-time stream processing technology to compare the collected data with the dynamic baseline model to detect abnormal behavior of containers or virtual machines; and executing different levels of response measures according to the severity of the threat posed by the abnormal behavior.

[0006] In some embodiments of this disclosure, the collection of communication traffic between virtual machines and network activity trajectories of containers through virtual switch port mirroring and container platform log interfaces includes: configuring the port mirroring function of the virtual switch in the virtualization platform, selecting the source port and target port of the virtual machine interface, wherein the target port is used to mirror the communication traffic to the traffic monitoring tool; obtaining network communication data packets between virtual machines based on the target port and adding relevant metadata to the data packets; configuring the container platform log interface, using the container network plugin to track container network activity, obtaining the network activity log of each container in real time, and embedding the container's metadata into the network activity log; and storing the collected virtual machine communication traffic and container network activity logs in a unified database.

[0007] In some embodiments of this disclosure, constructing a dynamic baseline model that includes a legitimate communication matrix, a protocol whitelist, and traffic thresholds includes: collecting information on all devices, virtual machines, and container nodes in the current network; determining the services and applications on each node; determining which devices are legitimate communication pairs; mapping the legitimate communication relationships of each node to a matrix, where each element of the legitimate communication matrix indicates whether communication between two nodes is allowed; determining the allowed protocols and their corresponding port numbers, and constructing them into a protocol whitelist; collecting and analyzing historical traffic data in the network; setting traffic thresholds for each communication pair, each protocol, and each port based on the historical traffic data; and integrating the legitimate communication matrix, the protocol whitelist, and the traffic thresholds into a dynamic baseline model.

[0008] In some embodiments of this disclosure, integrating a legitimate communication matrix, a protocol whitelist, and a traffic threshold into a dynamic baseline model includes: updating the communication relationships in the legitimate communication matrix when a new service or node is added; dynamically updating the protocol whitelist each time a new legitimate protocol is added or an unnecessary protocol is removed; and dynamically adjusting the traffic threshold according to changes in network load and business needs.

[0009] In some embodiments of this disclosure, real-time stream processing technology is used to compare the collected data with a dynamic baseline model to detect abnormal behavior of containers or virtual machines. This includes: using traffic monitoring tools to analyze the traffic patterns of containers and observe whether any containers attempt to connect to other services without authorization; identifying encrypted traffic in network traffic and detecting whether the encrypted traffic of a certain node suddenly increases and is accompanied by a surge in resource usage; and logging authentication requests for remote access services and detecting whether the number of authentication failures within a time window exceeds a preset threshold.

[0010] In some embodiments of this disclosure, the use of real-time stream processing technology to compare the collected data with a dynamic baseline model to detect abnormal behavior of containers or virtual machines further includes: defining and identifying different security domains in the network, and distinguishing access behaviors of different security domains; monitoring and recording traffic across different security domains to detect whether unauthorized users or systems are attempting to access resources in other security domains without appropriate permissions; and detecting the frequency, time, and method of cross-domain access to identify whether abnormal cross-security domain access behavior exists.

[0011] In some embodiments of this disclosure, implementing different levels of response measures based on the severity of the anomalous behavior threat includes: when mild anomalous behavior such as container access to irrelevant services or a surge in resource usage is detected, performing fine-grained network isolation using a network firewall, virtual LAN, or software-defined network; when lateral movement attacks or container escape are detected, suspending the CPU scheduling permissions of virtual machines or containers and preserving their memory state by calling the cloud platform's API.

[0012] In some embodiments of this disclosure, fine-grained network isolation includes isolating only certain network interfaces, ports, or IP addresses, allowing normal business traffic to pass through while cutting off malicious traffic.

[0013] According to a second aspect of this disclosure, a network security detection device for microservice architectures is provided. The device includes at least one processor and at least one memory storing a computer program. When the computer program is executed by the at least one processor, the device causes the following actions: to collect communication traffic between virtual machines and network activity traces of containers via virtual switch port mirroring and container platform log interfaces, respectively; to construct a dynamic baseline model including a legitimate communication matrix, protocol whitelists, and traffic thresholds; to compare the collected data with the dynamic baseline model using real-time stream processing technology to detect abnormal behavior of containers or virtual machines; and to execute different levels of response measures based on the severity of the abnormal behavior threat.

[0014] According to a third aspect of this disclosure, a computer-readable storage medium storing a computer program is provided, wherein the computer program, when executed by a processor, implements the steps of a network security detection method for a microservices architecture according to a first aspect of this disclosure.

[0015] The network security detection method and apparatus for microservice architectures according to embodiments of this disclosure can not only identify complex attacks such as container escape and lateral movement, but also achieve real-time monitoring and rapid response to internal threats through dual-channel data acquisition, dynamic baseline models, and real-time stream processing technology. The two-level response strategy ensures rapid handling of potential security incidents without affecting overall business availability, and provides sufficient evidence for subsequent forensics and analysis. It has high applicability and foresight in cloud environments and can effectively improve the security of microservice architectures. Attached Figure Description

[0016] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings of the embodiments will be briefly described below. It should be understood that the drawings described below only relate to some embodiments of this disclosure and are not intended to limit this disclosure, wherein: Figure 1 An exemplary flowchart illustrating a network security detection method for a microservice architecture according to an embodiment of the present disclosure is shown. Figure 2 This is a schematic block diagram of a network security detection apparatus for a microservices architecture according to embodiments of the present disclosure.

[0017] It should be noted that the elements in the attached diagram are schematic and not drawn to scale. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the described embodiments of this disclosure without creative effort are also within the scope of protection of this disclosure.

[0019] Unless otherwise defined, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which this subject matter pertains. It will be further understood that terms such as those defined in commonly used dictionaries shall be interpreted as having meanings consistent with their meanings in the context of the specification and in the relevant art, and shall not be interpreted in an idealized or overly formal form unless otherwise explicitly defined herein. Furthermore, terms such as “first” and “second” are used only to distinguish one component (or part of a component) from another component (or another part of a component).

[0020] This disclosure proposes a network security detection method for microservice architectures, aiming to effectively identify and respond to internal attacks such as container escape and lateral movement. Through dual-channel data acquisition, dynamic baseline modeling, and real-time stream processing technologies, it can detect various abnormal behaviors in real time and automatically execute different levels of response measures based on the severity of the threat.

[0021] To further illustrate the embodiments of this disclosure, Figure 1 An exemplary flowchart illustrates a network security detection method for a microservices architecture according to embodiments of this disclosure. Figure 1 At frame S102, communication traffic between virtual machines and network activity trajectories of containers are collected through virtual switch port mirroring and container platform log interfaces, respectively.

[0022] To comprehensively monitor network activity in a microservice architecture, network traffic is captured and monitored through two independent channels. Virtual switch port mirroring mirrors traffic between virtual machines to a single monitoring port for capture and analysis without affecting actual network transmission; it simply copies data packets for monitoring in the background. Specifically, the virtual switch port mirroring function is configured in the virtualization platform, specifying the source port (the virtual machine's network interface card) and the destination port (the monitoring port receiving the mirrored traffic). The destination port can be connected to traffic monitoring tools such as Wireshark or tcpdump to mirror traffic to these tools. One-way or two-way traffic mirroring can be selected. One-way traffic mirroring captures inbound or outbound traffic, while two-way traffic mirroring captures both inbound and outbound traffic. The traffic monitoring tool is then started to acquire network communication data packets between virtual machines and add relevant metadata to the packets, including tenant IDs and virtual machine group tags. The final captured data packets contain complete IP headers and transport layer information, such as source address, destination address, protocol type, and additional metadata.

[0023] Container platforms (such as Docker and Kubernetes) can record and retrieve network activity information of containers through logging interfaces. If using Docker, the `docker logs` command can be used to view the standard output and standard error logs of Docker containers. If using Kubernetes, cluster log collection tools such as Fluentd and the ELK Stack can be used to collect container network logs.

[0024] Network plugins, such as the CNI plugin, are used to track the network activity of containers. These plugins provide information such as the IP address, port, and transport protocol for each container. Real-time network activity logs for each container are obtained via the API provided by the container platform. These logs include the container's source IP, destination IP, communication port, protocol type (e.g., TCP, UDP, HTTP), and request / response information. Metadata such as the container's tenant ID, virtual machine group tag, container ID, and network interface information are embedded into the collected container network logs.

[0025] The collected virtual machine communication traffic and container network activity logs are stored uniformly in the database. By attaching metadata such as tenant ID and virtual machine group tags, it can be ensured that each data packet and log entry carries key contextual information, which can be queried and filtered in subsequent analysis based on the metadata.

[0026] Subsequently, in box S104, a dynamic baseline model is constructed that includes a valid communication matrix, a protocol whitelist, and traffic thresholds.

[0027] Dynamic baseline models effectively describe normal network behavior, providing a precise benchmark for subsequent security analysis and helping to quickly identify anomalies and potential security threats. The legitimate communication matrix is ​​a model describing the normal communication relationships between various network components, such as virtual machines, containers, and services. It defines which virtual machines, containers, or services can communicate with each other, which communication paths are permitted, which containers need to communicate through specific ports, and which services can call each other. The legitimate communication relationships of each node can be mapped to a matrix, where each element indicates whether communication between two nodes is permitted; the corresponding position in the matrix is ​​marked as 1 (permitted), and others as 0 (disallowed). By comparing with the legitimate communication matrix, any unauthorized communication behavior can be quickly identified, such as an unauthorized virtual machine attempting to communicate with an unrelated service, or a container attempting to access external services it shouldn't. As the network topology changes, such as the addition of new nodes or changes in services, the communication relationships in the legitimate communication matrix are dynamically updated to adapt to new normal communication patterns.

[0028] A protocol whitelist defines the set of protocols allowed across a network, preventing the spread of non-standard or malicious protocols. It involves identifying allowed protocols and their corresponding port numbers, constructing a whitelist that includes all permitted protocols such as TCP, UDP, HTTP, and DNS, along with their allowed ports for specific applications (e.g., HTTP typically uses port 80, and HTTPS uses port 443). If a protocol is not allowed in the whitelist, its transmission is automatically blocked. Automated tools such as Ansible, Chef, and Puppet can be used to periodically review and update the protocol whitelist. The whitelist can also be dynamically updated each time a new legitimate protocol is added or an unnecessary protocol is removed.

[0029] Traffic thresholds define the range of traffic for normal network activity, including the upper and lower limits of traffic for each virtual machine, container, or service. Historical traffic data in the network can be collected and analyzed, including traffic volume between nodes, traffic share for each protocol, peak traffic, and average traffic. Based on historical traffic data, traffic thresholds can be set for each communication pair, each protocol, and each port. For example, normal traffic between virtual machine A and virtual machine B is 10GB per minute; exceeding this threshold is considered abnormal. By setting reasonable traffic thresholds, abnormal traffic spikes or drops can be quickly detected, which may be signals of malicious activity by attackers. Traffic thresholds can be dynamically adjusted based on network load changes and business needs.

[0030] Integrate legitimate communication matrices, protocol whitelists, and traffic thresholds into a dynamic baseline model. This information can be centrally managed using a network security platform or a custom monitoring system, and the baseline model can be adjusted in real time based on network traffic and behavior.

[0031] In box S106, real-time stream processing technology is used to compare the collected data with a dynamic baseline model to detect abnormal behavior of containers or virtual machines.

[0032] According to one embodiment of this disclosure, real-time monitoring of network traffic through a stream processing platform (such as Apache Kafka, Apache Flink, Apache Storm, etc.) allows for the immediate detection and response to abnormal events. For example, traffic monitoring tools can be used to analyze container traffic patterns to observe whether any containers are attempting to connect to other services without authorization. If a container suddenly attempts to access unrelated service resources or unauthorized network paths, it may indicate an attacker attempting lateral movement or probing attacks. Based on container communication patterns and known legitimate access paths, legitimate communication matrices or traffic monitoring can be used to detect in real-time whether a container is accessing resources inconsistent with its responsibilities. If a container suddenly initiates a connection to a resource not in its service list or makes a large number of accesses to unknown protocols, it can be flagged as suspicious behavior.

[0033] Identify encrypted traffic within network traffic and detect sudden increases in encrypted traffic at a specific node, accompanied by a surge in resource usage. Normal applications or services exhibit stable fluctuations in resource usage under a certain load. If the resource usage of a container or virtual machine suddenly surges, and the traffic characteristics exhibit encrypted traffic (such as SSL / TLS traffic), this could indicate data breaches, cryptocurrency mining, or malicious activity. Real-time traffic analysis can monitor fluctuations in resource usage, such as CPU, memory, and bandwidth, and compare these fluctuations with historical usage patterns to detect any surges in encrypted traffic that deviate from normal patterns. If a traffic surge is accompanied by encrypted traffic, an alert is triggered.

[0034] Lateral movement attacks refer to attackers attempting to further penetrate compromised devices and access other network areas or resources. Common attack behaviors include a surge in SSH / RDP authentication failures and cross-security domain access. Authentication requests for remote access services can be logged to detect if the number of authentication failures within a time window exceeds a preset threshold. A large number of authentication failure attempts occurring within a short period, especially if the IP address or username does not match historical login activity, can be considered abnormal behavior.

[0035] In multi-security-domain networks, attackers often attempt to cross security boundaries to gain more access privileges. By monitoring cross-security-domain traffic and access logs using real-time stream processing technology, unauthorized cross-domain access can be detected through parameters such as access path, source address, and destination address.

[0036] First, define and identify different security domains within the network (e.g., intranet, extranet, DMZ, development environment, production environment, etc.). Differentiate access behaviors across different security domains to identify which nodes or users should access which security domains. Monitor and record traffic crossing different security domains to detect unauthorized users or systems attempting to access resources in other security domains without proper permissions. Detect the frequency, timing, and method of cross-domain access to identify abnormal cross-security domain access behavior. For example, a host frequently accessing the intranet from the DMZ, or a developer accessing the production system outside of working hours. If a device crosses a preset security boundary when accessing resources, trigger an alarm.

[0037] Finally, in box S108, different levels of response measures are implemented according to the severity of the abnormal behavior threat.

[0038] To address threats of varying levels, a two-tiered response mechanism ensures that security in the cloud environment can respond quickly to minor threats as well as handle more severe attacks. The initial response aims to quickly limit the spread of potential threats and reduce the impact of attacks on the system. When mild anomalies such as container access to unrelated services or a surge in resource usage are detected, fine-grained network isolation is performed using network firewalls, virtual LANs, or software-defined networks. This isolation is limited to specific network interfaces, ports, or IP addresses, allowing normal business traffic while blocking malicious traffic. At this point, the node can still operate but cannot communicate with external systems or services. Specifically, affected virtual machines or containers can be isolated from their normal network environment to prevent further impact on other system resources. For example, isolation can be limited to specific network interfaces, ports, or IP addresses, allowing normal business traffic while blocking malicious traffic. Rate limiting of access within containers prevents large-scale data leaks or the spread of malicious behavior. Initial isolation not only reduces risk but also buys time for subsequent in-depth analysis.

[0039] When more serious threats are detected, such as lateral movement attacks or container escape, an advanced response strategy is employed to suspend the CPU scheduling permissions of virtual machines or containers while preserving their memory state. Suspending the CPU scheduling permissions of the relevant virtual machine or container by calling the cloud platform's API is essentially equivalent to "freezing" the virtual machine or container. This means that the virtual machine or container cannot continue to execute any new computing tasks, effectively preventing attackers from continuing to manipulate the target system and limiting further harm. Furthermore, for subsequent forensic analysis, the memory image of the virtual machine or container can be exported and saved via the cloud platform's API. This means that all data in memory, including potential malicious code, attack traces, and other sensitive information, will be preserved. The security team can perform reverse engineering on the memory image to reconstruct the attacker's operational trajectory and discover malware or implanted backdoors.

[0040] This two-tiered response mechanism combines immediate defense with subsequent analysis. It takes primary and advanced response measures based on the severity of the threat. In the primary response, fine-grained network isolation quickly limits the spread of potential attacks without affecting normal business operations. In the advanced response, CPU scheduling privileges are suspended and memory state is preserved instead of shutting down or restarting, reducing interference with normal system operation and providing complete data support for subsequent forensics and analysis.

[0041] Figure 2 This is a schematic block diagram of a network security detection apparatus for a microservices architecture according to embodiments of this disclosure. Figure 2 As shown, the device 200 may include a processor 210 and a memory 220 storing a computer program. When the computer program is executed by the processor 210, the device 200 is made capable of performing actions such as... Figure 1 The steps of the method are shown. In one example, device 200 may be a computer device or a cloud computing node. Device 200 can collect communication traffic between virtual machines and network activity traces of containers through virtual switch port mirroring and container platform log interfaces, respectively; construct a dynamic baseline model including a legitimate communication matrix, protocol whitelists, and traffic thresholds; use real-time stream processing technology to compare the collected data with the dynamic baseline model to detect abnormal behavior of containers or virtual machines; and execute different levels of response measures according to the severity of the abnormal behavior threat.

[0042] In the embodiments of this disclosure, the device 200 can configure the port mirroring function of the virtual switch in the virtualization platform, select the source port and target port of the virtual machine interface, and use the target port to mirror the communication traffic to the traffic monitoring tool; obtain network communication data packets between virtual machines based on the target port, and add relevant metadata to the data packets; configure the log interface of the container platform, use the container network plugin to track container network activities, obtain the network activity log of each container in real time, and embed the container's metadata into the network activity log; and store the collected virtual machine communication traffic and container network activity logs in a unified database.

[0043] In the embodiments of this disclosure, the apparatus 200 can collect information on all devices, virtual machines, and container nodes in the current network, determine the services and applications on each node, and determine which devices are legitimate communication pairs; map the legitimate communication relationships of each node into a matrix, where each element of the legitimate communication matrix indicates whether communication between two nodes is allowed; determine the allowed protocols and their corresponding port numbers, and construct a protocol whitelist; collect and analyze historical traffic data in the network, and set traffic thresholds for each communication pair, each protocol, and each port based on the historical traffic data; and integrate the legitimate communication matrix, the protocol whitelist, and the traffic thresholds into a dynamic baseline model.

[0044] In embodiments of this disclosure, the device 200 can update the communication relationships in the legitimate communication matrix when adding new services or nodes; dynamically update the protocol whitelist each time a new legitimate protocol is added or an unnecessary protocol is removed; and dynamically adjust the traffic threshold according to network load changes and business needs.

[0045] In embodiments of this disclosure, the device 200 can use traffic monitoring tools to analyze the traffic patterns of containers, observe whether any containers attempt to connect to other services without authorization; identify encrypted traffic in network traffic, detect whether the encrypted traffic of a certain node suddenly increases and is accompanied by a surge in resource usage; log authentication requests for remote access services, and detect whether the number of authentication failures within a time window exceeds a preset threshold.

[0046] In embodiments of this disclosure, the device 200 can define and identify different security domains in the network, distinguish access behaviors of different security domains, monitor and record traffic across different security domains, detect whether unauthorized users or systems attempt to access resources in other security domains without proper permissions, and detect the frequency, time and method of cross-domain access to identify whether there are abnormal access behaviors across security domains.

[0047] In embodiments of this disclosure, the device 200 can perform fine-grained network isolation using a network firewall, virtual LAN, or software-defined network when it detects mild abnormal behavior such as container access to irrelevant services or a surge in resource usage; when it detects lateral movement attacks or container escape, it can suspend the CPU scheduling permissions of virtual machines or containers and preserve their memory state by calling the cloud platform's API.

[0048] In embodiments of this disclosure, processor 210 may be, for example, a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a processor based on a multi-core processor architecture, etc. Memory 220 may be any type of memory implemented using data storage technologies, including but not limited to random access memory, read-only memory, semiconductor-based memory, flash memory, disk storage, etc.

[0049] Furthermore, in embodiments of this disclosure, device 200 may also include input device 230, such as a keyboard, mouse, etc. Additionally, device 200 may also include output device 240, such as a display, etc.

[0050] In other embodiments of this disclosure, a computer-readable storage medium storing a computer program is also provided, wherein the computer program, when executed by a processor, is capable of performing the following functions: Figure 1 The steps of the network security detection method for microservice architecture are shown.

[0051] In summary, the network security detection method and apparatus for microservice architectures according to the embodiments of this disclosure can not only identify complex attacks such as container escape and lateral movement, but also achieve real-time monitoring and rapid response to internal threats through dual-channel data acquisition, dynamic baseline models, and real-time stream processing technologies. The two-level response strategy ensures rapid handling of potential security incidents without affecting overall business availability and provides sufficient evidence for subsequent forensics and analysis. It has high applicability and foresight in cloud environments and can effectively improve the security of microservice architectures.

[0052] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatuses and methods according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0053] Unless otherwise expressly indicated by the context, the singular form of words used herein and in the appended claims includes the plural form, and vice versa. Thus, when referring to the singular, the plural form of the corresponding term is generally included. Similarly, the terms “comprising” and “including” shall be interpreted as including rather than exclusively. Likewise, the terms “including” and “or” shall be interpreted as including unless such interpretation is expressly prohibited herein. Where the term “example” is used herein, particularly when it follows a set of terms, “example” is merely exemplary and illustrative and should not be considered exclusive or extensive.

[0054] Further aspects and scope of adaptation become apparent from the description provided herein. It should be understood that various aspects of this application may be implemented individually or in combination with one or more other aspects. It should also be understood that the descriptions and specific embodiments herein are for illustrative purposes only and are not intended to limit the scope of this application.

[0055] Several embodiments of this disclosure have been described in detail above. However, it is obvious that those skilled in the art can make various modifications and variations to the embodiments of this disclosure without departing from the spirit and scope of this disclosure. The scope of protection of this disclosure is defined by the appended claims.

Claims

1. A network security detection method for microservice architecture, characterized in that, include: The communication traffic between virtual machines and the network activity trajectory of containers are collected through virtual switch port mirroring and container platform log interfaces, respectively. Construct a dynamic baseline model that includes a legitimate communication matrix, a protocol whitelist, and traffic thresholds; Real-time stream processing technology is used to compare the collected data with the dynamic baseline model to detect abnormal behavior of containers or virtual machines. This includes: analyzing container traffic patterns using traffic monitoring tools to observe whether any containers attempt to connect to other services without authorization; identifying encrypted traffic in network traffic and detecting whether there is a sudden increase in encrypted traffic at a node, accompanied by a surge in resource usage; logging authentication requests for remote access services and detecting whether the number of authentication failures within a time window exceeds a preset threshold; defining and identifying different security domains in the network and distinguishing access behavior between different security domains; monitoring and recording traffic across different security domains to detect whether unauthorized users or systems attempt to access resources in other security domains without proper permissions; detecting the frequency, time, and method of cross-domain access to identify abnormal cross-security domain access behavior; and... Depending on the severity of the anomalous behavior threat, different levels of response measures will be implemented, including: when mild anomalous behavior such as container access to irrelevant services or a surge in resource usage is detected, fine-grained network isolation will be performed using network firewalls, virtual LANs, or software-defined networks; when lateral movement attacks or container escape are detected, the CPU scheduling permissions of virtual machines or containers will be suspended and the memory state will be preserved by calling the cloud platform's API.

2. The network security detection method for microservice architecture according to claim 1, characterized in that, The collection of communication traffic between virtual machines and network activity trajectories of containers through virtual switch port mirroring and container platform log interfaces includes: Configure the port mirroring function of the virtual switch in the virtualization platform, select the source port and destination port of the virtual machine interface, and the destination port is used to mirror the communication traffic to the traffic monitoring tool; Based on the target port, obtain network communication data packets between virtual machines and add relevant metadata to the data packets; Configure the container platform's logging interface, use the container network plugin to track container network activity, obtain network activity logs for each container in real time, and embed the container's metadata into the network activity logs; and The collected virtual machine communication traffic and container network activity logs are stored uniformly in the database.

3. The network security detection method for microservice architecture according to claim 1, characterized in that, The construction of the dynamic baseline model, which includes a legitimate communication matrix, a protocol whitelist, and traffic thresholds, includes: Collect information on all devices, virtual machines, and container nodes in the current network, determine the services and applications on each node, and identify which devices are legitimate communication pairs; Map the legal communication relationships of each node to a matrix, where each element of the legal communication matrix indicates whether communication is allowed between two nodes; Determine the allowed protocols and their corresponding port numbers, and build them into a protocol whitelist; Collect and analyze historical traffic data in the network, and set traffic thresholds for each communication pair, each protocol, and each port based on the historical traffic data; and The legitimate communication matrix, protocol whitelist, and traffic threshold are integrated into a dynamic baseline model.

4. The network security detection method for microservice architecture according to claim 3, characterized in that, The integration of the legitimate communication matrix, protocol whitelist, and traffic threshold into a dynamic baseline model includes: When a new service or node is added, the communication relationships in the valid communication matrix are updated; The protocol whitelist is dynamically updated each time a new legitimate protocol is added or an unnecessary protocol is removed; and The traffic threshold is dynamically adjusted based on network load changes and business needs.

5. The network security detection method for microservice architecture according to claim 1, characterized in that, The fine-grained network isolation includes isolating only certain network interfaces, ports, or IP addresses, allowing normal business traffic to pass through while cutting off malicious traffic.

6. A network security detection device for microservice architecture, characterized in that, The device includes: At least one processor; and At least one memory storing a computer program; When the computer program is executed by the at least one processor, the apparatus performs the steps of the network security detection method for microservice architecture according to any one of claims 1 to 5.

7. A computer-readable storage medium storing a computer program, characterized in that, The computer program, when executed by a processor, implements the steps of the network security detection method for microservice architecture according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Container cloud safety protection method and system constructed on basis of Kubernetes

    CN109347814A

  • Network security active defense method and system for detecting abnormal network behaviors

    CN119628910A