Container management method and device, equipment and storage medium

By receiving and parsing the DNS request packet of the container, it determines and encapsulates the security policy, which solves the security management problem in the container cloud environment, realizes safe and efficient container management, and avoids the security risks caused by open network interfaces.

CN118796331APending Publication Date: 2024-10-18中国移动通信集团江西有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311094127.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-28
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Existing technologies make it difficult to achieve security management in a container cloud environment. Traditional security protection systems cannot meet the flexible and rapidly changing needs of container technology, resulting in frequent security incidents. Moreover, the existing supervision method requires an open network policy, making it difficult to prohibit external-to-internal intrusions. attacks, and data collection is complex.

Method used

By receiving the DNS request packet of the container, parsing and obtaining the container information, determining and encapsulating the security policy, using the preset constraint algorithm to generate response messages, securely managing the container, avoiding opening network interfaces, using domain name resolution to report data, and achieving cross-network unification supervision.

Benefits of technology

It realizes the security management of containers, improves management efficiency and security, avoids security risks caused by open network interfaces, and simplifies the data collection process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796331A_ABST
    Figure CN118796331A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of computers, and discloses a container management method and device, equipment and a storage medium. The method comprises the following steps: receiving a DNS request packet reported by at least one container, and analyzing the DNS request packet to obtain container information; determining a container security policy based on the container information; packaging the container security policy according to a preset constraint algorithm to obtain a response message; and sending the response message to the container, wherein the container manages the container based on the container security policy in the response message. Due to the fact that container management is achieved, compared with an existing mode that the containers are managed by a third-party platform through an open network interface, the mode can safely supervise the containers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In recent years, with the widespread application of virtualization and container technology, security risks in container environments have gradually been exposed. Due to the modularity and high speed of container technology, most traditional security protection systems cannot meet the flexible and rapid changes in container cloud environments and have gradually become ineffective. Under the dual influence of the widespread application of container technology and the failure of traditional security equipment management, security incidents caused by container platforms have gradually shown a straight-line upward trend. In this context, container environment security and host security have reached a point where they can no longer be delayed, and more and more platform managers have begun to focus on the security protection of container environments.

[0003] The current management and control of container cluster environments mostly rely on customized third-party service platforms. Currently, the management and control of container clusters are mostly based on K8S tool interfaces. Under this condition, each container environment must open network interfaces or security policies to various service supervision platforms. When such service control platforms have problems, they will be able to attack all managed target container businesses. When the container supervision service supervises each container node, it will pass through various layers of network devices, including firewalls, switches, routers, etc. At the same time, if the same business is deployed in multiple networks, the container supervision control service is required to supervise across networks, especially when unified supervision of containers across Internet regions. The existing supervision methods have the following problems: 1. When the container supervision service node accesses each container node, it is necessary to open the network policy; if the security supervision requires prohibiting access from outside to inside, the technical model cannot be implemented. Affected by the security policy, it is prohibited to open conventional collection connection methods such as ssh, telnet, snmp, and ftp. 2. When reading data through the container group control tool K8S, it is necessary to develop an API interface, which is complex to implement. 3. When container services involve the Internet, they need to open Internet exposure surfaces, which will be subject to sniffing attacks from the outside to the inside of the Internet exposure surface... Therefore, how to achieve security and efficient management of containers has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The main purpose of the present invention is to provide a container management method, device, equipment and storage medium, aiming to solve the technical problems of the existing container management technology that is complex to implement and has low security.

[0005] To achieve the above object, the present invention provides a container management method, which is applied to container management services. The method comprises the following steps:

[0006] Receive a DNS request packet reported by at least one container, parse the DNS request packet, and obtain container information;

[0007] Determine a container security policy based on the container information;

[0008] Encapsulate the container security policy according to a preset constraint algorithm to obtain a response message;

[0009] The response message is sent to the container, and the container performs container management based on the container security policy in the response message.

