A security reinforcement method, device, equipment and medium

By controlling the activation of the virtual machine monitor's security mechanism during secure container startup, the problem of host attacks caused by Qemu vulnerabilities was resolved, thus achieving security hardening of the container environment and improving overall security.

CN115033302BActive Publication Date: 2024-11-26CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210591394.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-27
Publication Date
2024-11-26
Estimated Expiration
2042-05-27

AI Technical Summary

Technical Problem

The existing virtual machine monitor Qemu has a large number of vulnerabilities, which makes the host high risk of being attacked and damaged, and the security of the container environment is insufficient.

Method used

By reading the configuration file and parsing the target parameters when the secure container starts, the security mechanism of the virtual machine monitor can be controlled to be enabled, reducing its exposure to attacks. Specifically, the virtual machine monitor is hardened by setting the seccomp security mechanism.

Benefits of technology

It improves the security of the container environment, avoids the problem of host damage caused by attacks on the virtual machine monitor, and enhances overall security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115033302B_ABST
    Figure CN115033302B_ABST
Patent Text Reader

Abstract

The present application discloses a security reinforcement method, device, equipment and medium. If a secure container startup instruction is received, a configuration file with target parameters written in it is read, and a predefined parsing function in the target program is called to parse the target parameters in the configuration file. If the target parameters are used to indicate that the security mechanism of the virtual machine monitor is turned on, the target parameters are sent to the virtual machine monitor so that the virtual machine monitor is started based on the target parameters to control the opening of its own security mechanism. In the embodiment of the present application, the virtual machine monitor can be security reinforced by controlling the opening of the security mechanism of the virtual machine monitor, reducing the external attack exposure of the virtual machine monitor, thereby avoiding the problem of the virtual machine monitor being attacked and causing the host to be destroyed, and improving the security of the container environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of container security technology, and in particular to a security reinforcement method, device, equipment and medium. Background Art

[0002] As more and more enterprises begin to move to the cloud and their businesses generally begin to move to the cloud, cloud security has become a top priority for enterprise business protection. However, there is an essential connection between the cloud and containers, and cloud security is inseparable from container security. Of course, it is impossible to define cloud security independently of container security. Therefore, in order to ensure container security, the industry has proposed the concept of secure containers and has implemented and implemented various secure container solutions in a short period of time.

[0003] Among them, the secure container is mainly to prevent the container from escaping to the host, thereby causing unauthorized access to the host, and thus ensuring the stability of the container environment. The current technical solution used by the secure container is mainly to run the container on the client operating system (guestOS), and the guestOS runs on the virtual machine monitor (Qemu) of the host (Host). Therefore, even if the container escapes, it can only escape to the guestOS layer and cannot escape to the Host, thereby maximizing the security and stability of the Host. However, Qemu used by the secure container itself has many vulnerabilities and a large attack surface. For example, Qemu was exposed to 25 common vulnerabilities and exposures (Common Vulnerabilities & Exposures, CVE) in just seven months from January to August 2021. In the whole year of 2016, it even leaked 91 CVEs.

[0004] If Qemu is attacked, the host may be destroyed. Therefore, the protection of the host is still not high, and the security of the container environment is not high either. Summary of the invention

[0005] The present application provides a security reinforcement method, device, equipment and medium to solve the problem in the prior art that if a virtual machine monitor is attacked, the host may be destroyed.

[0006] In a first aspect, an embodiment of the present application provides a security reinforcement method, the method comprising:

[0007] If a secure container startup instruction is received, a configuration file in which target parameters are written is read, and a parsing function predefined in a target program is called to parse out the target parameters in the configuration file;

[0008] If the target parameter indicates that the security mechanism of the virtual machine monitor is turned on, the target parameter is sent to the virtual machine monitor, so that the virtual machine monitor is started based on the target parameter to control the opening of its own security mechanism.

[0009] Furthermore, after sending the target parameter to the virtual machine monitor, the method further includes:

[0010] A startup instruction is sent to the client operating system running on the virtual machine monitor, so that the client operating system completes startup.

[0011] In a second aspect, an embodiment of the present application further provides a security reinforcement method, the method comprising:

[0012] receiving target parameters sent by the security container;

[0013] If the target parameter indicates that the security mechanism of the virtual machine monitor is turned on, the virtual machine monitor is started based on the target parameter to control the security mechanism of the virtual machine monitor to be turned on.

