Container security detection method, equipment, device, storage medium and program product

By obtaining the corresponding relationship between the software bill of materials and target process information of the container image, combined with static analysis and real-time monitoring, the problem of incomplete identification of container security risks is solved, the comprehensiveness and accuracy of risk information is improved, and the container performance load is reduced.

CN118673501APending Publication Date: 2024-09-20CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410796386.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

Existing technology cannot effectively identify and verify security risks in containers, especially due to incomplete identification of processes and installed software in containers, which makes it impossible to accurately detect security risks in containers.

Method used

By obtaining the software bill of materials of the container image and comparing it with the preset vulnerability knowledge base, the corresponding relationship between the target process information and the risk information is established to determine the security risk information of the container during the current running process, combined with static software component analysis and container security services Real-time process monitoring to improve the comprehensiveness and accuracy of security risk information.

Benefits of technology

It achieves comprehensive and accurate identification of container security risks, reduces the load of vulnerability scanning on container performance, improves the pertinence and practicality of risk verification, and is suitable for common scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118673501A
    Figure CN118673501A
Patent Text Reader

Abstract

The invention discloses a container security detection method, equipment and device, a storage medium and a program product, relates to the technical field of electronic digital data processing, and discloses a container security detection method which comprises the steps that a software material list of a container mirror image is acquired, and risk information is determined according to a comparison result of the software material list and a preset vulnerability knowledge base; obtaining target process information of a container, and establishing a corresponding relationship between the target process information and the risk information; and according to the corresponding relationship, determining safety risk information corresponding to the container in the current operation process. According to the invention, the comprehensiveness and accuracy of the security risk information of the container at the current time point are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic digital data processing, and in particular to container safety detection methods, equipment, devices, storage media and program products. Background Art

[0002] Compared with traditional deployment models, containerization technology provides a packaging environment that is independent of the underlying operating system and hardware, ensuring that applications perform consistently in different development, testing, and production environments.

[0003] Vulnerability scanning and security assessment of containers usually check the security vulnerabilities of the host operating system and its related components, including operating system patches and updates. Although the current security protection measures for containers can dynamically perceive the risks faced by containers to a certain extent, due to the incomplete identification of processes or installed software in the container, there are usually many executable files or software in the directory, which makes it impossible to effectively identify the key installed software or executable files, and thus it is impossible to effectively and accurately verify the security risks of the container. Summary of the invention

[0004] The main purpose of this application is to provide a container safety detection method, equipment, device, storage medium and program product, aiming to solve the technical problem of being unable to effectively and accurately verify the safety risks of containers.

[0005] To achieve the above objectives, the present application proposes a container safety detection method, the method comprising:

[0006] Obtaining a software material list of the container image, and determining risk information based on a comparison result between the software material list and a preset vulnerability knowledge base;

[0007] Obtain target process information of the container, and establish a corresponding relationship between the target process information and the risk information;

[0008] According to the corresponding relationship, security risk information corresponding to the container in the current running process is determined.

[0009] In one embodiment, the step of obtaining the software bill of materials of the container image includes:

[0010] Disassemble the file of the container image to obtain text information of the container file of each layer;

[0011] Obtaining software files corresponding to each layer according to the text information of the container file of each layer;

[0012] The software bill of materials is generated according to the software files of each layer.

[0013] In one embodiment, the step of establishing a correspondence between the target process information and the risk information includes:

[0014] Establishing a first association relationship between the target process information and the software files in the software bill of materials;

[0015] Acquire a second association relationship between software files and risk information in the software bill of materials;

[0016] A correspondence between the target process information and the risk information is established according to the first association relationship and the second association relationship.

[0017] In one embodiment, the step of determining, according to the corresponding relationship, security risk information corresponding to the container during the current operation process includes:

[0018] Obtaining first real-time process information corresponding to the current process of the container;

[0019] Determining risk information corresponding to the first real-time process information according to the corresponding relationship;

[0020] According to the risk information corresponding to the first real-time process information, security risk information corresponding to the container in the current running process is determined.

[0021] In one embodiment, after the step of determining the security risk information corresponding to the container in the current running process according to the corresponding relationship, the method further includes:

[0022] When a vulnerability risk event is detected, determining second real-time process information of a container corresponding to the vulnerability risk event;

[0023] Determining risk information corresponding to the second real-time process information according to the corresponding relationship;