[0010] Optionally, the container information includes container communication data and container parameter information, and the container security policy includes at least one of a container egress policy and a container ingress policy;

[0011] The step of determining the container security policy based on the container information includes:

[0012] Determine a container communication relationship and container risk information according to the container communication data and the container parameter information;

[0013] The container security policy is generated according to the container communication relationship and the container risk information.

[0014] Optionally, a domain name resolution service is deployed in the container management service;

[0015] The step of receiving a DNS request packet reported by at least one container, parsing the DNS request packet, and obtaining container information includes:

[0016] Receive a DNS request packet reported by at least one container, and obtain a domain name resolution request in the DNS request packet;

[0017] Resolving the domain name resolution request through the domain name resolution service to obtain a domain name resolution result;

[0018] The DNS request packet is parsed according to a preset parsing strategy to obtain a parsing result of the request packet, and the container information includes a domain name parsing result and the parsing result of the request packet.

[0019] Optionally, the step of encapsulating the container security policy according to a preset constraint algorithm includes:

[0020] Determine the domain name data packet format according to the preset constraint algorithm;

[0021] The container security policy is encapsulated based on the domain name data packet format.

[0022] In addition, to achieve the above object, the present invention also provides a container management method, which is applied to a container, and the container management method comprises the following steps:

[0023] Collect container communication data and container parameter information;

[0024] Based on a preset constraint algorithm, the container communication data and the container parameter information are message encapsulated to obtain a DNS request packet;

[0025] The DNS request packet is reported to the container management service in a domain name resolution manner.

[0026] Optionally, after the step of reporting the DNS request packet to the container management service in a domain name resolution manner, the method further includes:

[0027] Receive the response message fed back by the container management service;

[0028] Parsing the response message according to a preset domain name data packet format to obtain a parsing result;

[0029] Performing language conversion on the parsing result to obtain a recognizable container security policy;

[0030] Container management is performed based on the container security policy.

[0031] In addition, to achieve the above object, the present invention also provides a container management device, the device comprising:

[0032] A receiving module, configured to receive a DNS request packet reported by at least one container, parse the DNS request packet, and obtain container information;

[0033] A policy determination module, configured to determine a container security policy based on the container information;

[0034] An encapsulation module, used to encapsulate the container security policy according to a preset constraint algorithm to obtain a response message;

[0035] A sending module is used to send the response message to the container, and the container performs container management based on the container security policy in the response message.

[0036] In addition, to achieve the above object, the present invention also provides a container management device, the device comprising:

[0037] A collection module, used to collect container communication data and container parameter information;

[0038] An encapsulation module, used to encapsulate the container communication data and the container parameter information into messages based on a preset constraint algorithm to obtain a DNS request packet;

[0039] The reporting module is used to report the DNS request packet to the container management service in a domain name resolution manner.

[0040] In addition, to achieve the above-mentioned purpose, the present invention also proposes a container management device, which includes: a memory, a processor, and a container management program stored in the memory and executable on the processor, wherein the container management program is configured to implement the steps of the container management method described above.

[0041] In addition, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which a container management program is stored, and when the container management program is executed by a processor, the steps of the container management method described above are implemented.

[0042] The present invention receives a DNS request packet reported by at least one container, parses the DNS request packet, obtains container information; determines a container security policy based on the container information; encapsulates the container security policy according to a preset constraint algorithm to obtain a response message; sends the response message to the container, and the container performs container management based on the container security policy in the response message. Since the present invention is container management, compared with the existing method of managing containers through an open network interface to a third-party platform, the above method of the present invention can safely supervise containers. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a structural diagram of a container management device of a hardware operating environment involved in an embodiment of the present invention;

[0044] Figure 2 It is a flowchart of the first embodiment of the container management method of the present invention;

[0045] Figure 3 It is a schematic diagram of the architecture of the first embodiment of the container management method of the present invention;

[0046] Figure 4 It is a flowchart of a second embodiment of the container management method of the present invention;

