Container escape detection method, device and electronic equipment

By detecting the current namespace, operation objects and system calls of processes in the container, the problem of low accuracy of container escape detection in the prior art is solved, and more accurate container escape detection is achieved, which enhances the security of the container.

CN111881453BActive Publication Date: 2024-11-05BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010701870.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-20
Publication Date
2024-11-05
Estimated Expiration
2040-07-20

AI Technical Summary

Technical Problem

The existing container escape detection methods have low accuracy and are easily bypassed or misjudgmented. Especially by analyzing the system call sequence through decision trees or monitoring the host file, it is difficult to effectively detect container escape.

Method used

By detecting the current namespace, operation objects and system calls of the process in the container, including checking namespace consistency, file whitelist permissions and system call permissions, if an exception is found, the warning information will be output to improve the detection accuracy.

Benefits of technology

It improves the accuracy of container escape detection, reduces misjudgment and missed detection, and can promptly remind users to take countermeasures and enhances the safety of containers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111881453B_ABST
    Figure CN111881453B_ABST
Patent Text Reader

Abstract

The present application discloses a container escape detection method, device and electronic device, which relate to the fields of container technology and cloud computing technology. The specific implementation scheme is: detect the target content of the process in the container to determine whether a container escape has occurred, wherein the target content includes: at least one of the current namespace, operation object, and system call: when it is determined that a container escape has occurred, output warning information. In the container escape detection method of the embodiment of the present application, the target content of the process in the container is detected to determine whether a container escape has occurred, and the target content includes: at least one of the current namespace, operation object, and system call, that is, the current namespace, operation object, and system call of the process in the container are detected to determine whether a container escape has occurred, which can improve the accuracy of container escape detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of container technology in computer technology and cloud computing technology, and in particular to a container escape detection method, device and electronic equipment. Background Art

[0002] With the development of computer technology, container technology is becoming more and more widely used, and is widely used in the field of lightweight virtualization, providing users with elastic resource capabilities and improving resource utilization. While container technology is widely used, its security issues are also widely concerned. Among them, container escape is a security issue with a relatively serious impact. Attackers inject attack programs through normal containerized business logic and use certain security vulnerabilities to obtain the permission to execute certain commands on the host machine.

[0003] At present, there are two commonly used container escape detection methods. One is to analyze the system call data flow of the container and match certain attack patterns, mainly through the decision tree to analyze and classify the system call sequence to determine whether an escape has occurred. The other is to monitor sensitive files on the host machine. If the file content is tampered with, it is determined that an escape has occurred. Summary of the invention

[0004] The present application provides a container escape detection method, device and electronic equipment.

[0005] In a first aspect, an embodiment of the present application provides a container escape detection method, the method comprising:

[0006] Detect the target content of the process in the container to determine whether a container escape occurs, wherein the target content includes at least one of the current namespace, the operation object, and the system call:

[0007] When it is determined that a container escape has occurred, a warning message is output.

[0008] In the container escape detection method of the embodiment of the present application, the target content of the process in the container is detected to determine whether a container escape has occurred. The target content includes: at least one of the current namespace, operation object, and system call. That is, at least one of the current namespace, operation object, and system call of the process in the container is detected to determine whether a container escape has occurred, which can improve the accuracy of container escape detection.

[0009] In a second aspect, an embodiment of the present application provides a container escape detection device, the device comprising:

[0010] A detection module is used to detect the target content of the process in the container to determine whether a container escape occurs, wherein the target content includes at least one of: a current namespace, an operation object, and a system call:

[0011] The output module is used to output warning information when it is determined that a container escape has occurred.

[0012] During the container escape detection process performed by the container escape detection device of the embodiment of the present application, the target content of the process in the container is detected to determine whether a container escape has occurred. The target content includes: at least one of the current namespace, operation object, and system call. That is, at least one of the current namespace, operation object, and system call of the process in the container is detected to determine whether a container escape has occurred, which can improve the accuracy of container escape detection.

[0013] In a third aspect, an embodiment of the present application further provides an electronic device, including:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the methods provided in each embodiment of the present application.

[0017] In a fourth aspect, an embodiment of the present application further provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the methods provided in the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.