[0014] Furthermore, the method further comprises:

[0015] Receive a query instruction on whether the virtual machine security mechanism is turned on;

[0016] Check whether the virtual machine monitor has turned on the security mechanism, obtain the checking result, and output the checking result, wherein if the security mechanism of the virtual machine monitor has been turned on, the checking result carries the target parameter.

[0017] In a third aspect, an embodiment of the present application further provides a security reinforcement device, the device comprising:

[0018] A parsing module, configured to read a configuration file in which target parameters are written if a secure container startup instruction is received, and call a predefined parsing function in a target program to parse out the target parameters in the configuration file;

[0019] The sending module is used for sending the target parameter to the virtual machine monitor if the target parameter indicates that the security mechanism of the virtual machine monitor is turned on, so that the virtual machine monitor is started based on the target parameter to control the opening of its own security mechanism.

[0020] Furthermore, the sending module is further used to send a startup instruction to the client operating system running on the virtual machine monitor, so that the client operating system completes startup.

[0021] In a fourth aspect, an embodiment of the present application further provides a security reinforcement device, the device comprising:

[0022] A receiving module, used for receiving target parameters sent by the secure container;

[0023] The control module is used for starting based on the target parameter to control the opening of its own security mechanism if the target parameter indicates that the security mechanism of the virtual machine monitor is turned on.

[0024] Furthermore, the receiving module is also used to receive a query instruction on whether the virtual machine security mechanism is turned on;

[0025] The device also includes:

[0026] The processing module is used to check whether the virtual machine monitor has turned on the security mechanism, obtain the checking result, and output the checking result, wherein if the security mechanism of the virtual machine monitor has been turned on, the checking result carries the target parameter.

[0027] In a fifth aspect, an embodiment of the present application further provides an electronic device, which includes at least a processor and a memory, and the processor is used to implement the steps of any of the security reinforcement methods described above when executing a computer program stored in the memory.

[0028] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of any of the security reinforcement methods described above.

[0029] In a seventh aspect, an embodiment of the present application further provides an electronic device, which includes at least a processor and a memory, and the processor is used to implement the steps of any of the security reinforcement methods described above when executing a computer program stored in the memory.

[0030] In an eighth aspect, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of any of the security reinforcement methods described above.

[0031] If a secure container startup instruction is received, the configuration file with the target parameters written in it is read, and the predefined parsing function in the target program is called to parse the target parameters in the configuration file. If the target parameters are used to indicate that the security mechanism of the virtual machine monitor is turned on, the target parameters are sent to the virtual machine monitor so that the virtual machine monitor is started based on the target parameters to control the opening of its own security mechanism. In the embodiment of the present application, the virtual machine monitor can be security-reinforced by controlling the opening of the security mechanism of the virtual machine monitor, reducing the external attack exposure of the virtual machine monitor, thereby avoiding the problem of the virtual machine monitor being attacked and causing the host to be destroyed, thereby improving the security of the container environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0033] Figure 1 A schematic diagram of a security reinforcement process provided in an embodiment of the present application;

[0034] Figure 2 A schematic diagram of a security reinforcement process of a virtual machine monitor provided in some embodiments of the present application;

[0035] Figure 3 A schematic diagram of a client operating system startup process provided by some embodiments of the present application;

[0036] Figure 4 A schematic diagram of a security reinforcement process provided in an embodiment of the present application;

[0037] Figure 5a A schematic diagram of a process for obtaining a configuration file provided in some embodiments of the present application;

[0038] Figure 5b A schematic diagram of a process for obtaining a configuration file provided in some embodiments of the present application;

[0039] Figure 5c A schematic diagram of a process for obtaining a configuration file provided in some embodiments of the present application;

[0040] Figure 6 An overall framework of a virtual machine monitor before reinforcement provided in an embodiment of the present application;

[0041] Figure 7 A reinforced overall framework of a virtual machine monitor provided in an embodiment of the present application;

[0042] Figure 8 A schematic diagram of the structure of a security reinforcement device provided in some embodiments of the present application;

[0043] Fig. 9 A schematic diagram of the structure of a security reinforcement device provided in some embodiments of the present application;

[0044] Fig.10 A schematic diagram of the structure of an electronic device provided in some embodiments of the present application;