[0047] Figure 5 It is a flowchart of a third embodiment of the container management method of the present invention;

[0048] Figure 6 is a structural block diagram of a first embodiment of a container management device of the present invention;

[0049] Figure 7 It is a structural block diagram of the second embodiment of the container management device of the present invention.

[0050] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0051] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0052] Reference Figure 1 , Figure 1 The diagram is a schematic diagram of the container management device structure of the hardware operating environment involved in the embodiment of the present invention.

[0053] like Figure 1 As shown, the container management device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyb oard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fid elity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable non-volatile memory (Non-Volatile Me mory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0054] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the container management device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0055] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a container management program.

[0056] exist Figure 1 In the container management device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the container management device of the present invention can be set in the container management device, and the container management device calls the container management program stored in the memory 1005 through the processor 1001, and executes the container management method provided by the embodiment of the present invention.

[0057] Based on the above container management device, an embodiment of the present invention provides a container management method, referring to Figure 2 , Figure 2 FIG. 1 is a flow chart of a first embodiment of a container management method according to the present invention.

[0058] In this embodiment, the container management method is applied to a container management service, and includes the following steps:

[0059] Step S10: receiving a DNS request packet reported by at least one container, parsing the DNS request packet, and obtaining container information.

[0060] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a mobile phone, a tablet computer, a personal computer, etc., or an electronic device or a container management service capable of implementing the above functions. The container management service is taken as an example to illustrate this embodiment and the following embodiments.

[0061] It should be noted that in this embodiment, the container-side data cannot be reported to the container management service by opening conventional SSH, tel net, snmp, ftp and other connections and collection methods. Therefore, the container information is reported to the container management service by means of a domain name resolution request. The DNS request package contains the domain name resolution request and the encapsulated container information. The container management service is installed with a domain name resolution service. The container information includes container communication data and container parameter information. The container communication data includes communication five-tuple information and timestamp information. The specific collected field information may include: source IP, source port, target IP, target port, protocol, timestamp, etc. The container parameter information is the information of the container itself, including version information, resource utilization, etc. This embodiment does not need to change the environment inside the container, nor does it need to connect to the cluster management platform API of the container.

[0062] Furthermore, due to the current intensification of network security attacks, container nodes cannot be opened to Internet access at will, resulting in the inability of related container monitoring third-party applications to directly monitor and control containers across the Internet through the Internet. Therefore, in this implementation, a domain name resolution service is deployed in the container management service, and the step S10 may include: receiving a DNS request packet reported by at least one container, and obtaining a domain name resolution request in the DNS request packet;

[0063] Resolving the domain name resolution request through the domain name resolution service to obtain a domain name resolution result;

[0064] The DNS request packet is parsed according to a preset parsing strategy to obtain a parsing result of the request packet, and the container information includes a domain name parsing result and the parsing result of the request packet.

[0065] It should be noted that in this embodiment, the container reports the DNS request packet in a manner according to the domain name resolution request. The domain name resolution request in the DNS request packet and the domain name to be resolved in the domain name resolution request may be the domain name of other services or other containers accessed by the current container. The preset resolution strategy may be a data resolution method corresponding to a preset constraint algorithm. The request packet resolution result includes container communication data and container parameter information, and the container information includes the domain name resolution result, the container communication data and the container parameter information. When analyzing the communication relationship between containers through container communication data, it is necessary to use the domain name resolution result to determine the address information of the communication container.

[0066] Step S20: Determine a container security policy based on the container information.

[0067] It should be noted that the security policy may be a management policy for the container, and may include at least one of a container export policy and a container import policy, wherein the container export policy may be a policy that restricts the container from accessing other containers or applications, and the container import policy may be a policy that restricts the container from receiving data sent by other containers or applications. The container import policy includes: source IP, source port, belonging label, target IP, target port, belonging label, protocol, time and other information. The container export policy includes: source IP, source port, belonging label, target IP, target port, belonging label, protocol, time and other information. For example, the container import policy includes that information sent by a preset address cannot be received, and the preset address may be an address in the container import policy that restricts receiving information. It may be that the preset address is identified to have a security risk, and the access of the preset address to the container is restricted. The determination of the container security policy based on the container information may be to query the security policy corresponding to the container according to the container information and the preset policy issuance mapping table. The policy issuance mapping table may be a pre-constructed mapping table containing container information and its corresponding security policy.