[0024] Obtain a response strategy corresponding to the risk information corresponding to the second real-time process information.

[0025] In one embodiment, after the step of determining the security risk information corresponding to the container in the current running process according to the corresponding relationship, the method further includes:

[0026] The risk level of the security risk information is determined according to the risk type of the security risk information, the utilization cost of the security risk information and / or whether the security risk information has an exposed attack surface.

[0027] In addition, to achieve the above-mentioned purpose, the present application also proposes a container safety detection device, the container safety detection device comprising:

[0028] An acquisition module is used to obtain a software material list of a container image, and determine risk information based on a comparison result between the software material list and a preset vulnerability knowledge base;

[0029] An establishment module is used to obtain target process information of a container and establish a corresponding relationship between the target process information and the risk information;

[0030] The detection module is used to determine the security risk information corresponding to the container in the current running process according to the corresponding relationship.

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

[0032] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the container safety detection method described above are implemented.

[0033] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the container safety detection method described above are implemented.

[0034] One or more technical solutions proposed in this application have at least the following technical effects: obtaining the software bill of materials of the container image, and determining the risk information based on the comparison results of the software bill of materials and the preset vulnerability knowledge base; obtaining the target process information of the container, and establishing a correspondence between the target process information and the risk information; according to the correspondence, determining the security risk information corresponding to the container in the current operation process. By generating the software bill of materials and risk list of the container image based on static software component analysis, combined with the real-time process operation monitoring of the container security service, the comprehensiveness and accuracy of the security risk information existing in the container at the current time point are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0037] Figure 1 A schematic diagram of a process flow provided for the first embodiment of the container safety detection method of the present application;

[0038] Figure 2 A schematic diagram of the correspondence between process information and risk information in the container security detection method of the present application;

[0039] Figure 3 A schematic diagram of the correspondence between port numbers and risk information in the container security detection method of this application;

[0040] Figure 4 A schematic diagram of a process flow provided for Embodiment 2 of the container safety detection method of the present application;

[0041] Figure 5 A schematic diagram of a simplified process of a container safety detection method provided in Example 2 of the present application;

[0042] Figure 6 A schematic diagram of a process flow provided for Embodiment 3 of the container safety detection method of the present application;

[0043] Figure 7 This is a schematic diagram of the module structure of the container safety detection device according to an embodiment of the present application;

[0044] Figure 8 This is a schematic diagram of the device structure of the hardware operating environment involved in the container security detection method in the embodiment of the present application.

[0045] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0046] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0047] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0048] The main solution of the embodiment of the present application is: obtain the software bill of materials of the container image, determine the risk information based on the comparison results of the software bill of materials and the preset vulnerability knowledge base; obtain the target process information of the container, establish the corresponding relationship between the target process information and the risk information; according to the corresponding relationship, determine the security risk information corresponding to the container in the current operation process. By generating the software bill of materials and risk list of the container image based on static software component analysis, combined with the real-time process operation monitoring of the container security service, the comprehensiveness and accuracy of the security risk information existing in the container at the current time point are improved.

[0049] In this embodiment, for the convenience of description, the container safety detection device is used as the execution subject for explanation below.

[0050] Although the existing technology can dynamically perceive the risks faced by containers to a certain extent, it does not fully identify the processes or installed software in the container. Usually, there are many executable files or software in the directory, which makes it impossible to effectively identify the key installed software or executable files, and thus it is impossible to effectively and accurately verify the security risks of the container.

[0051] The present application provides a solution that generates a software bill of materials and a risk list for a container image based on static software component analysis, and combines this with real-time process operation monitoring of a container security service, thereby improving the comprehensiveness and accuracy of security risk information existing in the container at the current point in time.

[0052] 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 tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a container safety detection device, etc. The following takes the container safety detection device as an example to illustrate this embodiment and the following embodiments.

[0053] Based on this, the present application embodiment provides a container safety detection method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the container safety detection method of the present application.

[0054] In this embodiment, the container safety detection method includes steps S10 to S30:

[0055] Step S10, obtaining a software material list of the container image, and determining risk information according to a comparison result between the software material list and a preset vulnerability knowledge base.

[0056] It should be noted that the SBOM (Software Bill of Materials) of a container image is a detailed list of all software components, libraries, and dependencies contained in the container image, providing detailed data such as the source, version number, and license information of each software element in the container. Optionally, the software bill of materials includes: the base operating system image, applications and their dependencies, the runtime environment, configuration files, startup scripts or entry files, etc.