[0019] Figure 1 This is one of the flow diagrams of a container escape detection method according to an embodiment of the present application;

[0020] Figure 2 This is a second flow chart of a container escape detection method according to an embodiment of the present application;

[0021] Figure 3 This is a third flow chart of a container escape detection method according to an embodiment of the present application;

[0022] Figure 4 This is one of the structural diagrams of a container escape detection method device according to an embodiment of the present application;

[0023] Figure 5 This is the second structural diagram of a container escape detection method device according to an embodiment of the present application;

[0024] Figure 6 This is a third structural diagram of a container escape detection method device according to an embodiment of the present application;

[0025] Figure 7 It is a block diagram of an electronic device used to implement a container escape detection method according to an embodiment of the present application. DETAILED DESCRIPTION

[0026] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0027] like Figure 1 As shown, according to an embodiment of the present application, the present application provides a container escape detection method, which can be applied to a server, and the method includes:

[0028] Step S101: Detect the target content of the process in the container to determine whether a container escape occurs.

[0029] Step S102: When it is determined that a container escape has occurred, output a warning message.

[0030] Containers run in an independent environment and do not share the host operating system's memory, CPU or disk with other applications, ensuring that processes within the container do not affect any processes outside the container. Containers can be understood as a series of processes isolated from the rest of the system, that is, a series of processes that are resource-constrained and isolated from each other. Containers share the host machine's kernel.

[0031] However, container escape is a security issue with a relatively serious impact. In order to improve the security of the container, the container can be detected for escape. In this embodiment, the target content of the process in the container can be detected to determine whether a container escape has occurred. The target content includes: at least one of the current namespace, the operation object, and the system call. In the case of determining that a container escape has occurred, an early warning message is output to remind the user of the container escape, so that the user can take corresponding countermeasures, such as stopping or terminating the container.

[0032] In the process of performing container escape detection, the container escape detection method of the present embodiment detects the target content of the process in the container to determine whether a container escape occurs. The target content includes: at least one of the current namespace, the operation object, and the system call. That is, at least one of the current namespace, the operation object, and the system call of the process in the container is detected to determine whether a container escape occurs, which can improve the accuracy of container escape detection.

[0033] In one embodiment, a container escape is determined to have occurred in any of the following situations:

[0034] The current namespace of the process in the container is inconsistent with the namespace previously associated with the process;

[0035] The operation object of the process in the container exceeds the scope of the file whitelist associated with the process;

[0036] The system call of the process in the container exceeds the permission range of the process;

[0037] The system call of the process in the container exceeds the range of system calls that can be used by the process;

[0038] The parameter content in the system call of the process in the container includes the attack content.

[0039] Namespaces are used for isolation, and can achieve kernel-level isolation of system resources. By placing the system's global resources in different namespaces, the purpose of resource isolation is achieved. In this way, processes in the container can correspond to their own namespaces, and one process can correspond to multiple namespaces. Different namespaces are isolated in different aspects, so that the process can only see the world in the corresponding namespace, and processes in the same namespace can perceive each other's changes. Detection of processes in the container bypassing the corresponding namespace for operation is implemented to detect container escape. Once a process in the container bypasses the corresponding namespace for operation, for example, escapes to the host's namespace, and escapes to the namespace of other containers, the process's namespace has changed, indicating that the container has escaped. Therefore, in this embodiment, the namespace that is pre-established is the correct namespace corresponding to the process. It can be detected whether the current namespace of the process is inconsistent with the namespace pre-associated with the process. If it is inconsistent, it means that the namespace of the process has changed, and it can be considered that the container has escaped.

[0040] It is also possible to modify the detection of files outside the container for the process in the container, that is, to detect whether the operation object of the process exceeds the scope of the file whitelist associated with the process, so as to determine whether a container escape has occurred, wherein the operation object can be understood as an operation file, that is, a file that the process needs to operate. In this embodiment, an operable file whitelist is pre-associated with the process, and it is detected whether the operation object of the process exceeds the scope of the file whitelist associated with the process, that is, it means detecting whether the operation object of the process is in the file whitelist associated with the process. If it is in the file whitelist associated with the process, it means that the operation object of the process does not exceed the scope of the file whitelist associated with the process. If it is not in the file whitelist associated with the process, it means that the operation object of the process exceeds the scope of the file whitelist associated with the process, and it can be considered that a container escape has occurred.