[0068] Step S30: Encapsulate the container security policy according to a preset constraint algorithm to obtain a response message.

[0069] It should be noted that the preset constraint algorithm may be an encapsulation algorithm in the related art. Encapsulating the container security policy according to the preset constraint algorithm may be encapsulating the container security policy according to a related data encapsulation algorithm to obtain a response message.

[0070] Further, in order to issue the container security policy in the form of domain name resolution, the step S30 may include: determining the domain name data packet format according to the preset constraint algorithm;

[0071] The container security policy is encapsulated based on the domain name data packet format.

[0072] It should be noted that encapsulating the container security policy based on the domain name data packet format may be encapsulating the container security policy into a domain name response message format according to the data packet format. Specifically, the policy information and timestamp of the container may be set as a 6-level domain name data packet: constructed according to S_IP-S_port, S-tag, D_IP-D_port, D-tag, Protocol, and Time. Specifically: S_IP-S_port is the source IP and source port information of the container in the outbound or inbound direction policy; S-tag is the label of the source of the visit in the outbound or inbound direction policy of the container; D_IP-D_port is the target IP and target port information in the outbound or inbound direction policy of the container; D-tag is the label of the container; Protocol is the outbound or inbound policy protocol of the container, and Time is the timestamp of the policy configuration.

[0073] Step S40: Send the response message to the container, and the container performs container management based on the container security policy in the response message.

[0074] It should be noted that sending the response message to the container may be a response to domain name resolution carried by the response message according to a standard DNS domain name resolution response process, and sending the response message to the container. The container managing the container based on the container security policy in the response message may be extracting the container security policy from the response message, and then issuing and applying the policy based on the container security policy.

[0075] In the specific implementation, please refer to Figure 3 , Figure 3 FIG. 1 is a schematic diagram of the architecture of the first embodiment of the container management method of the present invention. Figure 3 The container in the container collects data, then encapsulates the collected data, encapsulates it into a DNS request and reports it to the container management service. The container management service hijacks and parses the DNS signal packet, calculates the communication relationship between the containers, and obtains the container communication relationship topology diagram. At the same time, the container management service can actively or passively set the security policy of the container. Actively, the container management service can actively send the security policy to the container, and passively, when receiving the DNS request packet of the container, it can generate a security policy based on the container information in the DNS request packet. Then the security policy is encapsulated and sent to the container in the form of a domain name resolution response. The container receives the DNS reply packet, parses it, and translates it into a language that the container can recognize to send the policy.

[0076] This embodiment receives a DNS request packet reported by at least one container, parses the DNS request packet, obtains container information; determines a container security policy based on the container information; encapsulates the container security policy according to a preset constraint algorithm to obtain a response message; sends the response message to the container, and the container performs container management based on the container security policy in the response message. Since the present invention is container management, compared with the existing method of managing containers through an open network interface to a third-party platform, the above method of the present invention can safely supervise containers.

[0077] refer to Figure 4 , Figure 4 FIG. 4 is a flow chart of a second embodiment of a container management method according to the present invention.

[0078] Based on the above first embodiment, in this embodiment, step S20 includes:

[0079] Step S201: determining a container communication relationship and container risk information according to the container communication data and the container parameter information.