[0057] In this embodiment, the software bill of materials is compared with a preset vulnerability knowledge base to obtain a comparison result, and risk information is determined based on the comparison result to present the risk information that the current image may face after being transferred to online operation, so as to effectively identify and manage security risks in the image. Optionally, the risk information includes the vulnerabilities that may be affected, the risk level, etc.

[0058] It should be noted that the vulnerability knowledge base is a database or resource library containing information about known software vulnerabilities. The vulnerability knowledge base usually includes detailed descriptions of various software vulnerabilities, such as the name of the vulnerability, CVE (Common Vulnerabilities and Exposures) number, affected software versions, the severity of the vulnerability, possible attack scenarios, and released repair patches.

[0059] Step S20, obtaining target process information of the container, and establishing a corresponding relationship between the target process information and the risk information.

[0060] Optionally, the process information includes: process ID (Identification); parent process ID; user ID and group ID, indicating the user and group running the process; process status, indicating the current status of the process, such as running, stopped, etc.; running time, indicating the time the process has been running; CPU (Central Processing Unit) and memory usage, showing the CPU and memory resources currently used by the process; process command line parameters, indicating the command line parameters used when starting the process; process start time, indicating the timestamp when the process was started; process priority, indicating the scheduling priority of the process; process name and path, showing the name of the process and the path of the executable file, etc.

[0061] Optionally, the target process information may be process information corresponding to all processes of the container, or process information corresponding to processes of the container in a certain time period, or process information of processes whose occurrence frequency of the container is greater than a preset frequency threshold, that is, process information of processes that are frequently running in the container.

[0062] Optionally, CSS (Container Security Service) monitors the running status of the container and provides a list of processes currently running in the container and target process information. Optionally, the process information also includes information such as ports and protocols.

[0063] In a feasible embodiment, step S20 includes: establishing a first association relationship between the target process information and the software files in the software bill of materials; obtaining a second association relationship between the software files in the software bill of materials and the risk information; and establishing a corresponding relationship between the target process information and the risk information based on the first association relationship and the second association relationship.

[0064] The target process information obtained is mapped to the software file or executable file in the software bill of materials using the process name or command line information. After the mapping between the target process information and the software file or executable file is established, a mapping is established between the target process information and the risk information of the software file according to the risk information matched by the software file in the software bill of materials, thereby determining the possible risks of the process currently running in the container.

[0065] For example, Figure 2 As shown, the target process information process1, process2, process3, the correspondence between the process information and the software bill of materials includes: the target process information process1 corresponds to the software file softwareA, the target process information process2 corresponds to the software file softwareB, the target process information process3 corresponds to the software file softwareC and the software file softwareD; the correspondence between the software bill of materials and the risk information includes: the software file softwareA corresponds to the risk information risk1 and the risk information risk2, the software file softwareB corresponds to the risk information risk2, the software file softwareC corresponds to the risk information risk3, the software file softwareD corresponds to the risk information risk4 and the risk information risk5, thereby establishing the correspondence between the target process information and the risk information.

[0066] Step S30: Determine the security risk information corresponding to the container during the current operation according to the corresponding relationship.

[0067] In this embodiment, during the current operation of the container, the security risk information corresponding to the container includes vulnerabilities that the container may be affected, risk levels, etc. The generation of the security risk information of the container can serve as a basis and direction for the security rectification of the container.

[0068] Optionally, step S30 includes: obtaining the first real-time process information corresponding to the current process of the container; determining the risk information corresponding to the first real-time process information according to the corresponding relationship; determining the security risk information corresponding to the container during the current operation according to the risk information corresponding to the first real-time process information. Among them, the first real-time process information is the information corresponding to the process currently running in the container. Optionally, the container can run a single process or multiple processes. When the container is a multi-process, the security risk information corresponding to the container during the current operation is determined according to the risk information corresponding to each real-time process information. Exemplarily, the first real-time process information process1 and process2, the correspondence between process information and risk information includes: the first real-time process information process1 corresponds to risk information risk1 and risk information risk2, and the first real-time process information process2 corresponds to risk information risk2, so that the security risk information is determined according to the risk information risk1 and the risk information risk2.