[0041] It is also possible to bypass the detection of Capabilities for operations on processes within the container. The Capabilities mechanism performs fine-grained control over root (root user) permissions. Linux (operating system) divides the privileges traditionally associated with root into different units, called Capabilities. Capabilities exist as attributes of processes, and each unit can be enabled and disabled independently. In this way, the permission check process becomes: when performing a privileged operation, if the effective identity of the process is not root, check whether it has the Capabilities corresponding to the privileged operation, and use this to decide whether the privileged operation can be performed. Each process has a corresponding privilege range. In this way, in this embodiment, the permissions of the system calls in the process can be detected, that is, the system calls of the process are detected to exceed the Capabilities permission range of the process. If it exceeds, it is considered that a container escape has occurred.

[0042] It is also possible to detect the operation of the process in the container bypassing seccomp. The seccomp mechanism (sandbox mechanism) is used to limit the process's access to system calls. From the system call number to the system call parameters, all can be checked and restricted. It can be understood that the system calls that can be used by the process can be limited through the seccomp mechanism. In this way, in this embodiment, it is also possible to detect whether the system call of the process in the container exceeds the range of the system calls that can be used by the process. If it exceeds, it is considered that the container escape has occurred.

[0043] In addition, if the write operation of the process in the container carries attack content, the attack content will be associated with the host file system, which is likely to cause security risks. Generally speaking, the attacker writes the attack content back to the host file system through the leaked file descriptor and waits for the next execution. The exploit has obvious characteristics, for example, it will contain a script-like rebound shell (shell is commonly known as shell (used to distinguish it from the core), which refers to the software (command parser) that "provides an operating interface for the user"). In this way, in this embodiment, it can be determined whether a container escape has occurred by detecting whether the parameter content in the system call of the process in the container includes the attack content. If the parameter content in the system call of the process in the container includes the attack content, it is considered that a container escape has occurred.

[0044] That is, in this embodiment, as long as the current namespace of the process in the container is inconsistent with the namespace pre-associated with the process, the operation object of the process in the container exceeds the file whitelist range associated with the process, the system call of the process in the container exceeds the permission range of the process, the system call of the process in the container exceeds the range of the available system calls of the process, and the parameter content in the system call of the process in the container includes any of the attack contents, a container escape occurs. Multiple aspects can be considered to determine whether a container escape occurs, thereby improving the accuracy of container escape detection.

[0045] In one embodiment, detecting target content of a process in a container includes:

[0046] The system call of the process is intercepted to detect whether the current namespace of the process is inconsistent with the namespace pre-associated with the process.

[0047] Before the process initiates actual operation, the system call of the process is hooked to detect whether the current namespace of the process is inconsistent with the namespace pre-associated with the process, thereby avoiding unsafe situations caused by the process performing actual operations during the detection process and improving system security.

[0048] like Figure 2 As shown, in one embodiment, before detecting the target content of the process in the container, it also includes:

[0049] Step S2001: pre-generate a label of a process in the container, wherein the label of the process is used to uniquely identify the identity of the process;

[0050] Step S2002: Associating the process label with the corresponding namespace.

[0051] In this embodiment, detecting whether the current namespace of the process is inconsistent with the namespace pre-associated with the process includes: detecting whether the current namespace of the process is inconsistent with the namespace pre-associated with the label of the process.

[0052] You can create a label for the process on the server in advance, and associate the process label with the namespace corresponding to the process. The process label is used to uniquely identify the identity of the process, and can also indicate the type and tenant of the process. In the process of detecting whether the current namespace of the process is inconsistent with the namespace pre-associated with the process, you can detect whether the current namespace of the process is inconsistent with the namespace pre-associated with the process label.

[0053] That is, in this embodiment, a label is established for the process in advance, and the label of the process is pre-associated with the corresponding namespace. In the process of detecting whether the current namespace of the process is inconsistent with the namespace pre-associated with the process, it is sufficient to detect whether the current namespace of the process is inconsistent with the namespace pre-associated with the label of the process, so as to improve the accuracy of process namespace detection, thereby improving the accuracy of container escape detection.