[0080] It should be noted that the container information includes container communication data and container parameter information, and the container security policy includes at least one of a container outbound policy and a container inbound policy. Determining the container communication relationship based on the container communication data and the container parameter information may be based on analyzing the information in the DNS request packets reported by all containers to obtain the communication relationship between the containers, and then summarizing and analyzing the communication relationship to obtain the communication topology relationship between all containers. The container communication relationship may be the communication topology relationship between all reported containers, and the communication relationship between the containers may be displayed in the form of a topology diagram. Determining the container risk information based on the container communication data and the container parameter information may be analyzing whether the original security policy of the container is relatively broad, whether there is a risk of being attacked, and whether the original parameter information needs to be adjusted, thereby obtaining the analysis result, i.e., the container risk information.

[0081] Step S202: Generate the container security policy according to the container communication relationship and the container risk information.

[0082] It should be noted that the generating of the container security policy according to the container communication relationship and the container risk information may be to determine at least one of the container egress policy and the container ingress policy according to the container communication relationship and the container risk information, or to shrink the original security policy of the container. For example, by analyzing the container information, it is determined that the original security policy of the container is relatively broad and the risk of being attacked is relatively large, then the container security policy may include shrinking the policy, etc.

[0083] In this embodiment, the container information includes container communication data and container parameter information, and the container security policy includes at least one of a container outbound policy and a container inbound policy; in this embodiment, the container communication relationship and container risk information are determined based on the container communication data and the container parameter information; and the container security policy is generated based on the container communication relationship and the container risk information. In this embodiment, the risk of the container being attacked can be reduced by analyzing the container information and generating the container security policy based on the container communication relationship and the container risk information, thereby achieving container management efficiency.

[0084] Based on the above embodiments, the present invention provides a container management method. Figure 5 , Figure 5 FIG. 4 is a flow chart of a third embodiment of a container management method according to the present invention.

[0085] In this embodiment, the container management method is applied to a container, and includes the following steps:

[0086] Step S001: Collect container communication data and container parameter information.

[0087] It should be noted that the container communication data includes communication quintuple information and timestamp information. The specific collected field information may include: source IP, source port, target IP, target port, protocol, timestamp, etc. The container parameter information is the information of the container itself, including version information, resource utilization, etc.

[0088] Step S002: encapsulating the container communication data and the container parameter information into messages based on a preset constraint algorithm to obtain a DNS request packet.

[0089] It should be noted that the preset constraint algorithm may be a pre-set encapsulation format that encapsulates the container communication data and the container parameter information into a domain name format. Specifically, it may be: the communication quintuple information, timestamp, and parameter information of the container are set as a 6-level domain name data packet: constructed according to S_IP-S_port, S-tag, D_IP-D_port, D-tag, Protocol-Time, and MEM-CPU. Among them, S_IP-S_port is the source IP and source port information of the visitor accessing the container; S-tag is the label of the visitor source accessing the container; D_IP-D_port is the target IP and target port information of the visitor accessing the container; D-tag is the label of the container; MEM-CPU is the container memory and CPU utilization data; Protocol-Time is the generated communication protocol and the generated timestamp.

[0090] Step S003: reporting the DNS request packet to the container management service in a domain name resolution manner.

[0091] It should be noted that the reporting of the DNS request packet to the container management service in the form of domain name resolution can be to carry the DNS request packet for resolution request according to the standard DNS domain name resolution process for the encapsulated DNS request packet. The DNS service address contained in the DNS request packet is the address of the container management service. The container management service receives the DNS request packet, resolves it according to the negotiated meaning of the 6-level domain name field, summarizes and calculates the resolved container information and the communication information resolved by the DNS of all other containers, and calculates the communication relationship generated by all containers.

[0092] Furthermore, the container also needs to receive the container security policy issued by the container management service, and perform container management based on the container security policy. After step S003, the process further includes: receiving a response message fed back by the container management service;

[0093] Parsing the response message according to a preset domain name data packet format to obtain a parsing result;

[0094] Performing language conversion on the parsing result to obtain a recognizable container security policy;

[0095] Container management is performed based on the container security policy.

[0096] It should be noted that the preset domain name data packet format may be a negotiated domain name data packet format, which is the same as the above encapsulation format, and is not described in detail in this embodiment. The language conversion of the parsing result may be translating the ingress and egress security policies in the parsing result into container security policies that can be recognized by the container.