[0069] Optionally, after step S30, the method further includes: associating the acquired process-related exposure information, such as port, protocol, etc., with the risk information through the process information, such as Figure 3 As shown, the process information is process1, process2, and process3, among which process information process1 corresponds to port number Prot80, process information process2 corresponds to port number Prot8080, and process information process3 corresponds to port number Prot6379. For example, the system TCP port 80 is the open port of the Tomcat process, and the Tomcat running version is 10.0.13. At present, there are 6 disclosed vulnerabilities, that is, port 80 may be exposed.

[0070] Optionally, after step S30, it also includes: when a vulnerability risk event is detected, determining the second real-time process information corresponding to the vulnerability risk event; according to the corresponding relationship, determining the risk information corresponding to the second real-time process information; obtaining the response strategy corresponding to the risk information corresponding to the second real-time process information, so as to improve the response speed of the risk event and reduce the impact. The response strategy can be pre-set, for example, a vulnerability repair strategy. Exemplarily, the generation of a software bill of materials can provide data support for subsequent active emergency response. Optionally, when a 0Day vulnerability risk breaks out, it can be quickly identified based on the software bill of materials whether the vulnerability poses a security threat to the online running container, and then an active emergency response is performed on the affected container to avoid a passive emergency response after the attack occurs.

[0071] By generating a software bill of materials and a risk list for the container image based on static software component analysis, and combining it with the real-time process operation monitoring of the container security service, vulnerability scanning and risk verification can be more targeted, avoiding the wide-ranging scanning of black box scanning, reducing the performance load and stability risks of the container due to vulnerability scanning, and reducing the impact of container security scanning on container performance. Therefore, it has high practicality and is applicable to general scenarios.

[0072] In the technical solution of this embodiment, the software bill of materials of the container image is obtained, and the risk information is determined based on the comparison results of the software bill of materials and the preset vulnerability knowledge base; the target process information of the container is obtained, and the corresponding relationship between the target process information and the risk information is established; according to the corresponding relationship, the security risk information corresponding to the container in the current operation process is determined. By generating the software bill of materials and risk list of the container image based on static software component analysis and combining it with the real-time process operation monitoring of the container security service, the comprehensiveness and accuracy of the security risk information existing in the container at the current time point are improved.

[0073] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment can refer to the above introduction, and will not be repeated later. Figure 4 , step S10 includes steps S11 to S13:

[0074] Step S11, disassembling the file of the container image to obtain text information of the container file of each layer;

[0075] Step S12, obtaining software files corresponding to each layer according to the text information of the container file of each layer;

[0076] Step S13, generating the software bill of materials according to the software files of each layer.

[0077] It should be noted that container images are usually composed of multiple layers, each of which represents a series of modifications to the image. The number of layers of the image file depends on the build process and strategy used when building the image. For example, a base image will occupy one layer, and then each subsequent image operation (such as installing a package, adding files, etc.) will form a new layer. This layered structure makes it easier to cache, reuse and share images, while also reducing the size of the image.

[0078] Based on static software component analysis, the container image is detected, the container image file is disassembled, and the information of each layer is disassembled to obtain the text information of the container file DockerFile. According to the DockerFile text information, the software files or executable files introduced by the layer are obtained. The software files or executable files introduced by each layer are summarized to generate the software bill of materials relative to the container image and the base package of the container image. For example, Figure 5 As shown, the container image is disassembled, the manifest.json file is parsed, the configuration identifier Config IDs of each layer are extracted, the DockerFile of each layer is extracted according to the configuration identifier, the DockerFile content is parsed to obtain the installation information of the current layer, and finally the software components of each layer are summarized to generate a software bill of materials.

[0079] In the technical solution of this embodiment, the file of the container image is disassembled to obtain the text information of the container files of each layer; the software files corresponding to each layer are obtained according to the text information of the container files of each layer; and the software bill of materials is generated according to the software files of each layer. The software bill of materials of the container image is generated based on static software component analysis to achieve risk discovery and active security emergency response. Compared with the passive emergency response after the current risk occurs, it can greatly reduce the average repair time or average fault detection time of problem handling and reduce the time exposed to risks.

[0080] Based on the first or second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the above embodiment can be referred to the above introduction, and will not be repeated in the following. Figure 6 , step S30 includes step S40:

[0081] Step S40: determining the risk level of the security risk information according to the risk type of the security risk information, the utilization cost of the security risk information and / or whether the security risk information exposes an attack surface.

