Security container construction method, system and device, storage medium and computer program product
By monitoring resource usage data in real time in containers and analyzing exception patterns using machine learning, combining decentralized communication framework and intelligent decision support system, the problem of low security in the existing technology is solved, and escape attacks and power-raising attacks are realized fast response and effective defense.
Patent Information
- Application Number
- CN202410936591.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-11-05
AI Technical Summary
The existing container technology has insufficient security protection measures when facing escape attacks and power-elevating attacks, and cannot monitor and respond in real time, resulting in low security.
By creating monitoring agents in containers to collect resource usage data in real time, using machine learning to analyze exception patterns, and co-defend with other containers, it adopts a decentralized communication framework and intelligent decision support system to achieve distributed supervision and rapid response.
It improves the security and stability of the container, reduces the time window for attackers to exploit vulnerabilities, enhances the scalability and fault resistance of the system, and reduces the possibility of false positives and underreports.
Smart Images

Figure CN118897714A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer security technology, and specifically to a security container construction method, system, device, storage medium and computer program product. Background Art
[0002] With the popularity of cloud computing and microservice architecture, container technology has become an important tool for software development and deployment. Containers provide a lightweight, portable, and consistent operating environment that enables applications to run seamlessly on different computing platforms. However, with the widespread application of container technology, its security issues have become increasingly prominent, especially in the face of escape attacks and privilege escalation attacks, the security protection measures of existing container technology appear to be insufficient.
[0003] An escape attack is when an attacker is able to break through the isolation boundary of a container and access the host's resources or control the host. A privilege escalation attack is when an attacker exploits a vulnerability inside a container to elevate his or her privileges, thereby controlling the entire container or further affecting the host. Both of these attack methods seriously threaten the security of containers because they allow attackers to bypass the container's security mechanisms and directly damage the host or other containers.
[0004] Existing container security measures mainly include Linux kernel-based security modules (such as SELinux and AppArmor), container runtime security configuration (such as using a read-only file system and limiting resource usage), and network isolation policies. Although these measures have improved the security of containers to a certain extent, they often rely on the security features of the kernel and the configuration of the administrator, and have the problems of complex configuration and easy errors. In addition, with the continuous evolution of attack methods, these traditional security measures are no longer sufficient to deal with new attacks.
[0005] Therefore, a security mechanism is needed that can realize self-monitoring and processing within the container, and can cooperate with other containers for joint defense. This mechanism needs to be able to collect container resource usage data in real time, analyze potential security risks, and quickly implement security response strategies when anomalies are detected to ensure the security and stability of the container.
[0006] The disclosure of the above background technology content is only used to assist in understanding the concept and technical solution of the present invention. It does not necessarily belong to the prior art of this patent application. In the absence of clear evidence that the above content has been disclosed on the filing date of this patent application, the above background technology should not be used to evaluate the novelty and creativity of the present application. Summary of the invention
[0007] The present application provides a secure container construction method, system, device, storage medium and computer program product, which are used to solve the problems of low security and low automation of existing container construction technologies.
[0008] To achieve the above objectives, the present application discloses the following technical solutions:
[0009] In a first aspect, an embodiment of the present application provides a method for constructing a secure container, the method comprising:
[0010] Step 1: Create multiple containers, each of which includes:
[0011] A monitoring agent is used to collect resource usage data of the container in real time. In addition to collecting basic resource usage data such as CPU usage, memory usage, and network traffic, the monitoring agent can also be extended to monitor disk IO, process information, and open ports to provide more comprehensive security monitoring.
[0012] The monitoring agent further includes:
[0013] Devices that collect resource usage data, including but not limited to CPU usage, memory usage, and network traffic;
[0014] A device for sorting the collected data into time series;
[0015] A device for calculating the rate of change of resource usage at each point in time.
[0016] Data analysis, which is used to analyze the resource usage data of the container to identify abnormal resource usage patterns based on preset resource usage upper limits and a list of abnormal resource usage patterns; apply machine learning technology to identify complex abnormal patterns to improve the accuracy and efficiency of identification;
[0017] Data analysis further includes:
[0018] A device for obtaining a preset upper limit value of resource usage;
[0019] A device that compares the rate of change of resource usage at adjacent time points to identify resource usage fluctuation patterns;
[0020] means for comparing the identified fluctuation pattern with a preset list of abnormal resource usage patterns;
[0021] If the identified fluctuation pattern matches any pattern in the abnormal resource usage pattern list, it is determined that there is a device with an abnormal resource usage pattern.
[0022] Result responses, used to implement security response strategies based on the identified abnormal resource usage patterns; security response strategies may include automatically isolating affected containers, notifying administrators, dynamically adjusting resource allocations, or triggering remediation scripts;
[0023] The resulting response further includes:
[0024] A device for obtaining historical data of resource usage, peak time points of resource usage, changing trends of resource usage patterns, and the degree of deviation from normal resource usage patterns in the abnormal information set;
[0025] A device for matching the abnormal information set with a preset security policy template;
[0026] Select a corresponding security response measure as a device for the security response strategy.
[0027] Step 2: Establish an inter-container communication protocol so that containers can exchange monitoring data and monitor each other's resource usage. Specifically:
[0028] Define a standardized data format for transmitting monitoring information between containers; use data serialization formats such as JSON or Protobuf to ensure compatibility and efficiency of data transmission, and ensure seamless exchange of monitoring data between different containers and applications;
[0029] Implement a decentralized communication framework that allows containers to communicate directly with each other without relying on a central node; use P2P technology or distributed hash tables (DHT) to achieve direct communication between containers, enhance the system's scalability and fault resistance, and reduce single point risks;
[0030] Step 3: Further establish a central coordinator to coordinate the monitoring activities between containers and guide the containers to implement corresponding security response strategies when anomalies are detected, including:
[0031] Provides a user interface for monitoring and managing system status, providing an intuitive dashboard and alert system that enables administrators to easily manage and respond to incidents;
[0032] Implement an intelligent decision support system to provide real-time feedback and suggestions based on monitoring data, integrate AI algorithms, make operational suggestions based on historical data and real-time feedback, and use data analysis to improve decision quality and response speed.
[0033] In the embodiments of the present application, firstly, by creating containers and assigning them unique identifiers, it is ensured that each container can be accurately tracked and managed, providing a basis for subsequent security monitoring and response. Secondly, by obtaining and configuring the security construction parameter set of the container, the security and performance of the container are ensured, and by limiting resource usage, attackers are effectively prevented from attacking by means such as resource exhaustion. In terms of monitoring, the method monitors the resource usage of the container in real time based on the upper limit of resource usage, and generates a resource consumption warning signal when resource usage exceeds a preset threshold. This real-time monitoring mechanism helps to promptly detect abnormal resource usage, especially signs of escape attacks and privilege escalation attacks, thereby quickly responding to potential security threats;
[0034] In a multi-container environment, adjacent containers or specific monitoring containers can monitor each other. Each container monitors not only itself, but also the behavior of other containers. This can be achieved by sharing internal monitoring data or through a decentralized monitoring network. When a container identifies abnormal behavior of a neighboring container, it can notify the central coordinator to directly coordinate with other containers to take response measures, such as isolating the affected container or adjusting resource allocation to prevent the spread of potential security threats;
[0035] Implement a horizontal supervision mechanism based on a consensus algorithm, which allows containers to check each other's status and behavior. In this way, any abnormal behavior or security threats can be quickly identified and handled, thereby enhancing the immunity of the entire container cluster. This distributed supervision mechanism also helps reduce dependence on centralized management systems and improve the scalability and fault tolerance of the system.
[0036] In addition, in response to resource consumption warning signals, the resource usage data is analyzed to identify abnormal patterns and match them with preset security policy templates to generate and apply the most appropriate security response strategy. This allows for quick response to security threats, reducing the time window for attackers to exploit vulnerabilities.
[0037] In some possible implementations of the first aspect, the resource limit parameters include CPU usage limit and memory usage limit. By setting the upper limit of CPU and memory usage, it is possible to prevent a single container from consuming too many system resources, effectively avoiding the problem of system performance degradation or even system crash caused by resource exhaustion attacks, which affects the normal operation of other containers.
[0038] In some possible implementations of the first aspect, the step of analyzing resource usage data of the first container to identify a resource usage pattern includes:
[0039] Collect resource usage data of the container within a predetermined time period, including CPU usage, memory usage, and network traffic;
[0040] Sort the collected resource usage data by time series and calculate the resource usage change rate at each time point;
[0041] By comparing the rate of change of resource usage at adjacent time points, the fluctuation pattern of resource usage can be identified;
[0042] Based on the identified resource usage pattern and the abnormal resource usage pattern list, the step of determining whether there is an abnormal resource usage pattern includes:
[0043] Compare the identified fluctuation pattern with a pre-set list of abnormal resource usage patterns;
[0044] If the identified fluctuation pattern matches any pattern in the abnormal resource usage pattern list, it is determined that an abnormal resource usage pattern exists.
[0045] Among them, time series analysis helps to capture the dynamic changes in resource usage. In this way, not only the absolute amount of resource usage is taken into account, but also its changes over time. Therefore, the accuracy of detection can be improved, the possibility of false positives and false negatives can be reduced, and the container can be more effectively protected from the threat of escape attacks and privilege escalation attacks.
[0046] In some possible implementations of the first aspect, the abnormal information set includes the following information: historical data of resource usage, peak time points of resource usage, changing trends of resource usage patterns, and the degree of deviation from normal resource usage patterns;
[0047] The steps of matching the abnormal information set with the preset security policy template to obtain the security response policy include:
[0048] Obtaining historical data of resource usage in the abnormal information set, and calculating its deviation value from a preset resource usage baseline to obtain a deviation analysis result;
[0049] Analyze the resource usage peak time point to determine whether there is a periodic or sudden resource usage peak, so as to obtain a peak time point analysis result;
[0050] Compare the change trend of resource usage patterns with the preset normal change trend, identify the abnormal change pattern, and obtain the change trend analysis results;
[0051] Calculating the degree of deviation from the normal resource usage pattern and determining the severity level of the anomaly to obtain a deviation degree analysis result;
[0052] The deviation analysis results, the peak time point analysis results, the change trend analysis results and the deviation degree analysis results are compared one by one with the policy conditions in the preset security policy template. When the information in the abnormal information set meets at least one policy condition, the corresponding security response measure is selected as the security response strategy.
[0053] In this way, the deviation value of historical resource usage data and the preset resource usage baseline can be compared to quantify the abnormal degree of resource usage. This analysis helps to determine whether resource usage exceeds the normal range, thereby triggering the corresponding security policy.
[0054] Analyzing resource usage peak times can help identify resource usage patterns. This helps understand the dynamic changes in resource usage and adjust security policies accordingly to deal with different types of resource usage patterns.
[0055] By comparing the changing trend of resource usage patterns with the preset normal change trend, the pattern of abnormal changes can be identified. This analysis helps to predict future resource usage trends and take measures in advance to prevent potential security threats.
[0056] In some possible implementations of the first aspect, the severity level of the anomaly can be determined by calculating the degree of deviation from the normal resource usage pattern, which helps to select appropriate security response measures according to the severity of the anomaly, ensuring the rational use of resources and the security of the system.
[0057] During the operation of the container, the operation status of the safety container is monitored in real time, and operation data is collected;
[0058] Analyzing the operating data to detect whether there is a security incident;
[0059] If a security incident is detected, the corresponding security measures will be automatically triggered according to the preset security response policy template.
[0060] In some possible implementations of the first aspect, during the operation of the container, all detected abnormal behaviors or security events and their response measures are collected to establish a security event log;
[0061] Regularly analyzing the security event log, evaluating the effectiveness of the security policy, and identifying potential security vulnerabilities to generate a first analysis result;
[0062] According to the first analysis result, adjust the container parameters and the security response policy template;
[0063] Apply the adjusted container parameters and security response policy template to all relevant containers.
[0064] In some possible implementations of the first aspect, the steps of adjusting container parameters and adjusting the security response policy template according to the first analysis result include:
[0065] After the first analysis result is generated, automatically identifying containers and resources related to the security incident;
[0066] Retrieve relevant historical security event data based on the identified containers and resources;
[0067] The historical security event data is analyzed, and the correlation between the historical security event and the current security event is evaluated to generate a second analysis result, and the monitoring strategy of the relevant container and resource is adjusted according to the second analysis result.
[0068] This can reduce the possibility of false alarms and missed alarms and improve the accuracy of security monitoring.
[0069] In a second aspect, an embodiment of the present application provides a secure container construction system, including:
[0070] Self-supervision: includes: an identity generation module that creates containers and generates a unique identifier for each container;
[0071] A container parameter setting module, used to obtain a container security construction parameter set; configure resource restriction parameters of the container according to the unique identifier and the container security construction parameter set;
[0072] The container policy generation module extracts the resource usage upper limit value from the container resource limit parameters, monitors the instantaneous value based on the resource usage upper limit value, determines the parameter exceeds the limit, analyzes the resource usage pattern, generates an abnormal information set, matches the security policy, and the container autonomously executes the security policy without external intervention;
[0073] Mutual supervision: includes a self-supervision module and a central coordinator, which are used to perform horizontal supervision with other containers through the inter-container communication protocol to achieve a distributed, real-time security supervision mechanism, thereby not relying on a single supervision point of the host machine.
[0074] In a third aspect, an embodiment of the present application provides a secure container construction device, the device comprising: a processor and a memory;
[0075] The memory is used to store one or more program instructions;
[0076] A processor is used to run one or more program instructions to execute the steps of a secure container construction method as described above.
[0077] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a method for constructing a secure container as described above are implemented.
[0078] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements any of the method steps above when executed by a processor.
[0079] Among them, the technical effects brought about by any design method in the second to fifth aspects can refer to the technical effects brought about by different design methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] In order to more clearly illustrate the implementation of the present invention or the technical solution in the prior art, the following briefly introduces the drawings required for the implementation or the prior art description. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.
[0081] Figure 1 A schematic diagram of the structure of a secure container construction system provided for some embodiments of the present invention;
[0082] Figure 2 A schematic diagram of a secure container construction method provided for some embodiments of the present invention Figure 1 ;
[0083] Figure 3 A schematic diagram of a secure container construction method provided for some embodiments of the present invention Figure 2 ;
[0084] Figure 4 A schematic diagram of a secure container construction method provided for some embodiments of the present invention Figure 3 ;
[0085] Figure 5 A schematic diagram of a secure container construction method provided for some embodiments of the present invention Figure 4 .
[0086] Figure 6 A schematic diagram of a secure container construction method provided for some embodiments of the present invention Figure 5 . DETAILED DESCRIPTION
[0087] Specific embodiments of the present invention will now be mentioned in detail. Although the present invention is described in conjunction with these specific embodiments, it should be appreciated that it is not intended to limit the present invention to these specific embodiments. On the contrary, these embodiments are intended to cover substitutions, changes or equivalent embodiments that may be included in the spirit and scope of the invention defined by the claims. In the following description, a large number of specific details are set forth in order to provide a comprehensive understanding of the present invention. The present invention may be implemented without some or all of these specific details.
[0088] When used in conjunction with "including," "methods comprising," or similar language in this specification and the appended claims, the singular forms "a," "an," and "the" include plural references unless the context clearly dictates otherwise. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0089] An embodiment of the present application provides a secure container construction system, which can be applied to cloud computing platforms, microservice architectures, big data processing environments, continuous integration / continuous deployment processes, internal enterprise applications, container orchestration systems such as Kubernetes, and Internet of Things environments, etc., relying on container technology infrastructure such as Docker, Kubernetes, OpenShift, etc. to enhance security and resource management capabilities.
[0090] See also Figure 1 An embodiment of the present application provides a secure container construction system, including: an identification generation module, a container parameter setting module, and a container policy generation module.
[0091] The identification generation module is used to create a container and generate a unique identifier for the container;
[0092] The container parameter setting module is used to obtain a container security construction parameter set; configure the resource restriction parameters of the container according to the unique identifier and the container security construction parameter set;
[0093] The container policy generation module is used to extract the upper limit value of resource usage from the container resource limit parameters; based on the upper limit value of resource usage, monitor the instantaneous value of the corresponding parameter of the container; if the instantaneous value of at least one parameter of the container exceeds the preset threshold, generate a resource usage alarm signal; in response to the resource consumption warning signal, analyze the resource usage data of the container, identify the resource usage pattern, and determine whether there is an abnormal resource usage pattern based on a pre-set list of abnormal resource usage patterns; if there is an abnormal resource usage pattern, generate an abnormal information set; match the abnormal information set with a preset security policy template to obtain a security response strategy;.
[0094] Among them, by creating containers and assigning them unique identifiers, it is ensured that each container can be accurately tracked and managed, providing a basis for subsequent security monitoring and response. Secondly, by obtaining and configuring the container's security build parameter set, the security and performance of the container are ensured, and by limiting resource usage, attackers are effectively prevented from attacking by means such as resource exhaustion. In terms of monitoring, this method monitors the resource usage of the container in real time based on the upper limit of resource usage, and generates a resource consumption warning signal when resource usage exceeds the preset threshold. This real-time monitoring mechanism helps to promptly detect abnormal resource usage, especially signs of escape attacks and privilege escalation attacks, so as to quickly respond to potential security threats.
[0095] In addition, in response to resource consumption warning signals, the resource usage data is analyzed to identify abnormal patterns and match them with preset security policy templates to generate and apply the most appropriate security response strategy. This allows for quick response to security threats, reducing the time window for attackers to exploit vulnerabilities.
[0096] In a multi-container environment, we enable mutual supervision between containers through a decentralized monitoring network. Each container can not only monitor its own status, but also share monitoring data with other containers to jointly analyze potential security threats. This distributed monitoring method speeds up the identification and response of cross-container attack behaviors, such as the spread of malware or coordinated resource exhaustion attacks. Mutual supervision between containers enhances the defense of the entire container cluster and improves the ability to identify complex attack patterns.
[0097] See also Figure 2 In some embodiments, the secure container construction system further includes: a real-time monitoring module and an iterative update module. The real-time monitoring module is used to monitor the operating status of the secure container in real time during the operation of the second container and collect operating data; analyze the operating data to detect whether there is a security incident; if a security incident is detected, the corresponding security measures are automatically triggered according to the preset security response policy template.
[0098] The iterative update module is used to collect all detected abnormal behaviors or security incidents and their response measures to establish a security event log; regularly analyze the security event log, evaluate the effectiveness of the security policy, identify potential security vulnerabilities to generate a first analysis result; adjust the container parameters and the security response policy template according to the first analysis result; apply the adjusted container parameters and security response policy template to all relevant containers.
[0099] See also Figure 3 , corresponding to the above-disclosed secure container construction system, the present application embodiment further provides a secure container construction method, including:
[0100] S101: Create multiple containers, each of which includes: a monitoring agent for collecting resource usage data of the container in real time; data analysis for analyzing the resource usage data of the container to identify abnormal resource usage patterns based on preset resource usage upper limits and a list of abnormal resource usage patterns; result response for implementing security response strategies based on the identified abnormal resource usage patterns; wherein the security construction parameter set includes but is not limited to: preset CPU and memory limit parameters, preset network access control rules, and preset file system permission settings. Resource limit parameters include CPU usage limit and memory usage limit. By setting upper limits on CPU and memory usage, a single container can be prevented from consuming too many system resources, effectively avoiding the problem of system performance degradation or even system crashes caused by resource exhaustion attacks, which affects the normal operation of other containers. Of course, the present application is not limited to this. In other embodiments, resource limit parameters may also include parameters such as disk I / O limits;
[0101] S102: Establish an inter-container communication protocol to enable containers to exchange monitoring data and supervise each other's resource usage. Specifically, define a standardized data format for transmitting monitoring information between containers; implement a decentralized communication framework to allow containers to communicate directly with each other without relying on a central node.
[0102] S103: Establish a central coordinator to coordinate the monitoring activities among containers and guide the containers to implement corresponding security response strategies when anomalies are detected, including: providing a user interface for monitoring and managing system status; implementing an intelligent decision support system for providing real-time feedback and suggestions based on monitoring data;
[0103] S104: Based on the resource usage upper limit and the instantaneous value of the corresponding parameter of the container, determine whether the instantaneous value of at least one parameter of the container exceeds a preset threshold;
[0104] S105: if the instantaneous value of at least one parameter of the container exceeds a preset threshold, a resource usage alarm signal is generated;
[0105] S106: In response to the resource consumption warning signal, analyze the resource usage data of the container to identify the resource usage pattern; obtain a preset abnormal resource usage pattern list;
[0106] S107: Based on the identified resource usage pattern and the abnormal resource usage pattern list, determine whether there is an abnormal resource usage pattern;
[0107] S108: If there is an abnormal resource usage pattern, generate an abnormal information set;
[0108] S1019: Match the exception information set with the preset security policy template to obtain a security response strategy.
[0109] See also Figure 4 In step S106, the resource usage data of the container is analyzed to identify the resource usage pattern, including:
[0110] S1061: Collect resource usage data of the container within a predetermined time period, including CPU usage, memory usage, and network traffic; wherein the predetermined time period refers to a duration, such as 15 days, a month, etc.
[0111] S1062: sorting the collected resource usage data according to the time series, and calculating the resource usage rate change rate at each time point;
[0112] S1063: Compare the resource usage change rates at adjacent time points to identify the fluctuation pattern of resource usage;
[0113] See also Figure 5 In step S107, based on the identified resource usage pattern and the abnormal resource usage pattern list, the step of determining whether there is an abnormal resource usage pattern includes:
[0114] S1071: Compare the identified fluctuation pattern with a pre-set list of abnormal resource usage patterns; wherein the list of abnormal resource usage patterns can be obtained by analyzing historical data, referring to industry standards and best practices, leveraging the knowledge of security experts, applying machine learning and artificial intelligence technologies, or using professional security monitoring tools and platforms.
[0115] S1072: If the identified fluctuation pattern matches any pattern in the abnormal resource usage pattern list, it is determined that an abnormal resource usage pattern exists.
[0116] Among them, time series analysis helps to capture the dynamic changes in resource usage. In this way, not only the absolute amount of resource usage is taken into account, but also its changes over time. Therefore, the accuracy of detection can be improved, the possibility of false positives and false negatives can be reduced, and the container can be more effectively protected from the threat of escape attacks and privilege escalation attacks.
[0117] Preferably, in step S108, the abnormal information set may include the following information: historical data of resource usage, peak time points of resource usage, changing trends of resource usage patterns, and the degree of deviation from normal resource usage patterns;
[0118] See also Figure 6 In step S109, the step of matching the abnormal information set with the preset security policy template to obtain the security response policy includes:
[0119] S1091: Obtain historical data of resource usage in the abnormal information set, and calculate its deviation value from a preset resource usage baseline to obtain a deviation analysis result;
[0120] S1092: Analyze the resource usage peak time point to determine whether there is a periodic or sudden resource usage peak, so as to obtain the peak time point analysis result;
[0121] S1093: Compare the change trend of the resource usage pattern with the preset normal change trend, identify the abnormal change pattern, and obtain the change trend analysis result;
[0122] S1094: Calculate the degree of deviation from the normal resource usage pattern and determine the severity level of the anomaly to obtain a deviation degree analysis result;
[0123] S1095: Compare the deviation analysis results, peak time point analysis results, change trend analysis results and deviation degree analysis results with the policy conditions in the preset security policy template one by one. When the information in the abnormal information set meets at least one policy condition, select the corresponding security response measure as the security response strategy.
[0124] In this way, the deviation value of historical resource usage data and the preset resource usage baseline can be compared to quantify the abnormal degree of resource usage. This analysis helps to determine whether resource usage exceeds the normal range, thereby triggering the corresponding security policy.
[0125] Analyzing resource usage peak times can help identify resource usage patterns. This helps understand the dynamic changes in resource usage and adjust security policies accordingly to deal with different types of resource usage patterns.
[0126] By comparing the changing trend of resource usage patterns with the preset normal change trend, the pattern of abnormal changes can be identified. This analysis helps to predict future resource usage trends and take measures in advance to prevent potential security threats.
[0127] The severity level of the anomaly can be determined by calculating the degree of deviation from the normal resource usage pattern. This helps to select appropriate security response measures based on the severity of the anomaly, ensuring the rational use of resources and the security of the system.
[0128] Preferably, during the operation of the container, the operating status of the secure container is monitored in real time and the operating data is collected; wherein the operating status includes but is not limited to CPU usage or memory usage or disk I / O or network traffic, and system logs.
[0129] Analyze operational data to detect whether there are security incidents;
[0130] If a security incident is detected, the corresponding security measures will be automatically triggered according to the preset security response policy template. In this way, the operation process of the security container can be monitored and security threats can be responded to quickly.
[0131] Furthermore, during the operation of the container, all detected abnormal behaviors or security events and their response measures are collected to establish a security event log;
[0132] Regularly analyze security event logs, evaluate the effectiveness of security policies, and identify potential security vulnerabilities to generate first analysis results;
[0133] According to the first analysis result, adjust the container parameters and the security response policy template; apply the adjusted container parameters and security response policy template to all related containers. In this way, it is possible to learn from each security incident, continuously optimize security policies and response measures, and thus improve long-term security performance.
[0134] Specifically, the steps of adjusting container parameters and adjusting security response policy templates according to the first analysis result include: automatically identifying containers and resources related to security events after the first analysis result is generated; retrieving relevant historical security event data according to the identified containers and resources; analyzing historical security event data, evaluating the correlation between historical security events and current security events to generate a second analysis result, and adjusting the monitoring policy of relevant containers and resources according to the second analysis result. In this way, the possibility of false positives and false negatives can be reduced, and the accuracy of security monitoring can be improved.
[0135] In addition, an embodiment of the present application also provides a secure container construction device, the device including: a processor and a memory; the memory is used to store one or more program instructions; the processor is used to run one or more program instructions to execute the steps of a secure container construction method as any of the above items.
[0136] In addition, an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a secure container construction method as described above are implemented.
[0137] In addition, an embodiment of the present application further provides a computer program product, including a computer program, which implements any of the above method steps when executed by a processor.
[0138] In the embodiment of the present invention, the processor may be an integrated circuit chip with signal processing capability. The processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0139] The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The processor reads the information in the storage medium and completes the steps of the above method in combination with its hardware.
[0140] The storage medium may be a memory, which may be, for example, a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory.
[0141] Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.
[0142] The volatile memory may be a random access memory (RAM) which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDRSDRAM), enhanced synchronous DRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus DRAM (DRRAM).
[0143] The storage media described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memory.
[0144] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention can be implemented using a combination of hardware and software. When software is used, the corresponding functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. Storage media can be any available media that can be accessed by general or special-purpose computers.
[0145] Although the present invention has been described in detail above by general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.
Claims
1. A method for constructing a secure container, characterized in that: The method comprises: Step 1: Create multiple containers, each of which includes: A monitoring agent, which is used to collect resource usage data of the container in real time; Data analysis, for analyzing resource usage data of the container to identify abnormal resource usage patterns based on preset resource usage upper limits and a list of abnormal resource usage patterns; Result response, used to implement security response strategies based on the identified abnormal resource usage patterns; Step 2: Establish an inter-container communication protocol so that containers can exchange monitoring data and monitor each other's resource usage. Specifically: Define a standardized data format for transmitting monitoring information between containers; Implement a decentralized communication framework that allows containers to communicate directly with each other without relying on a central node; Step 3: Further establish a central coordinator to coordinate the monitoring activities between containers and guide the containers to implement corresponding security response strategies when anomalies are detected, including: Provide a user interface for monitoring and managing system status; Implement an intelligent decision support system to provide real-time feedback and recommendations based on monitoring data.
2. The method for constructing a secure container according to claim 1, characterized in that: The monitoring agent further comprises: Devices that collect resource usage data, including but not limited to CPU usage, memory usage, and network traffic; A device for sorting the collected data into time series; A device for calculating the rate of change of resource usage at each point in time.
3. The method for constructing a secure container according to claim 1 or 2, characterized in that: The analysis module further comprises: A device for obtaining a preset upper limit value of resource usage; A device that compares the rate of change of resource usage at adjacent time points to identify resource usage fluctuation patterns; means for comparing the identified fluctuation pattern with a preset list of abnormal resource usage patterns; If the identified fluctuation pattern matches any pattern in the abnormal resource usage pattern list, it is determined that there is a device with an abnormal resource usage pattern.
4. The method for constructing a secure container according to claim 1, characterized in that: The response module further comprises: A device for obtaining historical data of resource usage, peak time points of resource usage, changing trends of resource usage patterns, and the degree of deviation from normal resource usage patterns in the abnormal information set; A device for matching the abnormal information set with a preset security policy template; Select a corresponding security response measure as a device for the security response strategy.
5. The method for constructing a secure container according to claim 1, characterized in that: During the operation of the container, the operation status of the safety container is monitored in real time, and operation data is collected; Analyzing the operating data to detect whether there is a security incident; If a security incident is detected, the corresponding security measures will be automatically triggered according to the preset security response policy template.
6. The method for constructing a secure container according to claim 1, characterized in that: During the operation of the container, all detected abnormal behaviors or security events and their response measures are collected to establish a security event log; Regularly analyzing the security event log, evaluating the effectiveness of the security policy, and identifying potential security vulnerabilities to generate a first analysis result; According to the first analysis result, adjust the container parameters and the security response policy template; Apply the adjusted container parameters and security response policy template to all relevant containers; The step of adjusting the container parameters and the security response policy template according to the first analysis result includes: After the first analysis result is generated, automatically identifying containers and resources related to the security incident; Retrieve relevant historical security event data based on the identified containers and resources; The historical security event data is analyzed, and the correlation between the historical security event and the current security event is evaluated to generate a second analysis result, and the monitoring strategy of the relevant container and resource is adjusted according to the second analysis result.
7. A secure container construction system, characterized in that: include: Self-monitoring: including: an identification generation module, which is used to create multiple containers and generate a unique identifier for each container; a container parameter setting module, which is used to obtain a container security construction parameter set; according to the unique identifier and the container security construction parameter set, the resource restriction parameters of the container are configured; a container policy generation module, which extracts the resource usage upper limit value from the container resource restriction parameter, and monitors the instantaneous value based on the resource usage upper limit value, determines parameter over-limit, analyzes resource usage patterns, generates an abnormal information set, matches security policies, and the container autonomously executes security policies without external intervention; Mutual supervision: includes a self-monitoring module and a central coordinator, which are used to perform horizontal supervision with other containers through the inter-container communication protocol to achieve a distributed, real-time security supervision mechanism, thereby not relying on a single supervision point of the host machine.
8. A secure container construction device, characterized in that: The device comprises: a processor and a memory; The memory is used to store one or more program instructions; The processor is used to run one or more program instructions to execute the steps of a secure container construction method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a secure container construction method as described in any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method steps according to any one of claims 1 to 6 are implemented.