[0045] Fig.11 A schematic diagram of the structure of an electronic device provided for some embodiments of the present application. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0047] If a secure container startup instruction is received, the configuration file is read and a pre-defined parsing function is called to parse the target parameters in the configuration file. If the target parameters are used to indicate that the security mechanism of the virtual machine monitor is turned on, the target parameters are sent to the virtual machine monitor so that the virtual machine monitor is started based on the target parameters to control the opening of its own security mechanism.

[0048] In order to prevent the host from being destroyed when the virtual machine monitor is attacked, the embodiments of the present application provide a security reinforcement method, apparatus, device and medium.

[0049] Figure 1 A schematic diagram of a security reinforcement process provided in an embodiment of the present application, the process includes the following steps:

[0050] S101: If a secure container startup instruction is received, a configuration file in which target parameters are written is read, and a parsing function predefined in a target program is called to parse out the target parameters in the configuration file.

[0051] The security reinforcement method provided in the embodiment of the present application is applied to a secure container, and the security reinforcement method provided in the embodiment of the present application is mainly used to perform security reinforcement on a virtual monitor.

[0052] In an embodiment of the present application, after receiving the secure container startup instruction, the secure container performs a startup operation. Specifically, the secure container first reads a pre-saved configuration file with target parameters written in it, wherein the configuration file with target parameters written in it is a configuration file generated by compiling after the developer pre-writes a program with parameter assignment fields written in it, assigns the target parameters to the parameter assignment fields, and then calls a pre-defined parsing function in the target program to parse the target parameters in the configuration file, wherein the target parameters indicate whether the security mechanism of the virtual machine monitor is turned on. The target program is a program with parsing function that is pre-existing and saved in the secure container itself.

[0053] Among them, calling the pre-defined parsing function in the target program to parse the configuration file is a prior art and will not be described in detail here.

[0054] Specifically, the target parameter can be pre-set to on, indicating that the security mechanism of the virtual machine monitor is turned on, and the target parameter can be pre-set to off, indicating that the security mechanism of the virtual machine monitor is not turned on. Specifically, the target parameters corresponding to when turned on and the target parameters corresponding to when turned off can be configured according to needs, and the configuration can be carried out in the form of multiple specific parameter combinations to achieve different security control levels and control ranges, which are not limited here.

[0055] S102: If the target parameter indicates that the security mechanism of the virtual machine monitor is turned on, the target parameter is sent to the virtual machine monitor, so that the virtual machine monitor is started based on the target parameter to control the turning on of its own security mechanism.

[0056] In order to prevent the host from being destroyed when the virtual machine monitor is attacked, in an embodiment of the present application, the security mechanism of the virtual machine monitor can be turned on.

[0057] Specifically, if the target parameter indicates that the security mechanism of the virtual machine monitor is turned on, the security container can send the target parameter to the virtual machine monitor so that the virtual machine monitor can be started based on the target parameter to control the opening of its own security mechanism, thereby realizing the security reinforcement of the virtual monitor. Among them, the security reinforcement of the virtual monitor is equivalent to introducing a security mechanism between the virtual machine monitor and the host, thereby improving the overall security of the container environment. In this application, the security mechanism is the Linux security mechanism (seccomp).

[0058] If the target parameter does not indicate that the security mechanism of the virtual machine monitor is turned on, the security mechanism of the virtual machine monitor cannot be turned on after the subsequent virtual monitor is started.

[0059] In the embodiment of the present application, the virtual machine monitor can be security-hardened by turning on the security mechanism of the virtual machine monitor, thereby reducing the exposure of the virtual machine monitor to external attacks, thereby avoiding the problem of the virtual machine monitor being attacked and causing the host to be destroyed, thereby improving the security of the container environment.

[0060] In order to fully open the security mechanism of the virtual machine monitor, based on the above embodiment, in the embodiment of the present application, after sending the target parameter to the virtual machine monitor, the method further includes:

[0061] A startup instruction is sent to the client operating system running on the virtual machine monitor, so that the client operating system completes startup.

[0062] In the embodiment of the present application, since the client operating system is running on the virtual machine monitor, after the security container sends the target parameters to the virtual machine monitor so that the virtual machine monitor is started based on the target parameters to control the opening of its own security mechanism, in the embodiment of the present application, the security container can also send a startup instruction to the client operating system running on the virtual machine monitor so that the client operating system is fully started. After the client operating system is fully started, the security mechanism of the virtual machine monitoring system will be fully opened.