[0082] Optionally, the risk level is comprehensively assessed based on the risk type, whether there is a way to exploit the risk, and whether the risk is exposed.

[0083] Optionally, the risk level is assessed as follows:

[0084] High risks include: CVSS (Common Vulnerability Scoring System) >= 7 (high risk or above), POC (Proof of Concept, that is, there is vulnerability exploit code or verification script), vulnerability types that can directly lead to data leakage, and the exploitation cost is not high or medium, and the attack surface is exposed.

[0085] Medium risk includes: other situations with POC, or CVSS>=7 (high risk or above), or exposed attack surface.

[0086] Low risk includes: other situations except the above conditions.

[0087] Optionally, the types of vulnerabilities that can directly lead to data leakage, CWE (Common Weakness Enumeration) may be added or modified, including: command injection, such as CWE-78, CWE-77; code injection, such as CWE-94, CWE-95, CWE-917, CWE-470; SQL injection, such as CWE-89; deserialization, such as CWE-502; SSRF (Server-Side Request Forgery), such as CWE-918; arbitrary file reading, such as CWE-548; unauthorized access, such as CWE-497, CWE-306, CWE-284, CWE-285, CWE-287, CWE-250; information leakage, such as CWE-200; lax input validation, such as CWE-20.

[0088] After listing all accessible risks, we can obtain the security risks faced by the container running the current image, and carry out targeted prevention and repair of the risks.

[0089] In the technical solution of this embodiment, the security risk information of the container is evaluated, which improves the comprehensiveness and accuracy of the security risk evaluation of the container at the current time point.

[0090] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the container safety detection method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0091] This application also provides a container safety detection device, please refer to Figure 7 , the container safety detection device comprises:

[0092] An acquisition module 10 is used to acquire a software material list of a container image, and determine risk information according to a comparison result between the software material list and a preset vulnerability knowledge base;

[0093] Establishing module 20, used to obtain target process information of the container and establish a corresponding relationship between the target process information and the risk information;

[0094] The detection module 30 is used to determine the security risk information corresponding to the container in the current running process according to the corresponding relationship.

[0095] Optionally, the step of obtaining a software bill of materials for the container image includes:

[0096] Disassemble the file of the container image to obtain text information of the container file of each layer;

[0097] Obtaining software files corresponding to each layer according to the text information of the container file of each layer;

[0098] The software bill of materials is generated according to the software files of each layer.

[0099] Optionally, the step of establishing a corresponding relationship between the target process information and the risk information includes:

[0100] Establishing a first association relationship between the target process information and the software files in the software bill of materials;

[0101] Acquire a second association relationship between software files and risk information in the software bill of materials;

[0102] A correspondence between the target process information and the risk information is established according to the first association relationship and the second association relationship.

[0103] Optionally, the step of determining, according to the corresponding relationship, security risk information corresponding to the container during the current operation process includes:

[0104] Obtaining first real-time process information corresponding to the current process of the container;

[0105] Determining risk information corresponding to the first real-time process information according to the corresponding relationship;

[0106] According to the risk information corresponding to the first real-time process information, security risk information corresponding to the container in the current running process is determined.

[0107] Optionally, after the step of determining, according to the corresponding relationship, the security risk information corresponding to the container in the current running process, the step further includes:

[0108] When a vulnerability risk event is detected, determining second real-time process information of a container corresponding to the vulnerability risk event;

[0109] Determining risk information corresponding to the second real-time process information according to the corresponding relationship;

[0110] Obtain a response strategy corresponding to the risk information corresponding to the second real-time process information.

[0111] Optionally, after the step of determining, according to the corresponding relationship, the security risk information corresponding to the container in the current running process, the step further includes:

[0112] The risk level of the security risk information is determined according to the risk type of the security risk information, the utilization cost of the security risk information and / or whether the security risk information has an exposed attack surface.

[0113] The container safety detection device provided by the present application adopts the container safety detection method in the above embodiment, which can solve the technical problem of being unable to effectively and accurately verify the safety risks of the container. Compared with the prior art, the beneficial effects of the container safety detection device provided by the present application are the same as the beneficial effects of the container safety detection method provided by the above embodiment, and other technical features in the container safety detection device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0114] The present application provides a container safety detection device, which includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the container safety detection method in the above-mentioned embodiment 1.