[0054] In one embodiment, detecting target content of a process in a container includes:

[0055] Intercept the system call of the process and detect whether the operation object of the process in the container exceeds the range of the file whitelist associated with the process.

[0056] Before the process initiates actual operation, the system call of the process is hooked to detect whether the operation object of the process exceeds the file whitelist range pre-associated with the process, thereby avoiding unsafe situations caused by the process performing actual operations during the detection process and improving system security.

[0057] like Figure 3 As shown, in one embodiment, before detecting the target content of the process in the container, it also includes:

[0058] Step S3001: pre-generate a label of a process in the container, wherein the label of the process is used to uniquely identify the identity of the process;

[0059] Step S3002: Associating the process tag with a file whitelist.

[0060] In this embodiment, detecting whether the operation object of the process in the container exceeds the scope of the file whitelist associated with the process includes: detecting whether the operation object of the process exceeds the scope of the file whitelist pre-associated with the tag of the process.

[0061] You can pre-tag the process on the server and associate the process tag with the file whitelist corresponding to the process. The process tag is used to uniquely identify the identity of the process and can also indicate the type and tenant of the process. In the process of detecting whether the current file whitelist of the process exceeds the file whitelist pre-associated with the process, you can detect whether the operation object of the process exceeds the file whitelist pre-associated with the process tag.

[0062] That is, in this embodiment, a label is established for the process in advance, and the label of the process is pre-associated with the corresponding file whitelist. In the process of detecting whether the current file whitelist of the process exceeds the file whitelist pre-associated with the process, it is sufficient to detect whether the operation object of the process exceeds the file whitelist pre-associated with the label of the process, so as to improve the accuracy of the process file whitelist detection, thereby improving the accuracy of container escape detection.

[0063] The process of the above container escape method is described in detail below with reference to a specific embodiment.

[0064] At present, in the process of container escape detection, the system call sequence of the process in the container is analyzed and classified through a decision tree to match a certain attack mode to determine whether a container escape has occurred. However, this method is prone to bypass and the detection accuracy is low. Alternatively, by monitoring sensitive files on the host machine, if the file content is tampered with, it is determined that an escape has occurred. However, monitoring sensitive files is prone to misjudgment when making changes, resulting in invalid alarms, and the method of scanning sensitive files is prone to missed detection within the time window. In this way, the present application provides a container escape detection method, which can improve the accuracy of container escape detection by detecting container escapes through multiple aspects.

[0065] For example, it is possible to detect operations that bypass the namespace of a process within a container, including escaping to the host namespace and the namespace of other containers.

[0066] First, a process label can be established in advance for the process on the machine (for example, the server) using a certain MAC (Mandatory Access Control) method. The label can indicate the type and tenant of the process, and the process label is associated with the corresponding namespace of the process when the container is started. Then the system call in the process is hooked, and before the actual operation is initiated, the process label and the corresponding namespace permission are checked, that is, whether the current namespace of the process in the container is inconsistent with the namespace pre-associated with the process. If they are inconsistent, it is confirmed that the container escape has occurred.

[0067] For another example, the detection of files outside the container can be modified for the process inside the container.

[0068] First, a process label can be established in advance for the process on the machine using a certain MAC method. The label can indicate the type and tenant of the process, and the label can be associated with the accessible file whitelist when the container is started. Then, the system call of the process is hooked, and before the actual operation is initiated, the process label and the corresponding operation object permission check are performed, that is, whether the operation object of the process in the container exceeds the file whitelist range associated with the process. If it exceeds, it is confirmed that the container escape has occurred.

[0069] For another example, detection can be performed on processes in a container that bypass capability operations.

[0070] The system call sequence of the process in the container can be restricted and audited through audit (kernel audit module, which can record various actions and time in the system). If it exceeds the limit of its capability, an alarm will be issued.

[0071] For another example, the process in the container can be detected by bypassing seccomp.

[0072] Audit is used to limit and audit the system call sequence of processes within the container. If any process exceeds the seccomp limit, an alarm is issued.

[0073] In addition, sensitive patterns in process write operations within the container can be detected.

