Attack risk container management method and device, equipment and storage medium
By building a multi-level defense system and real-time analysis and isolation of container environments, the problem of container security in cloud computing is solved that it is difficult to deal with dynamic changes, and efficient security threat response and vulnerability detection are achieved, reducing the risk of attack proliferation.
Patent Information
- Application Number
- CN202411153862.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-11-12
AI Technical Summary
Security issues of container environment in cloud computing Due to the resource sharing between containers, traditional static security protection measures are difficult to cope with dynamic changes and complexity, resulting in a high risk of attack spread.
By building a multi-level defense system, obtain the minimum network permissions of each container, analyze the operation data and log data in real time, scan for vulnerabilities regularly, use lightweight network probes, Logstash, OpenVAS and other tools to identify abnormal behaviors and vulnerabilities, and perform isolation and patches. Strategy.
It improves the system's response speed and accurate monitoring of security threats, reduces the risk of pollution proliferation, and enhances the security performance of containers.
Smart Images

Figure CN118944949A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud computing technology, and in particular to a method, device, equipment and storage medium for managing an attack risk container. Background Art
[0002] Currently, the security of container environments is a difficult problem in cloud computing technology. Due to the resource sharing characteristics of containers, once a container is invaded, the attacker may exploit the vulnerabilities between containers to spread rapidly, thus posing a serious threat to the entire system. Containers usually use traditional static security protection measures, such as firewall configuration and permission settings, but traditional protection facilities are difficult to effectively cope with the dynamic changes and complexity of container environments.
[0003] It can be seen that the existing technology still needs to be improved and enhanced. Summary of the invention
[0004] In order to overcome the shortcomings of the prior art, the purpose of the present invention is to provide a method, device, equipment and storage medium for managing attacked risk containers, which construct a multi-level defense system to identify and isolate infected containers in real time, thereby improving the system's response speed to security threats and monitoring accuracy.
[0005] The first aspect of the present invention provides a method for managing containers at risk of being attacked, including: obtaining the minimum network permissions of each container, and performing network configuration on the corresponding container based on the minimum network permissions to obtain a configured container; obtaining the operating data of each configured container in real time, and performing data analysis on the operating data through a preset behavior analysis model to obtain a behavior analysis result; obtaining the log data of each configured container, and performing structural analysis on the log data to obtain an abnormal analysis result; performing security scanning processing on each configured container according to a preset period to obtain a vulnerability scanning result; performing data analysis on the behavior analysis result, the abnormal analysis result and the vulnerability scanning result respectively, and executing feedback actions according to the analysis results.
[0006] Optionally, in a first implementation method of the first aspect of the present invention, obtaining the minimum network permissions of each container and performing network configuration on the corresponding container based on the minimum network permissions to obtain a configured container includes: creating corresponding network environment data for each container based on Linux network namespace technology; optimizing the access granularity in the network environment data using a CNI network plug-in; obtaining the minimum network permissions of each container, and granting the minimum permission set required for the optimized network environment data based on SELinux security policy and minimum network permissions to obtain a configured container.
[0007] Optionally, in a second implementation method of the first aspect of the present invention, the real-time acquisition of operating data of each configuration container and the performance of data analysis on the operating data through a preset behavior analysis model to obtain a behavior analysis result include: real-time collection of operating data of each configuration container based on a lightweight network probe; the operating data includes operating status data and behavior pattern data; performing anomaly analysis on the operating data based on an anomaly detection algorithm to obtain a deviation result; constructing a behavior analysis model based on a clustering analysis model, and using the behavior analysis model to perform behavior analysis on the behavior pattern data to obtain a pattern result; and generating a behavior analysis result based on a deviation result and a set of pattern results.
[0008] Optionally, in a third implementation method of the first aspect of the present invention, the real-time collection of operation data of each configuration container based on a lightweight network probe includes: using a lightweight network probe to collect behavior pattern data of each configuration container in real time; obtaining process status data of the container from the proc file system, and capturing corresponding system call data from the configuration container based on an audit mechanism; obtaining network traffic data of the configuration container using a tcpdump packet capture tool; and generating operation data based on the behavior pattern data, process status data, system call data, and network traffic data.
[0009] Optionally, in a fourth implementation of the first aspect of the present invention, the log data of each configuration container is obtained, and the log data is structurally parsed to obtain an exception parsing result, including: obtaining corresponding log data from each configuration container according to a preset time; performing structured processing and analysis on the log data based on a Logstash parsing tool to obtain parsed data; performing an exception analysis on the parsed data based on a sequence pattern mining algorithm to identify specific sequence patterns of malicious activities and generate an exception parsing result.
[0010] Optionally, in a fifth implementation of the first aspect of the present invention, the security scanning processing is performed on each configuration container according to a preset period to obtain a vulnerability scanning result, including: obtaining a scanning path for each configuration container and a corresponding image configuration container; building a security vulnerability comparison library based on the CVE database; within a preset period, using the OpenVAS vulnerability scanning tool to perform a security scan on the scanning path to obtain a scanning result; and comparing the scanning result with the security vulnerability comparison library to obtain a vulnerability scanning result.
[0011] Optionally, in a sixth implementation of the first aspect of the present invention, data analysis is performed on the behavior analysis results, the exception parsing results, and the vulnerability scanning results respectively, and feedback actions are performed according to the analysis results, including: performing a deviation analysis on the behavior analysis results based on a preset normal behavior model. If data points that deviate from the normal mode appear, it is judged that the corresponding configuration container is at risk of infection, and the configuration container is isolated through cgroup technology; performing a risk analysis on the exception parsing results based on a preset normal network traffic model and audit logs and rule comparison information. If there is an abnormal network request sequence or an illegal system call chain, it is judged that the corresponding configuration container is at risk of infection, and the network configuration of the corresponding configuration container is modified through the container orchestration tool; performing vulnerability detection on the vulnerability scanning results. If there are security vulnerabilities in the vulnerability scanning results, the corresponding patch strategy is obtained from the Kubernetes platform through an API call.
[0012] The second aspect of the present invention provides an attack risk container management device, including: a configuration module, which is used to obtain the minimum network permissions of each container, and perform network configuration on the corresponding container based on the minimum network permissions to obtain a configured container; an analysis module, which is used to obtain the operation data of each configured container in real time, and perform data analysis on the operation data through a preset behavior analysis model to obtain a behavior analysis result; a parsing module, which is used to obtain the log data of each configured container, and perform structural analysis on the log data to obtain an abnormal analysis result; a scanning module, which is used to perform security scanning processing on each configuration container according to a preset period to obtain a vulnerability scanning result; a feedback module, which is used to perform data analysis on the behavior analysis result, the abnormal analysis result and the vulnerability scanning result respectively, and execute feedback actions according to the analysis result.
[0013] Optionally, in a first implementation method of the second aspect of the present invention, the configuration module includes: a creation unit, used to create corresponding network environment data for each container based on Linux network namespace technology; a granularity unit, used to optimize the access granularity in the network environment data using a CNI network plug-in; a granting unit, used to obtain the minimum network permissions of each container, and grant the minimum permission set required for the optimized network environment data based on SELinux security policy and minimum network permissions to obtain a configuration container.
[0014] Optionally, in a second implementation of the second aspect of the present invention, the analysis module includes: a collection unit, which is used to collect the operation data of each configuration container in real time based on a lightweight network probe; the operation data includes operation status data and behavior pattern data; a deviation unit, which is used to perform anomaly analysis on the operation data based on an anomaly detection algorithm to obtain a deviation result; a pattern unit, which is used to construct a behavior analysis model based on a clustering analysis model, and use the behavior analysis model to perform behavior analysis on the behavior pattern data to obtain a pattern result; a behavior unit, which is used to generate a behavior analysis result based on the deviation result and the pattern result set.
[0015] Optionally, in a third implementation of the second aspect of the present invention, the collection unit includes: a probe unit, which is used to use a lightweight network probe to collect behavior pattern data of each configuration container in real time; a capture unit, which is used to obtain process status data of the container from the proc file system, and capture corresponding system call data from the configuration container based on the audit mechanism; an acquisition unit, which is used to obtain network traffic data of the configuration container using a tcpdump packet capture tool; and a generation unit, which is used to generate operation data based on the behavior pattern data, process status data, system call data and network traffic data.
[0016] Optionally, in a fourth implementation of the second aspect of the present invention, the parsing module includes: a log unit, used to obtain corresponding log data from each configuration container according to a preset time; a parsing unit, used to perform structured processing and analysis on the log data based on a Logstash parsing tool to obtain parsed data; and an exception unit, used to perform exception analysis on the parsed data based on a sequence pattern mining algorithm to identify specific sequence patterns of malicious activities and generate exception parsing results.
[0017] Optionally, in a fifth implementation of the second aspect of the present invention, the scanning module includes: a path unit, used to obtain the scanning path of each configuration container and the corresponding image configuration container; a construction unit, used to build a security vulnerability comparison library based on the CVE database; a scanning unit, used to perform a security scan on the scanning path using the OpenVAS vulnerability scanning tool within a preset period to obtain a scanning result; and a comparison unit, used to compare the scanning result with the security vulnerability comparison library to obtain a vulnerability scanning result.
[0018] Optionally, in a sixth implementation of the second aspect of the present invention, the feedback module includes: a deviation unit, which is used to perform a deviation analysis on the behavior analysis results based on a preset normal behavior model. If a data point deviating from the normal mode appears, it is judged that the corresponding configuration container is at risk of infection, and the configuration container is isolated through cgroup technology; a risk unit, which is used to perform a risk analysis on the abnormal analysis results based on a preset normal network traffic model and audit logs and rule comparison information. If there is an abnormal network request sequence or an illegal system call chain, it is judged that the corresponding configuration container is at risk of infection, and the network configuration of the corresponding configuration container is modified through a container orchestration tool; a vulnerability unit, which is used to perform vulnerability detection on the vulnerability scanning results. If there are security vulnerabilities in the vulnerability scanning results, the corresponding patch strategy is obtained from the Kubernetes platform through an API call.
[0019] The third aspect of the present invention provides an attacked risk container management device, which includes: a memory and at least one processor, wherein the memory stores instructions; at least one of the processors calls the instructions in the memory to enable the attacked risk container management device to perform each step of the attacked risk container management method described in any one of the above items.
[0020] A fourth aspect of the present invention provides a computer-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the steps of any of the above-mentioned methods for managing attack risk containers are implemented.
[0021] In the technical solution of the present invention, an independent network configuration is created for each container to achieve network isolation between containers, and the network configuration is set using the minimum network permission to ensure that the container always runs under the minimum permission, thereby reducing the risk of permission abuse; by analyzing the operation data and log data of the configuration container to determine whether the configuration container has an infection risk, the system can isolate the infected configuration container in time to avoid the problem of contamination spread; and by regularly scanning for vulnerabilities, the risk of infection of the configuration container is effectively reduced, thereby improving the security performance of the configuration container. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A first flow chart of the method for managing an attack risk container provided by an embodiment of the present invention;
[0023] Figure 2 A second flow chart of the method for managing an attack risk container provided by an embodiment of the present invention;
[0024] Figure 3 A third flow chart of the method for managing an attack risk container provided by an embodiment of the present invention;
[0025] Figure 4 A fourth flow chart of the method for managing an attack risk container provided by an embodiment of the present invention;
[0026] Figure 5 A fifth flow chart of the method for managing an attack risk container provided by an embodiment of the present invention;
[0027] Figure 6 A sixth flow chart of the method for managing an attack risk container provided by an embodiment of the present invention;
[0028] Figure 7 A seventh flow chart of the method for managing an attack risk container provided by an embodiment of the present invention;
[0029] Figure 8 A schematic diagram of the structure of a device for managing an attack risk container provided by an embodiment of the present invention;
[0030] Fig. 9 Another structural schematic diagram of the attack risk container management device provided by an embodiment of the present invention;
[0031] Fig.10 A schematic diagram of the structure of an attack risk container management device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The present invention provides a method, device, equipment and storage medium for managing containers at risk of attack. The present invention creates an independent network configuration for each container to achieve network isolation between containers, and uses the minimum network permission to set the network configuration to ensure that the container always runs under the minimum permission, thereby reducing the risk of permission abuse; by analyzing the operation data and log data of the configuration container to determine whether the configuration container has an infection risk, the system can isolate the infected configuration container in time to avoid the problem of contamination spread; and by regularly scanning for vulnerabilities, the risk of infection of the configuration container is effectively reduced, thereby improving the security performance of the configuration container.
[0033] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 An embodiment of the method for managing an attack risk container in an embodiment of the present invention includes:
[0035] 101. Obtain the minimum network permission of each container, and perform network configuration on the corresponding container based on the minimum network permission to obtain a configuration container;
[0036] In this embodiment, an independent network configuration is created for each container (i.e., setting the network interface, IP address, routing table, etc.) to achieve network isolation between containers, and setting the network configuration according to the minimum network permissions can ensure that the container always runs under the minimum permissions, and only grants the minimum set of permissions required to perform the task, thereby reducing the risk of permission abuse.
[0037] 102. Obtaining the operation data of each configuration container in real time, and performing data analysis on the operation data through a preset behavior analysis model to obtain a behavior analysis result;
[0038] 103. Obtain log data of each configuration container, and perform structural analysis on the log data to obtain an abnormal analysis result;
[0039] 104. Perform security scanning on each configuration container according to a preset period to obtain vulnerability scanning results;
[0040] 105. Perform data analysis on the behavior analysis results, anomaly analysis results and vulnerability scanning results respectively, and perform feedback actions according to the analysis results.
[0041] In this embodiment, the operation data is analyzed based on a preset behavior analysis model to identify whether the configuration container has data points that deviate from the normal mode. Based on the behavior analysis results, the system can adopt an adaptive isolation policy adjustment mechanism to perform isolation operations on the infected configuration container, limit its resource usage and network access, and avoid the problem of pollution spread; the log data of the structured configuration container is used to capture whether the configuration container has attack behavior (such as abnormal network request sequence, illegal system call chain, etc.). If the abnormal analysis result shows that there is an attack behavior, the corresponding response mechanism is immediately triggered to achieve isolation of the configuration container by modifying the network configuration and resource restrictions of the configuration container, and push an alarm to the administrator; in addition, each configuration container is regularly scanned for security to detect whether there are security vulnerabilities in each configuration container. For the vulnerabilities found, the system can obtain the latest security patches and software updates from the official software source to achieve seamless deployment of patches.
[0042] In the embodiment of the present invention, an independent network configuration is created for each container to achieve network isolation between containers, and the network configuration is set using the minimum network permission to ensure that the container always runs under the minimum permission, thereby reducing the risk of permission abuse; by analyzing the operation data and log data of the configuration container to determine whether the configuration container has an infection risk, the system can isolate the infected configuration container in time to avoid the problem of contamination spread; and by regularly scanning for vulnerabilities, the risk of infection of the configuration container is effectively reduced, thereby improving the security performance of the configuration container.
[0043] See also Figure 2 The second embodiment of the method for managing an attack risk container in the embodiment of the present invention includes:
[0044] 201. Create corresponding network environment data for each container based on Linux network namespace technology;
[0045] 202. Use CNI network plug-ins to optimize the access granularity in network environment data;
[0046] 203. Obtain the minimum network permissions of each container, and grant the minimum permission set required for the optimized network environment data based on the SELinux security policy and the minimum network permissions to obtain the configuration container.
[0047] In this embodiment, network configuration is a key part to ensure communication and security between containers. First, Linux network namespace technology is used to create independent network environment data for each container. This technology allows each container to have its own network stack, including network interface, routing table and IP address, etc., so as to achieve network isolation and ensure that communication between containers does not interfere with each other.
[0048] Secondly, use the CNI (Container Network Interface) network plug-in to optimize the access granularity in the network environment data. The CNI plug-in provides a set of standard interfaces that enable the container to dynamically add network configuration when it starts and clean up network resources when it stops. The CNI plug-in can flexibly configure the network for the container, including bridging, VLAN, Overlay network, etc., while ensuring the portability and scalability of the network configuration.
[0049] Finally, in order to further enhance the network security of containers, the minimum network permissions of each container can be obtained, and the minimum permission set required for the optimized network environment data can be granted based on the SELinux (Security-Enhanced Linux) security policy and minimum network permissions. SELinux defines detailed permission rules for processes and files in the system through the mandatory access control (MAC) mechanism, thereby providing stricter access control than traditional DAC (Discretionary Access Control). In this way, it can be ensured that each container only obtains the network permissions required for its operation, effectively preventing potential security threats and ensuring the security and stability of the container network environment;
[0050] By combining Linux network namespaces, CNI network plug-ins, and SELinux security policies, an isolated and secure network configuration solution is provided for the container environment, meeting the strict requirements of modern cloud-native applications for the network environment.
[0051] See also Figure 3 A third embodiment of the method for managing an attack risk container in an embodiment of the present invention includes:
[0052] 301. Based on a lightweight network probe, collect the operation data of each configuration container in real time; the operation data includes operation status data and behavior pattern data;
[0053] 302. Perform anomaly analysis on the operating data based on anomaly detection algorithm to obtain deviation results;
[0054] In this embodiment, the operation data of the configuration container is first collected in real time based on a lightweight network probe. The efficiency of collecting the operation data can be improved by using the lightweight network probe. Then, a model with normal behavior is established to construct the configuration model based on anomaly detection algorithm to identify data points in the operation data that deviate from the normal pattern, and the data points are regarded as abnormal behaviors (i.e., deviation results).
[0055] 303. Construct a behavior analysis model based on the cluster analysis model, and use the behavior analysis model to perform behavior analysis on the behavior pattern data to obtain a pattern result;
[0056] 304. Generate a behavior analysis result based on the deviation result and the pattern result set.
[0057] In this embodiment, cluster analysis will construct a behavior analysis model, through which behavior pattern data can be classified, and similar behavior patterns can be classified into one category to determine whether the configuration model has abnormal behavior, so as to facilitate the detection of whether each configuration model has suspected infection problems.
[0058] See also Figure 4 The fourth embodiment of the method for managing an attack risk container in the embodiment of the present invention includes:
[0059] 401. Use lightweight network probes to collect behavior pattern data of each configuration container in real time;
[0060] 402. Obtain the process status data of the container from the proc file system, and capture the corresponding system call data from the configuration container based on the audit mechanism;
[0061] 403. Use the tcpdump packet capture tool to obtain the network traffic data of the configuration container;
[0062] 404. Generate operation data based on the behavior pattern data, process status data, system call data and network flow data.
[0063] In this embodiment, by using a lightweight network probe to collect the behavior pattern data of each configuration container in real time, the operating status of the container can be effectively monitored and abnormal behavior can be discovered in time. Obtaining the process status data of the container from the proc file system and capturing the corresponding system call data from the configuration container based on the audit mechanism helps to deeply understand the operating mechanism and security status inside the container. Using the tcpdump packet capture tool to obtain the network traffic data of the configuration container, the network communication mode of the container can be analyzed to prevent potential network attacks. Generating operation data based on behavior pattern data, process status data, system call data and network traffic data can provide an important basis for performance optimization and fault diagnosis of the container, and improve the stability and security of the system.
[0064] See also Figure 5 The fifth embodiment of the method for managing an attack risk container in the embodiment of the present invention includes:
[0065] 501. Obtain corresponding log data from each configuration container according to a preset time;
[0066] 502. Perform structured processing and analysis on log data based on the Logstash parsing tool to obtain parsed data;
[0067] 503. Perform anomaly analysis on parsed data based on a sequence pattern mining algorithm to identify specific sequence patterns of malicious activities and generate anomaly parsing results.
[0068] In this embodiment, the corresponding log data is obtained from each configuration container according to the preset time, which can realize the automatic collection of logs, improve work efficiency, and ensure the timeliness and integrity of log data. The use of Logstash parsing tool to structure the log data for processing and analysis can convert unstructured log data into a structured data format, which is convenient for subsequent data processing and analysis, and improves the readability and availability of data. Anomaly analysis of parsed data based on sequence pattern mining algorithm helps to identify specific sequence patterns of malicious activities, so as to timely discover and respond to security threats and ensure the safe and stable operation of the system. Through these steps, the system status can be effectively monitored, potential security risks can be prevented, and business continuity and data security can be ensured.
[0069] See also Figure 6 The sixth embodiment of the method for managing an attack risk container in the embodiment of the present invention includes:
[0070] 601. Obtain a scan path of each configuration container and a corresponding image configuration container;
[0071] 602. Build a security vulnerability comparison library based on the CVE database;
[0072] 603. Within a preset period, use the OpenVAS vulnerability scanning tool to perform security scanning on the scanning path to obtain scanning results;
[0073] 604. Compare the scan result with the security vulnerability comparison library to obtain the vulnerability scan result.
[0074] In this embodiment, the system periodically starts a vulnerability scanning tool, and uses the CVE database to build a security vulnerability comparison library to facilitate comparison and inspection of potential security vulnerabilities. Once a vulnerability is found, a priority-based patch strategy is adopted to repair high-risk vulnerabilities first, ensuring that the security of the system is always kept up to date.
[0075] See also Figure 7 The seventh embodiment of the method for managing an attack risk container in the embodiment of the present invention includes:
[0076] 701. Perform deviation analysis on the behavior analysis results based on the preset normal behavior model. If data points deviating from the normal mode appear, it is determined that the corresponding configuration container has an infection risk, and the configuration container is isolated through cgroup technology;
[0077] In this embodiment, the deviation analysis of the behavior analysis results based on the preset normal behavior model can effectively identify abnormal behaviors in the system or network, so as to timely discover potential security threats. When it is detected that the data point deviates from the normal mode, it can be quickly determined that the corresponding configuration container may be at risk of infection. By using cgroup technology to isolate these configuration containers and limit their resource usage and network access, potential threats can be prevented from spreading to the entire system, ensuring the security and stability of the system. This active defense mechanism helps to reduce the occurrence of security incidents and improve the overall security of the system.
[0078] 702. Perform risk analysis on the abnormal analysis results based on the preset normal network traffic model, audit logs, and rule comparison information. If there is an abnormal network request sequence or an illegal system call chain, it is determined that the corresponding configuration container has an infection risk, and the network configuration of the corresponding configuration container is modified through the container orchestration tool;
[0079] In this embodiment, by establishing a normal network traffic model, comparing the actual network requests in the abnormal analysis results, the abnormal target address, port and protocol are identified. For the detection of illegal system calls in the abnormal analysis results, the audit log of the system kernel and the rule comparison information are matched to determine whether there are unauthorized system calls. Once the existence of attack behavior (such as abnormal network request sequence or illegal system call chain) is confirmed, the system immediately triggers the response mechanism through the API of the container orchestration tool (such as Kubernetes). When the infected container is automatically isolated, it is achieved by modifying the network configuration and resource restrictions of the configuration container. At the same time, an alarm is sent to the security administrator, and the alarm information contains detailed information such as the type, source and scope of the attack, and a database such as MongoDB is used to record detailed attack event logs for subsequent analysis and compliance audits.
[0080] 703. Perform vulnerability detection on the vulnerability scan results. If there are security vulnerabilities in the vulnerability scan results, obtain the corresponding patch strategy from the Kubernetes platform through API calls.
[0081] In this embodiment, the system periodically starts vulnerability scanning tools, such as Nessus or OpenVAS, to scan the configuration container image and the running configuration container. These tools are compared with the known vulnerability database to detect whether there are security vulnerabilities. For the discovered vulnerabilities, the system automatically applies security patches and software updates through the API call pipeline. A priority-based patch strategy can be adopted to prioritize the repair of high-risk vulnerabilities to ensure that the security of the system is always kept up to date. In addition, using the self-healing mechanism of container orchestration tools (such as Kubernetes), the affected containers can be automatically restarted or upgraded to achieve seamless deployment of patches. During the update process, strategies such as rolling updates or blue-green deployment are adopted to ensure the continuity and stability of the service. At the same time, the updated version information and operation logs are recorded for traceability and auditing.
[0082] The above describes the attack risk container management method in the embodiment of the present invention. The following describes the attack risk container management device in the embodiment of the present invention. Figure 8 In one embodiment of the present invention, an attack risk container management device includes:
[0083] Configuration module 801, used to obtain the minimum network permission of each container, and perform network configuration on the corresponding container based on the minimum network permission to obtain a configuration container;
[0084] The analysis module 802 is used to obtain the operation data of each configuration container in real time, and perform data analysis on the operation data through a preset behavior analysis model to obtain a behavior analysis result;
[0085] The parsing module 803 is used to obtain the log data of each configuration container and perform structural parsing on the log data to obtain an abnormality parsing result;
[0086] The scanning module 804 is used to perform security scanning processing on each configuration container according to a preset period to obtain vulnerability scanning results;
[0087] The feedback module 805 is used to perform data analysis on the behavior analysis results, the anomaly analysis results and the vulnerability scanning results respectively, and perform feedback actions according to the analysis results.
[0088] In this embodiment, an independent network configuration is created for each container through the configuration module 801 to achieve network isolation between the containers, and the network configuration is set using the minimum network permission to ensure that the container always runs under the minimum permission, thereby reducing the risk of permission abuse; the operation data and log data of the configuration container are analyzed through the analysis module 802 and the parsing module 803 to determine whether the configuration container has an infection risk, so that the feedback module 805 can isolate the infected configuration container in time to avoid the problem of contamination spread; and the scanning module 804 regularly scans for vulnerabilities to effectively reduce the risk of infection of the configuration container and improve the security performance of the configuration container.
[0089] See also Fig. 9 Another embodiment of the attack risk container management device in the embodiment of the present invention includes:
[0090] Configuration module 801, used to obtain the minimum network permission of each container, and perform network configuration on the corresponding container based on the minimum network permission to obtain a configuration container;
[0091] The analysis module 802 is used to obtain the operation data of each configuration container in real time, and perform data analysis on the operation data through a preset behavior analysis model to obtain a behavior analysis result;
[0092] The parsing module 803 is used to obtain the log data of each configuration container and perform structural parsing on the log data to obtain an abnormality parsing result;
[0093] The scanning module 804 is used to perform security scanning processing on each configuration container according to a preset period to obtain vulnerability scanning results;
[0094] The feedback module 805 is used to perform data analysis on the behavior analysis results, the anomaly analysis results and the vulnerability scanning results respectively, and perform feedback actions according to the analysis results.
[0095] In this embodiment, in a first implementation method of the second aspect of the present invention, the configuration module 801 includes: a creation unit 8011, used to create corresponding network environment data for each container based on the Linux network namespace technology; a granularity unit 8012, used to optimize the access granularity in the network environment data using the CNI network plug-in; a granting unit 8013, used to obtain the minimum network permissions of each container, and grant the minimum permission set required for the optimized network environment data based on the SELinux security policy and the minimum network permissions to obtain a configuration container.
[0096] In this embodiment, in the second implementation method of the second aspect of the present invention, the analysis module 802 includes: a collection unit 8021, which is used to collect the operation data of each configuration container in real time based on a lightweight network probe; the operation data includes operation status data and behavior pattern data; a deviation unit 8022, which is used to perform anomaly analysis on the operation data based on an anomaly detection algorithm to obtain a deviation result; a pattern unit 8023, which is used to build a behavior analysis model based on a clustering analysis model, and use the behavior analysis model to perform behavior analysis on the behavior pattern data to obtain a pattern result; a behavior unit 8024, which is used to generate a behavior analysis result based on the deviation result and the pattern result set.
[0097] In this embodiment, in the third implementation method of the second aspect of the present invention, the collection unit 8021 includes: a probe unit 80211, which is used to use a lightweight network probe to collect behavior pattern data of each configuration container in real time; a capture unit 80212, which is used to obtain the process status data of the container from the proc file system, and capture the corresponding system call data from the configuration container based on the audit mechanism; an acquisition unit 80213, which is used to obtain the network traffic data of the configuration container using the tcpdump packet capture tool; a generation unit 80214, which is used to generate operation data based on the behavior pattern data, process status data, system call data and network traffic data.
[0098] In this embodiment, in the fourth implementation method of the second aspect of the present invention, the parsing module 803 includes: a log unit 8031, which is used to obtain corresponding log data from each configuration container according to a preset time; a parsing unit 8032, which is used to perform structured processing and analysis on the log data based on the Logstash parsing tool to obtain parsed data; an exception unit 8033, which is used to perform exception analysis on the parsed data based on a sequence pattern mining algorithm to identify specific sequence patterns of malicious activities and generate exception parsing results.
[0099] In this embodiment, in the fifth implementation of the second aspect of the present invention, the scanning module 804 includes: a path unit 8041, which is used to obtain the scanning path of each configuration container and the corresponding image configuration container; a construction unit 8042, which is used to build a security vulnerability comparison library based on the CVE database; a scanning unit 8043, which is used to perform a security scan on the scanning path using the OpenVAS vulnerability scanning tool within a preset period to obtain a scanning result; a comparison unit 8044, which is used to compare the scanning result with the security vulnerability comparison library to obtain a vulnerability scanning result.
[0100] In this embodiment, in the sixth implementation method of the second aspect of the present invention, the feedback module 805 includes: a deviation unit 8051, which is used to perform a deviation analysis on the behavior analysis results based on a preset normal behavior model. If a data point deviating from the normal mode appears, it is judged that the corresponding configuration container is at risk of infection, and the configuration container is isolated through cgroup technology; a risk unit 8052, which is used to perform a risk analysis on the abnormal analysis results based on a preset normal network traffic model and audit logs and rule comparison information. If there is an abnormal network request sequence or an illegal system call chain, it is judged that the corresponding configuration container is at risk of infection, and the network configuration of the corresponding configuration container is modified through the container orchestration tool; a vulnerability unit 8053, which is used to perform vulnerability detection on the vulnerability scanning results. If there is a security vulnerability in the vulnerability scanning result, the corresponding patch strategy is obtained from the Kubernetes platform through an API call.
[0101] above Figure 8 and Fig. 9 The attacked risk container management device in the embodiment of the present invention is described in detail from the perspective of modular functional entities. The attacked risk container management device in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0102] Fig.10 1 is a schematic diagram of the structure of an attack risk container management device provided by an embodiment of the present invention. The attack risk container management device 900 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 910 (for example, one or more processors) and a memory 920, and one or more storage media 930 (for example, one or more mass storage devices) storing application programs 933 or data 932. Among them, the memory 920 and the storage medium 930 may be temporary storage or permanent storage. The program stored in the storage medium 930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the attack risk container management device 900. Furthermore, the processor 910 may be configured to communicate with the storage medium 930, and execute a series of instruction operations in the storage medium 930 on the attack risk container management device 900 to implement the steps of the attack risk container management method provided by the above-mentioned method embodiments.
[0103] The attack risk container management device 900 may also include one or more power supplies 940, one or more wired or wireless network interfaces 950, one or more input and output interfaces 960, and / or one or more operating systems 931, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will appreciate that Fig.10 The illustrated structure of the attack risk container management device does not constitute a limitation on the attack risk container management device, and may include more or less components than those illustrated, or a combination of certain components, or a different arrangement of components.
[0104] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the method for managing a container under attack risk.
[0105] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device, or unit can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0106] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0107] Finally, it should be noted that the above description is only a preferred example of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for managing an attack risk container, characterized in that: include: Obtain the minimum network permissions of each container, and perform network configuration on the corresponding container based on the minimum network permissions to obtain a configuration container; Obtain the operating data of each configuration container in real time, and analyze the operating data through a preset behavior analysis model to obtain behavior analysis results; Obtain the log data of each configuration container and perform structural analysis on the log data to obtain an exception analysis result; Perform security scans on each configuration container according to a preset period to obtain vulnerability scan results; Perform data analysis on the behavior analysis results, anomaly analysis results, and vulnerability scanning results respectively, and perform feedback actions based on the analysis results.
2. The method for managing attack risk containers according to claim 1, characterized in that: The obtaining of the minimum network permissions of each container and performing network configuration on the corresponding container based on the minimum network permissions to obtain a configuration container includes: Create corresponding network environment data for each container based on Linux network namespace technology; Use CNI network plug-ins to optimize the access granularity in network environment data; The minimum network permissions of each container are obtained, and the minimum permission set required for the optimized network environment data is granted based on the SELinux security policy and the minimum network permissions to obtain the configuration container.
3. The method for managing attack risk containers according to claim 1, characterized in that: The real-time acquisition of the operation data of each configuration container and the data analysis of the operation data using a preset behavior analysis model to obtain a behavior analysis result include: Based on lightweight network probes, the operation data of each configuration container is collected in real time; the operation data includes operation status data and behavior pattern data; Perform anomaly analysis on the operating data based on anomaly detection algorithms to obtain deviation results; Building a behavior analysis model based on the cluster analysis model, and using the behavior analysis model to conduct behavior analysis on the behavior pattern data to obtain pattern results; Generate behavioral analysis results based on the deviation results and pattern results set.
4. The method for managing attack risk containers according to claim 3, characterized in that: The real-time collection of operation data of each configuration container based on a lightweight network probe includes: Use lightweight network probes to collect behavioral pattern data of each configuration container in real time; Obtain the process status data of the container from the proc file system, and capture the corresponding system call data from the configuration container based on the audit mechanism; Use the tcpdump packet capture tool to obtain the network traffic data of the configuration container; Generate operational data based on behavioral pattern data, process status data, system call data, and network traffic data.
5. The method for managing attack risk containers according to claim 1, characterized in that: The log data of each configuration container is obtained, and the log data is structurally parsed to obtain an abnormality parsing result, including: Obtain corresponding log data from each configuration container according to the preset time; Perform structured processing and analysis on log data based on the Logstash parsing tool to obtain parsed data; Anomaly analysis is performed on parsed data based on a sequence pattern mining algorithm to identify specific sequence patterns of malicious activities and generate anomaly parsing results.
6. The method for managing attack risk containers according to claim 1, characterized in that: The security scanning process is performed on each configuration container according to a preset period to obtain vulnerability scanning results, including: Get the scan path of each configuration container and the corresponding image configuration container; Build a security vulnerability comparison library based on the CVE database; During the preset period, use the OpenVAS vulnerability scanning tool to perform security scanning on the scanning path to obtain the scanning results; Compare the scan results with the security vulnerability comparison library to obtain the vulnerability scan results.
7. The method for managing attack risk containers according to claim 1, characterized in that: The data analysis is performed on the behavior analysis results, the anomaly analysis results and the vulnerability scanning results respectively, and feedback actions are performed according to the analysis results, including: Based on the preset normal behavior model, the behavior analysis results are analyzed for deviations. If data points deviating from the normal mode appear, the corresponding configuration container is judged to have an infection risk, and the configuration container is isolated through cgroup technology; Perform risk analysis on the abnormal analysis results based on the preset normal network traffic model, audit logs, and rule comparison information. If there is an abnormal network request sequence or illegal system call chain, the corresponding configuration container is judged to have an infection risk, and the network configuration of the corresponding configuration container is modified through the container orchestration tool; Perform vulnerability detection on the vulnerability scan results. If there are security vulnerabilities in the vulnerability scan results, obtain the corresponding patch strategy from the Kubernetes platform through API calls.
8. An attack risk container management device, characterized in that: include: A configuration module is used to obtain the minimum network permissions of each container and perform network configuration on the corresponding container based on the minimum network permissions to obtain a configuration container; The analysis module is used to obtain the operation data of each configuration container in real time, and analyze the operation data through a preset behavior analysis model to obtain a behavior analysis result; The parsing module is used to obtain the log data of each configuration container and perform structural parsing on the log data to obtain an abnormal parsing result; The scanning module is used to perform security scanning on each configuration container according to a preset period to obtain vulnerability scanning results; The feedback module is used to perform data analysis on the behavior analysis results, anomaly analysis results and vulnerability scanning results respectively, and perform feedback actions according to the analysis results.
9. An attack risk container management device, characterized in that: The attack risk container management device includes: a memory and at least one processor, wherein instructions are stored in the memory; At least one of the processors calls the instructions in the memory to enable the attack risk container management device to execute each step of the attack risk container management method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the steps of the method for managing an attack risk container as described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Computer network health safety assessment method and system
CN119603039A