[0063] Figure 2 A schematic diagram of a security reinforcement process of a virtual machine monitor provided in some embodiments of the present application; Figure 3 A schematic diagram of a client operating system startup process provided in some embodiments of the present application. Figure 2 and Figure 3 Provide explanation.

[0064] Read the configuration file (configuration.toml), and call the pre-defined parsing function in the target program to parse the target parameter (seccompsandbox parameter) in the configuration file, and then send the target parameter to the virtual machine monitor so that the virtual machine monitor can start based on the target parameter to control its own security mechanism to open, such as Figure 2 shown.

[0065] After the virtual machine monitor's security mechanism is turned on, the client operating system (guestOS) will be started immediately, and then the virtual machine monitor's security reinforcement will be completed. Figure 3 shown.

[0066] Figure 4 A schematic diagram of a security reinforcement process provided in an embodiment of the present application, the process includes the following steps:

[0067] S401: Receive target parameters sent by a secure container.

[0068] The security reinforcement method provided in the embodiment of the present application is applied to a virtual machine monitor.

[0069] In an embodiment of the present application, in order to protect the host from being damaged, the security container will send the acquired target parameter to the virtual machine monitor. The target parameter can be a parameter indicating that the security mechanism of the virtual machine monitor is turned on, or it can be a parameter indicating that the security mechanism of the virtual machine monitor is not turned on. The virtual machine monitor will receive the target parameter sent by the security container.

[0070] In an embodiment of the present application, when the target parameter is pre-set to on, it indicates that the security mechanism of the virtual machine monitor is turned on, and when the target parameter is pre-set to off, it indicates that the security mechanism of the virtual machine monitor is not turned on. Specifically, the target parameters corresponding to when turned on and the target parameters corresponding to when turned off can be configured according to needs, and the configuration can be carried out in the form of multiple specific parameter combinations to achieve different security control levels and control ranges, which are not limited here.

[0071] S402: If the target parameter indicates that the security mechanism of the virtual machine monitor is turned on, start based on the target parameter to control the security mechanism of the virtual machine monitor to turn on.

[0072] If the target parameter indicates that the security mechanism of the virtual machine monitor is turned on, the virtual machine monitor is started based on the target parameter, and then the security mechanism of the virtual machine monitor is controlled to be turned on, so as to achieve security reinforcement of the virtual machine monitor.

[0073] In order to facilitate the user to determine whether the security mechanism of the virtual machine monitor is turned on, based on the above embodiments, in the embodiment of the present application, the method further includes:

[0074] Receive a query instruction on whether the virtual machine security mechanism is turned on;

[0075] Check whether the virtual machine monitor has turned on the security mechanism, obtain the checking result, and output the checking result, wherein if the security mechanism of the virtual machine monitor has been turned on, the checking result carries the target parameter.

[0076] In the embodiment of the present application, in order to facilitate the user to determine whether the security mechanism of the virtual machine monitor is turned on, the result information of whether the security mechanism of the virtual machine monitor is turned on can be output.

[0077] Specifically, in order to determine whether the security mechanism of the virtual machine monitor is turned on, in an embodiment of the present application, a query instruction can be sent to the virtual machine monitor. When the virtual machine monitor receives the query instruction on whether the security mechanism of the virtual machine is turned on, it can check whether the security mechanism of the virtual machine is turned on, obtain the corresponding check result, and output the check result.

[0078] Specifically, the inspection result can be output in the form of text or voice. For example, the text "the virtual machine monitor has turned on the security mechanism" can be output, or the voice "the virtual machine monitor has turned on the security mechanism" can be output.

[0079] In the embodiment of the present application, since the corresponding target parameters are set in advance for whether the security mechanism of the virtual machine monitor has been turned on, in the embodiment of the present application, the inspection result can also carry the result of the target parameter. For example, if the corresponding target parameter is on when the security mechanism of the virtual machine monitor is already turned on, then after querying that the security mechanism of the virtual machine monitor has been turned on, it can output "the status of the virtual machine monitor is on" and so on.

[0080] For the convenience of description, a specific example is used to illustrate:

[0081] In order to achieve security reinforcement, the developer first pre-writes a program with a parameter assignment field, assigns the target parameter to the parameter assignment field, and then compiles and generates a configuration file with the target parameter written in it. After receiving the security container startup instruction, the security container reads the configuration file and calls the pre-defined parsing function in the target program to parse the target parameter in the configuration file. If the target parameter indicates that the security mechanism of the virtual machine monitor is turned on, the target parameter is sent to the virtual machine monitor. After receiving the target parameter, the virtual machine monitor is started based on the target parameter to control the opening of its own security mechanism.

[0082] Figure 5a-5c FIG. 1 is a schematic diagram of a process for obtaining a configuration file provided by some embodiments of the present application; Figure 5a-5c Provide explanation.

[0083] The first step to obtain the configuration file is: the developer modifies the Makefile of the Kata Runtime part and adds a compile macro, which can be DEFSECCOMPSANDBOXPARAM. Specifically, the compile macro is used to control whether to turn on the security mechanism of the virtual machine monitor, wherein the security mechanism is equivalent to reducing the attack surface of the virtual machine monitor on the host by reducing the way that certain types of system calls are not allowed. In the embodiment of the present application, the following types of system calls may not be allowed: the virtual machine monitor is not allowed to use abandoned system calls, the virtual machine monitor is not allowed to increase the priority to use all setuid / gid system calls, qemu is not allowed to spawn new threads and processes, and the virtual machine monitor is not allowed to use process affinity and set scheduler priority, etc.

[0084] Specifically, the program corresponding to the newly added compilation macro can be:

[0085] DEFSECCOMPSANDBOXPARAM:=on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny

[0086] Among them, obsolete = deny: means that the virtual machine monitor is not allowed to use obsolete system calls; elevateprivileges = deny: means that the virtual machine monitor is not allowed to increase priority to use all setuid / gid system calls; spawn = deny: means that qemu is not allowed to spawn new threads and processes; resourcecontrol = deny: means that the virtual machine monitor is not allowed to use process affinity and set scheduler priority.

[0087] After modifying the Makefile, you can pass the modified Makefile to the Kata Runtime compilation system (kata Building System), see Figure 5a .

[0088] The second step to obtain the configuration file is to modify the configuration-qemu.toml.in configuration file of the underlying virtual machine monitor qemu of kata runtime and add the parameter seccompsandbox (target parameter) as follows:

[0089] seccompsandbox="@DEFSECCOMPSANDBOXPARAM@"

[0090] Specifically, when compiling Kata Runtime, the compilation system will automatically parse the definition of the DEFSECCOMPSANDBOXPARAM macro in the first step, and then pass it to the seccompsandbox parameter (target parameter) of configuration-qemu.toml.in, so that it can be parsed during the subsequent initialization of Kata Runtime. Then, the configuration-qemu.toml.in and the modified Makefile file in the first step are passed to the compilation system of Kata Runtime. See Figure 5b .

[0091] The third step to obtain the configuration file is to modify the structure hypervisorstruct of katautils config.go and add a new field called SeccompSandbox string'toml: ″seccompsandbox″. The new field is used to receive the seccompsandbox parameter content in the configuration-qemu.toml.in configuration file, so as to facilitate subsequent internal processing.

[0092] Specifically, the corresponding procedures are:

[0093]

[0094] The fourth step to obtain the configuration file is to modify the newQemuHypervisorConfig function implementation of katautils config.go, and add a new field SeccompSandbox: h.SeccompSandbox when generating the vc.HypervisorConfig structure.

[0095] The code path where newQemuHypervisorConfig is called is as follows:

[0096] loadRuntimeConfig

[0097] LoadConfiguration

[0098] updateRuntimeConfig

[0099] updateRuntimeConfigHypervisor

[0100] newQemuHypervisorConfig

[0101] The fifth step to obtain the configuration file is to modify the code of govmm and add a new field SeccompSandbox string to its data structure Config struct, which is used to receive the internal storage after parsing the configuration-qemu.toml.in configuration file.

[0102] Specifically, the corresponding procedures are:

[0103]

[0104] The sixth step to obtain the configuration file is to modify the code implementation of govmm and add a new function appendSeccompSandbox() to enable it to parse the seccompsandbox parameter of the toml configuration file.

[0105] Specifically, the corresponding procedures are:

[0106]