[0074] Generally speaking, an attacker can write the attack content back to the host file system through the leaked file descriptor and wait for the next execution. The exploit has obvious characteristics. For example, it may contain a script-like rebound shell. The parameter content can be checked in the system call. If it is found to include the attack content, it is confirmed that the container escape has occurred.

[0075] Through the container escape detection method of the above-mentioned embodiment of the present application, container escape detection can be performed from multiple aspects. As long as the container escape is detected by any one method, the container escape is confirmed to have occurred, and an early warning message is output to remind the occurrence of the container escape, so as to facilitate the subsequent adoption of corresponding measures and improve the accuracy of container escape detection.

[0076] like Figure 4 As shown, according to an embodiment of the present application, the present application also provides a container escape detection device 400, which can be applied to a server, and the device includes:

[0077] The detection module 401 is used to detect the target content of the process in the container to determine whether the container escape occurs, wherein the target content includes: at least one of the current namespace, the operation object, and the system call:

[0078] The output module 402 is used to output warning information when it is determined that the container escape occurs.

[0079] In one embodiment, a container escape is determined to have occurred in any of the following situations:

[0080] The current namespace of the process in the container is inconsistent with the namespace pre-associated with the process;

[0081] The operation object of the process in the container exceeds the scope of the file whitelist associated with the process;

[0082] The system call of the process in the container exceeds the permission range of the process;

[0083] The system call of the process in the container exceeds the range of system calls that can be used by the process;

[0084] The parameter content in the system call of the process in the container includes the attack content.

[0085] In one embodiment, detecting target content of a process in a container includes:

[0086] The system call of the process is intercepted to detect whether the current namespace of the process is inconsistent with the namespace pre-associated with the process.

[0087] like Figure 5 As shown, in one embodiment, the device further includes:

[0088] A first label generation module 5001 is used to pre-generate a label for a process in the container, wherein the label of the process is used to uniquely identify the identity of the process;

[0089] A first associating module 5002, used to associate a label of a process with a corresponding namespace;

[0090] Check whether the current namespace of the process is inconsistent with the namespace previously associated with the process, including:

[0091] Checks whether the current namespace of the process is inconsistent with the namespace previously associated with the process's labels.

[0092] In one embodiment, detecting target content of a process in a container includes:

[0093] Intercept the system call of the process and detect whether the operation object of the process in the container exceeds the file whitelist range associated with the process.

[0094] like Figure 6 As shown, in one embodiment, the device further includes:

[0095] The second label generation module 6001 is used to pre-generate a label for a process in the container, wherein the label of the process is used to uniquely identify the identity of the process;

[0096] The second association module 6002 is used to associate the tag of the process with the file whitelist;

[0097] Check whether the operation object of the process in the container exceeds the scope of the file whitelist associated with the process, including:

[0098] Check whether the operation object of the process exceeds the scope of the file whitelist pre-associated with the process tag.

[0099] A container escape detection device in each of the above-mentioned embodiments is a device for implementing a container escape detection method in each of the above-mentioned embodiments, and the technical features and technical effects correspond to each other, which will not be repeated here.

[0100] According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.

[0101] like Figure 7 , is a block diagram of an electronic device for a container escape detection method according to an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0102] like Figure 7As shown, the electronic device includes: one or more processors 701, a memory 702, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphic information of the GUM on an external input / output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 701 is taken as an example.

[0103] The memory 702 is a non-transitory computer-readable storage medium provided in the present application. The memory stores instructions executable by at least one processor to enable the at least one processor to perform a container escape detection method provided in the present application. The non-transitory computer-readable storage medium of the present application stores computer instructions, which are used to enable a computer to perform a container escape detection method provided in the present application.

[0104] The memory 702 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to a container escape detection method in an embodiment of the present application (for example, the attached Figure 4 The processor 701 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 702, that is, a container escape detection method in the above method embodiment is implemented.

[0105] The memory 702 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device displayed by the keyboard, etc. In addition, the memory 702 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 702 may optionally include a memory remotely arranged relative to the processor 701, and these remote memories may be connected to the electronic device displayed by the keyboard via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0106] An electronic device for a container escape detection method may further include: an input device 703 and an output device 704. The processor 701, the memory 702, the input device 703 and the output device 704 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.

[0107] The input device 703 can receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device displayed by the keyboard, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 704 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.