[0115] Reference below Figure 8 , which shows a schematic diagram of the structure of a container safety detection device suitable for implementing the embodiment of the present application. The container safety detection device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The container safety detection device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0116] like Figure 8As shown, the container safety detection device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the container safety detection device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the container safety detection device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a container safety detection device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0117] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0118] The container safety detection device provided by the present application adopts the container safety detection method in the above embodiment, which can solve the technical problem of being unable to effectively and accurately verify the safety risks of the container. Compared with the prior art, the beneficial effects of the container safety detection device provided by the present application are the same as the beneficial effects of the container safety detection method provided by the above embodiment, and the other technical features in the container safety detection device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0119] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0120] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0121] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the container safety detection method in the above-mentioned embodiment.

[0122] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0123] The computer-readable storage medium may be included in the container safety detection device; or may exist independently without being assembled into the container safety detection device.

[0124] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the container security detection device, the container security detection device: obtains the software bill of materials of the container image, and determines the risk information based on the comparison result of the software bill of materials and the preset vulnerability knowledge base; obtains the process information of the container, establishes the correspondence between the process information and the risk information; and determines the security risk information corresponding to the container in the current operation process based on the correspondence. By generating the software bill of materials and risk list of the container image based on static software component analysis and combining it with the real-time process operation monitoring of the container security service, the comprehensiveness and accuracy of the security risk information existing in the container at the current time point are improved. .

[0125] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0126] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0127] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0128] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned container safety detection method, and can solve the technical problem of being unable to effectively and accurately verify the safety risks of the container. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the container safety detection method provided in the above-mentioned embodiment, and will not be elaborated here.

[0129] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned container safety detection method when executed by a processor.

[0130] The computer program product provided by the present application can solve the technical problem of being unable to effectively and accurately verify the security risks of the container. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the container security detection method provided by the above embodiment, which will not be repeated here.

[0131] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A container safety detection method, characterized in that: The method comprises: Obtaining a software material list of the container image, and determining risk information based on a comparison result between the software material list and a preset vulnerability knowledge base; Obtain target process information of the container, and establish a corresponding relationship between the target process information and the risk information; According to the corresponding relationship, security risk information corresponding to the container in the current running process is determined.

2. The method according to claim 1, characterized in that The step of obtaining the software bill of materials of the container image includes: Disassemble the file of the container image to obtain text information of the container file of each layer; According to the text information of the container file of each layer, obtaining the software file corresponding to each layer; The software bill of materials is generated according to the software files of each layer.

3. The method according to claim 1, characterized in that The step of establishing a corresponding relationship between the target process information and the risk information comprises: Establishing a first association relationship between the target process information and the software files in the software bill of materials; Acquire a second association relationship between software files and risk information in the software bill of materials; A correspondence between the target process information and the risk information is established according to the first association relationship and the second association relationship.

4. The method according to claim 1, characterized in that The step of determining the security risk information corresponding to the container during the current operation according to the corresponding relationship includes: Obtaining first real-time process information corresponding to the current process of the container; Determining risk information corresponding to the first real-time process information according to the corresponding relationship; According to the risk information corresponding to the first real-time process information, security risk information corresponding to the container in the current running process is determined.

5. The method according to claim 1, characterized in that After the step of determining the security risk information corresponding to the container in the current running process according to the corresponding relationship, the method further includes: When a vulnerability risk event is detected, determining second real-time process information of a container corresponding to the vulnerability risk event; Determining risk information corresponding to the second real-time process information according to the corresponding relationship; A response strategy for the risk information corresponding to the second real-time process information is obtained.

6. The method according to claim 1, characterized in that After the step of determining the security risk information corresponding to the container in the current running process according to the corresponding relationship, the method further includes: The risk level of the security risk information is determined according to the risk type of the security risk information, the utilization cost of the security risk information and / or whether the security risk information has an exposed attack surface.

7. A container safety detection device, characterized in that: The device comprises: An acquisition module is used to obtain a software material list of the container image, and determine risk information based on a comparison result between the software material list and a preset vulnerability knowledge base; An establishment module is used to obtain target process information of a container and establish a corresponding relationship between the target process information and the risk information; The detection module is used to determine the security risk information corresponding to the container in the current running process according to the corresponding relationship.

8. A container safety detection device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the container safety detection method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the container safety detection method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the container safety detection method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Method for automatically discovering software components in containerized environment

    CN122413424A

  • A method for automatically discovering software components in a containerized environment

    CN122413424B