[0107] Among them, appendSeccompSandbox() is used to ensure that the subsequent target program can parse the configuration of configuration-qemu.toml.in. If the configuration-qemu.toml.in file is configured with the seccompsandbox parameter, this function will convert the parameter content into the startup command line parameter of the underlying virtual machine monitor of the Kata secure container, that is, the virtual machine monitor is started based on the seccompsandbox parameter to control its own security mechanism to open.

[0108] The seventh step to get the configuration file is to modify the LaunchQemu code to call appendSeccompSandbox() implemented in the third step:

[0109] Specifically, the corresponding procedures are:

[0110]

[0111] The LaunchQemu code is located in the following path:

[0112] createSandboxFromConfig

[0113] startVM

[0114] startSandbox

[0115] LaunchQemu

[0116] config.appendSandboxOn()

[0117] After completing steps 1 to 7, recompile the Kata Runtime module using the standard method.

[0118] Specifically, the compilation steps are as follows:

[0119] cd$GOPATH / src / github.com / kata-containers / kata-containers / src / runtime

[0120] make clean

[0121] Make

[0122] After the compilation is complete, you will get the Kata binary file containerd-shim-kata-v2 and the configuration text file configuration.toml (the configuration file with the target parameters written in it), see Figure 5c .

[0123] Figure 6 The overall framework of a virtual machine monitor before reinforcement is provided in an embodiment of the present application. Figure 7 The embodiment of the present application provides a virtual machine monitor reinforced overall framework, now for Figure 6 and Figure 7 Provide explanation.

[0124] Before the virtual machine monitor is hardened, when the secure container (container) is attacked, the client operating system (guestOS) may be compromised, see attack 1, but it is difficult to attack the host from the guestOS, that is, attack 2 will generally not occur. However, the attacker can attack the host from another angle, that is, attack from the virtual machine monitor (Qemu) side, see attack 3, causing the host to be destroyed, see Figure 6 .

[0125] After the virtual machine monitor has been hardened, that is, after the virtual machine monitor has turned on the security mechanism, when the security container is attacked, the client operating system (guestOS) may be breached, see attack 1. When the security container is attacked, it is difficult to attack the host from the guestOS, that is, attack 2 will generally not occur. Moreover, if the attacker attacks from the virtual machine monitor Qemu side, the host will not be damaged, that is, attack 3 will not occur.

[0126] Figure 8 A schematic diagram of a security reinforcement device structure provided in some embodiments of the present application, the device comprising:

[0127] The parsing module 801 is used to read the configuration file in which the target parameters are written if a secure container startup instruction is received, and call a predefined parsing function in the target program to parse out the target parameters in the configuration file;

[0128] The sending module 802 is used to send the target parameter to the virtual machine monitor if the target parameter indicates that the security mechanism of the virtual machine monitor is turned on, so that the virtual machine monitor is started based on the target parameter to control the opening of its own security mechanism.

[0129] In a possible implementation, the sending module 802 is further configured to send a startup instruction to the client operating system running on the virtual machine monitor, so that the client operating system completes startup.

[0130] Fig. 9 A schematic diagram of a security reinforcement device structure provided in some embodiments of the present application, the device comprising:

[0131] A receiving module 901 is used to receive target parameters sent by a secure container;

[0132] The control module 902 is used to start based on the target parameter to control the security mechanism of the virtual machine monitor to be turned on if the target parameter indicates that the security mechanism of the virtual machine monitor is turned on.

[0133] In a possible implementation, the receiving module 901 is further configured to receive a query instruction on whether the virtual machine security mechanism is enabled;

[0134] The device also includes:

[0135] The processing module 903 is used to check whether the virtual machine monitor has turned on the security mechanism, obtain the checking result, and output the checking result. If the security mechanism of the virtual machine monitor has been turned on, the checking result carries the target parameter.

[0136] Based on the above embodiments, some embodiments of the present application further provide an electronic device, such as Fig.10 As shown, it includes: a processor 1001 , a communication interface 1002 , a memory 1003 and a communication bus 1004 , wherein the processor 1001 , the communication interface 1002 , and the memory 1003 communicate with each other via the communication bus 1004 .

[0137] The memory 1003 stores a computer program. When the program is executed by the processor 1001, the processor 1001 performs the following steps:

[0138] If a secure container startup instruction is received, a configuration file in which target parameters are written is read, and a parsing function predefined in a target program is called to parse out the target parameters in the configuration file;

[0139] If the target parameter indicates that the security mechanism of the virtual machine monitor is turned on, the target parameter is sent to the virtual machine monitor, so that the virtual machine monitor is started based on the target parameter to control the opening of its own security mechanism.

[0140] Furthermore, the processor 1001 is further configured to send a startup instruction to the client operating system running on the virtual machine monitor, so that the client operating system completes startup.

[0141] The communication bus mentioned in the above server can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0142] The communication interface 1002 is used for communication between the above electronic device and other devices.

[0143] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0144] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0145] Based on the above embodiments, some embodiments of the present application further provide an electronic device, such as Fig.11 As shown, it includes: a processor 1101 , a communication interface 1102 , a memory 1103 and a communication bus 1104 , wherein the processor 1101 , the communication interface 1102 , and the memory 1103 communicate with each other via the communication bus 1104 .

[0146] The memory 1103 stores a computer program. When the program is executed by the processor 1101, the processor 1101 performs the following steps:

[0147] receiving target parameters sent by the security container;

[0148] If the target parameter indicates that the security mechanism of the virtual machine monitor is turned on, the virtual machine monitor is started based on the target parameter to control the security mechanism of the virtual machine monitor to be turned on.

[0149] Furthermore, the processor 1101 is also used to receive a query instruction on whether the virtual machine security mechanism is turned on;

[0150] Check whether the virtual machine monitor has turned on the security mechanism, obtain the checking result, and output the checking result, wherein if the security mechanism of the virtual machine monitor has been turned on, the checking result carries the target parameter.

[0151] The communication bus mentioned in the above server can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0152] The communication interface 1102 is used for communication between the above electronic device and other devices.

[0153] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0154] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0155] On the basis of the above embodiments, some embodiments of the present application further provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable by an electronic device, and when the program is run on the electronic device, the electronic device implements the following steps when executing:

[0156] If a secure container startup instruction is received, a configuration file in which target parameters are written is read, and a parsing function predefined in a target program is called to parse out the target parameters in the configuration file;

[0157] If the target parameter indicates that the security mechanism of the virtual machine monitor is turned on, the target parameter is sent to the virtual machine monitor, so that the virtual machine monitor is started based on the target parameter to control the opening of its own security mechanism.

[0158] Furthermore, after sending the target parameter to the virtual machine monitor, the method further includes:

[0159] A startup instruction is sent to the client operating system running on the virtual machine monitor, so that the client operating system completes startup.

[0160] On the basis of the above embodiments, some embodiments of the present application further provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable by an electronic device, and when the program is run on the electronic device, the electronic device implements the following steps when executing:

[0161] receiving target parameters sent by the security container;

[0162] If the target parameter indicates that the security mechanism of the virtual machine monitor is turned on, the virtual machine monitor is started based on the target parameter to control the security mechanism of the virtual machine monitor to be turned on.

[0163] Furthermore, the method further comprises:

[0164] Receive a query instruction on whether the virtual machine security mechanism is turned on;

[0165] Check whether the virtual machine monitor has turned on the security mechanism, obtain the checking result, and output the checking result, wherein if the security mechanism of the virtual machine monitor has been turned on, the checking result carries the target parameter.

[0166] In the embodiment of the present application, the virtual machine monitor can be security-hardened by controlling the opening of the security mechanism of the virtual machine monitor, thereby reducing the exposure of the virtual machine monitor to external attacks, thereby avoiding the problem of the virtual machine monitor being attacked and causing the host to be destroyed, thereby improving the security of the container environment.

[0167] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0168] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0169] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0170] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0171] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A security reinforcement method, characterized in that: Applied to a secure container, the method comprises: If a secure container startup instruction is received, a configuration file in which target parameters are written is read, and a parsing function predefined in a target program is called to parse out the target parameters in the configuration file; If the target parameter indicates that the security mechanism of the virtual machine monitor is turned on, the target parameter is sent to the virtual machine monitor, so that the virtual machine monitor is started based on the target parameter to control the opening of its own security mechanism; wherein the security mechanism is the Linux security mechanism seccomp; The process of obtaining the configuration file includes: Modify the Makefile of Kata Runtime, add a compile macro, modify the configuration file of kata runtime for the underlying virtual machine monitor qemu, add a new parameter seccompsandbox, and recompile the KataRuntime module using the standard method to obtain the configuration file, wherein the compile macro is used to control whether to turn on the security mechanism of the virtual machine monitor, and the new parameter seccompsandbox is used to parse the definition of the compile macro.