[0108] Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, dedicated ASMCs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0109] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0110] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0111] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0112] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0113] According to the technical solution of the embodiment of the present application, the target content of the process in the container is detected to determine whether a container escape occurs, and the target content includes: at least one of the current namespace, the operation object, and the system call. That is, at least one of the current namespace, the operation object, and the system call of the process in the container is detected to determine whether a container escape occurs, which can improve the accuracy of container escape detection.

[0114] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.

[0115] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A container escape detection method, wherein: The method comprises: Detecting the target content of the process in the container to determine whether a container escape occurs, wherein the target content includes: a current namespace, an operation object, and a system call; When it is determined that a container escape has occurred, an early warning message is output; The method comprises: determining that a container escape occurs when a current namespace of the process in the container is inconsistent with a namespace pre-associated with the process; The detecting of the target content of the process in the container includes: Intercepting a system call of the process and detecting whether a current namespace of the process is inconsistent with a namespace pre-associated with the process; Before detecting the target content of the process in the container, the method further includes: Pre-generating a label of the process in the container, wherein the label of the process is used to uniquely identify the identity of the process; Associating the label of the process with the corresponding namespace; The detecting whether the current namespace of the process is inconsistent with the namespace pre-associated with the process includes: It is detected whether a current namespace of the process is inconsistent with the namespace pre-associated with the label of the process.

2. The method according to claim 1, wherein: The method further determines that a container escape has occurred in any of the following situations: The operation object of the process in the container exceeds the scope of the file whitelist associated with the process; The system call of the process in the container exceeds the permission scope of the process; The system call of the process in the container exceeds the range of available system calls of the process; The parameter content in the system call of the process in the container includes attack content.

3. The method according to claim 1, wherein: The detecting of the target content of the process in the container includes: The system call of the process is intercepted to detect whether the operation object of the process in the container exceeds the range of the file whitelist associated with the process.

4. The method according to claim 3, wherein: Before detecting the target content of the process in the container, the method further includes: Pre-generating a label of the process in the container, wherein the label of the process is used to uniquely identify the identity of the process; Associating the tag of the process with a file whitelist; The detecting whether the operation object of the process in the container exceeds the range of the file whitelist associated with the process includes: It is detected whether the operation object of the process exceeds the scope of the file whitelist pre-associated with the tag of the process.

5. A container escape detection device, wherein: The device comprises: A detection module is used to detect the target content of the process in the container to determine whether the container escape occurs, wherein the target content includes: the current namespace, the operation object, and the system call; An output module is used to output warning information when it is determined that a container escape occurs; Wherein, the device is used to determine that a container escape has occurred when a current namespace of the process in the container is inconsistent with a namespace pre-associated with the process; The detecting of the target content of the process in the container includes: Intercepting a system call of the process and detecting whether a current namespace of the process is inconsistent with a namespace pre-associated with the process; The device also includes: A first label generation module, used to pre-generate a label for a process in the container, wherein the label of the process is used to uniquely identify the identity of the process; A first associating module, configured to associate the label of the process with a corresponding namespace; The detecting whether the current namespace of the process is inconsistent with the namespace pre-associated with the process includes: It is detected whether a current namespace of the process is inconsistent with the namespace pre-associated with the label of the process.

6. The device according to claim 5, wherein: The device is also used to determine that a container escape has occurred in any of the following situations: The operation object of the process in the container exceeds the scope of the file whitelist associated with the process; The system call of the process in the container exceeds the permission scope of the process; The system call of the process in the container exceeds the range of available system calls of the process; The parameter content in the system call of the process in the container includes attack content.

7. The device according to claim 5, wherein: The detecting of the target content of the process in the container includes: The system call of the process is intercepted to detect whether the operation object of the process in the container exceeds the range of the file whitelist associated with the process.

8. The device according to claim 7, wherein: Also includes: A second label generation module, used to pre-generate a label for the process in the container, wherein the label of the process is used to uniquely identify the identity of the process; A second associating module, used to associate the tag of the process with a file whitelist; The detecting whether the operation object of the process in the container exceeds the range of the file whitelist associated with the process includes: It is detected whether the operation object of the process exceeds the scope of the file whitelist pre-associated with the tag of the process.

9. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 4.