[0097] This embodiment is a one-way network environment in which the container management service cannot directly access the container through the Internet to read data. The container data can be hidden in the DNS request message and reported to the container management service based on the domain name resolution process and the encapsulation of special multi-level domain name messages, thereby improving the security of container management.

[0098] This embodiment collects container communication data and container parameter information; based on a preset constraint algorithm, the container communication data and the container parameter information are message encapsulated to obtain a DNS request packet; the DNS request packet is reported to the container management service in the form of domain name resolution. This embodiment collects container information through the container, and then reports the container information to the container management service in the form of domain name resolution. It does not need to open the service port of the container application service to prevent the container application service from being attacked. Improve the security of container management.

[0099] Reference Figure 6 , Figure 6It is a structural block diagram of the first embodiment of the container management device of the present invention.

[0100] like Figure 6 As shown, the container management device proposed in the embodiment of the present invention includes:

[0101] The receiving module 10 is used to receive a DNS request packet reported by at least one container, parse the DNS request packet, and obtain container information;

[0102] A policy determination module 20, configured to determine a container security policy based on the container information;

[0103] The encapsulation module 30 is used to encapsulate the container security policy according to a preset constraint algorithm to obtain a response message;

[0104] The sending module 40 is used to send the response message to the container, and the container performs container management based on the container security policy in the response message.

[0105] This embodiment receives a DNS request packet reported by at least one container, parses the DNS request packet, obtains container information; determines a container security policy based on the container information; encapsulates the container security policy according to a preset constraint algorithm to obtain a response message; sends the response message to the container, and the container performs container management based on the container security policy in the response message. Since the present invention is container management, compared with the existing method of managing containers through an open network interface to a third-party platform, the above method of the present invention can safely supervise containers.

[0106] Reference Figure 7 , Figure 7 It is a structural block diagram of the second embodiment of the container management device of the present invention.

[0107] like Figure 7 As shown, the container management device proposed in the embodiment of the present invention includes:

[0108] A collection module 50, used to collect container communication data and container parameter information;

[0109] An encapsulation module 60 is used to encapsulate the container communication data and the container parameter information into a message based on a preset constraint algorithm to obtain a DNS request packet;

[0110] The reporting module 70 is used to report the DNS request packet to the container management service in a domain name resolution manner.

[0111] This embodiment collects container communication data and container parameter information; based on a preset constraint algorithm, the container communication data and the container parameter information are message encapsulated to obtain a DNS request packet; the DNS request packet is reported to the container management service in the form of domain name resolution. This embodiment collects container information through the container, and then reports the container information to the container management service in the form of domain name resolution. It does not need to open the service port of the container application service to prevent the container application service from being attacked. Improve the security of container management.

[0112] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.

[0113] In addition, for technical details not fully described in this embodiment, reference can be made to the container management method provided in any embodiment of the present invention, and will not be repeated here.

[0114] Based on the first embodiment of the container management device of the present invention, a second embodiment of the container management device of the present invention is proposed.

[0115] In this embodiment, the policy determination module 20 is further used to determine the container communication relationship and container risk information according to the container communication data and the container parameter information;

[0116] The container security policy is generated according to the container communication relationship and the container risk information.

[0117] Furthermore, the receiving module 10 is further configured to receive a DNS request packet reported by at least one container, and obtain a domain name resolution request in the DNS request packet;

[0118] Resolving the domain name resolution request through the domain name resolution service to obtain a domain name resolution result;

[0119] The DNS request packet is parsed according to a preset parsing strategy to obtain a parsing result of the request packet, and the container information includes a domain name parsing result and the parsing result of the request packet.

[0120] Furthermore, the encapsulation module 30 is also used to determine the domain name data packet format according to the preset constraint algorithm;

[0121] The container security policy is encapsulated based on the domain name data packet format.