2. The method according to claim 1, characterized in that After sending the target parameter to the virtual machine monitor, the method further includes: A startup instruction is sent to the client operating system running on the virtual machine monitor, so that the client operating system completes startup.

3. A security reinforcement method, characterized in that: Applied to a virtual machine monitor, the method comprises: receiving target parameters sent by the security container; If the target parameter indicates that the security mechanism of the virtual machine monitor is turned on, starting based on the target parameter to control the security mechanism of the virtual machine monitor to turn on; The target parameters are written into a configuration file, and the configuration file is a Makefile of the KataRuntime part of the secure container, a new compilation macro is added, and the configuration file of the kata runtime for the underlying virtual machine monitor qemu is modified, and a new parameter seccompsandbox is added. The Kata Runtime module is recompiled using a standard method, wherein the compilation macro is used to control whether to turn on the security mechanism of the virtual machine monitor, and the new parameter seccompsandbox is used to parse the definition of the compilation macro.

4. The method according to claim 3, characterized in that The method further comprises: Receive a query instruction on whether the virtual machine security mechanism is turned on; Check whether the virtual machine monitor has turned on the security mechanism, obtain the checking result, and output the checking result, wherein if the security mechanism of the virtual machine monitor has been turned on, the checking result carries the target parameter.

5. A safety reinforcement device, characterized in that: Applied to a safety container, the device comprises: A parsing module, configured to read a configuration file in which target parameters are written if a secure container startup instruction is received, and call a predefined parsing function in a target program to parse out the target parameters in the configuration file; a sending module, configured to send the target parameter to the virtual machine monitor if the target parameter indicates that the security mechanism of the virtual machine monitor is turned on, so that the virtual machine monitor is started based on the target parameter to control the opening of its own security mechanism; wherein the security mechanism is the Linux security mechanism seccomp; The parsing module is specifically used to modify the Makefile of the Kata Runtime part, add a compile macro, and modify the configuration file of the kata runtime for the underlying virtual machine monitor qemu, add a new parameter seccompsandbox, and recompile the Kata Runtime module using a standard method to obtain the configuration file, wherein the compile macro is used to control whether to turn on the security mechanism of the virtual machine monitor, and the new parameter seccompsandbox is used to parse the definition of the compile macro.

6. The device according to claim 5, characterized in that The sending module is further used to send a startup instruction to the client operating system running on the virtual machine monitor, so that the client operating system completes the startup.

7. A safety reinforcement device, characterized in that: Applied to a virtual machine monitor, the device comprises: A receiving module, used for receiving target parameters sent by the secure container; A control module, configured to start the virtual machine monitor based on the target parameter and control the virtual machine monitor's own security mechanism to be turned on if the target parameter indicates that the virtual machine monitor's security mechanism is turned on; The target parameters are written into a configuration file, and the configuration file is a Makefile of the KataRuntime part of the secure container, a new compilation macro is added, and the configuration file of the kata runtime for the underlying virtual machine monitor qemu is modified, and a new parameter seccompsandbox is added. The Kata Runtime module is recompiled using a standard method, wherein the compilation macro is used to control whether to turn on the security mechanism of the virtual machine monitor, and the new parameter seccompsandbox is used to parse the definition of the compilation macro.

8. The device according to claim 7, characterized in that The receiving module is further used to receive a query instruction on whether the virtual machine security mechanism is turned on; The device also includes: The processing module is used to check whether the virtual machine monitor has turned on the security mechanism, obtain the checking result, and output the checking result, wherein if the security mechanism of the virtual machine monitor has been turned on, the checking result carries the target parameter.

9. An electronic device, characterized in that: The electronic device includes a processor and a memory, the memory is used to store program instructions, and the processor is used to implement the steps of the security reinforcement method described in any one of claims 1-2 or any one of claims 3-4 when executing the computer program stored in the memory.

10. A computer-readable storage medium, characterized in that: It stores a computer program, which, when executed by a processor, implements the steps of the security reinforcement method described in any one of claims 1-2 or any one of claims 3-4.