[0122] Furthermore, the reporting module 70 is also used to receive a response message fed back by the container management service;

[0123] Parsing the response message according to a preset domain name data packet format to obtain a parsing result;

[0124] Performing language conversion on the parsing result to obtain a recognizable container security policy;

[0125] Container management is performed based on the container security policy.

[0126] Other embodiments or specific implementations of the container management device of the present invention may refer to the above-mentioned method embodiments, which will not be described in detail here.

[0127] In addition, an embodiment of the present invention further provides a storage medium, on which a container management program is stored. When the container management program is executed by a processor, the steps of the container management method described above are implemented.

[0128] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0129] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0130] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0131] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A container management method, characterized in that: Applied to container management services, the container management method comprises the following steps: Receive a DNS request packet reported by at least one container, parse the DNS request packet, and obtain container information; Determine a container security policy based on the container information; Encapsulate the container security policy according to a preset constraint algorithm to obtain a response message; The response message is sent to the container, and the container performs container management based on the container security policy in the response message.

2. The container management method according to claim 1, characterized in that: The container information includes container communication data and container parameter information, and the container security policy includes at least one of a container outbound policy and a container inbound policy; The step of determining the container security policy based on the container information includes: Determine a container communication relationship and container risk information according to the container communication data and the container parameter information; The container security policy is generated according to the container communication relationship and the container risk information.

3. The container management method according to claim 1, characterized in that: A domain name resolution service is deployed in the container management service; The step of receiving a DNS request packet reported by at least one container, parsing the DNS request packet, and obtaining container information includes: Receive a DNS request packet reported by at least one container, and obtain a domain name resolution request in the DNS request packet; Resolving the domain name resolution request through the domain name resolution service to obtain a domain name resolution result; The DNS request packet is parsed according to a preset parsing strategy to obtain a parsing result of the request packet, and the container information includes a domain name parsing result and the parsing result of the request packet.

4. The container management method according to claim 1, characterized in that: The step of encapsulating the container security policy according to a preset constraint algorithm includes: Determine the domain name data packet format according to the preset constraint algorithm; The container security policy is encapsulated based on the domain name data packet format.

5. A container management method, characterized in that: Applied to a container, the container management method comprises the following steps: Collect container communication data and container parameter information; Based on a preset constraint algorithm, the container communication data and the container parameter information are message encapsulated to obtain a DNS request packet; The DNS request packet is reported to the container management service in a domain name resolution manner.

6. The container management method according to claim 5, characterized in that: After the step of reporting the DNS request packet to the container management service in a domain name resolution manner, the method further includes: Receive the response message fed back by the container management service; Parsing the response message according to a preset domain name data packet format to obtain a parsing result; Performing language conversion on the parsing result to obtain a recognizable container security policy; Container management is performed based on the container security policy.

7. A container management device, characterized in that: The container management device comprises: A receiving module, configured to receive a DNS request packet reported by at least one container, parse the DNS request packet, and obtain container information; A policy determination module, configured to determine a container security policy based on the container information; An encapsulation module, used to encapsulate the container security policy according to a preset constraint algorithm to obtain a response message; A sending module is used to send the response message to the container, and the container performs container management based on the container security policy in the response message.

8. A container management device, characterized in that: The container management device comprises: A collection module, used to collect container communication data and container parameter information; An encapsulation module, used to encapsulate the container communication data and the container parameter information into messages based on a preset constraint algorithm to obtain a DNS request packet; The reporting module is used to report the DNS request packet to the container management service in a domain name resolution manner.

9. A container management device, characterized in that: The device comprises: a memory, a processor, and a container management program stored in the memory and executable on the processor, wherein the container management program is configured to implement the steps of the container management method according to any one of claims 1 to 4 or 5 to 6.

10. A storage medium, characterized in that: The storage medium stores a container management program, and when the container management program is executed by the processor, the steps of the container management method according to any one of claims 1 to 4 or 5 to 6 are implemented.