A containerized multi-plug-in firmware analysis task scheduling system and method
Through the containerized multi-plugin firmware analysis task scheduling system, the problems of high resource consumption and poor stability of the firmware analysis system are solved, and efficient and stable firmware analysis is achieved. Through load balancing and dynamic expansion and contraction mechanisms, the system's analysis capabilities and stability.
Patent Information
- Application Number
- CN202410589661.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-13
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-05-13
AI Technical Summary
The existing firmware analysis system consumes a lot of resources when processing a large number of binary files, resulting in poor stability. The analysis technology of different file formats is inconsistent, making it difficult to effectively perform efficient analysis.
Adopt a containerized multi-plugin firmware analysis task scheduling system, including unpacking plug-ins, analysis plug-ins and schedulers. Through containerization design and load balancing mechanism, binary files are unpacked and analyzed, and container copies are created under high load to improve analysis capabilities. , remove replicas during low load to reduce system pressure.
It improves the efficiency and stability of firmware analysis, realizes containerized access and communication capabilities of different firmware tools, and dynamically expands and shrinks capacity to ensure that the system maintains efficient operation when the load changes.
Smart Images

Figure CN118377584B
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of fuzzy testing technology, and in particular to a system and method for scheduling containerized multi-plug-in firmware analysis tasks. Background Art
[0002] Firmware is a specific software that can provide low-level control over device hardware. It is generally stored in read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory. It is widely used in industries such as the Internet of Things, Internet of Vehicles and industrial control.
[0003] Firmware analysis technology includes static analysis and dynamic analysis. Static analysis is to unpack the firmware file, extract various types of files in the firmware, and then combine the existing static program analysis technology to implement in-depth analysis and vulnerability mining. Dynamic analysis is to analyze the startup files and web component files in the firmware, simulate the firmware through system simulation technology, and then perform dynamic binary firmware analysis.
[0004] However, after a single firmware is nested and unpacked, tens of thousands of sub-files can be extracted, and the file formats are even more varied, and the analysis techniques that can be adopted for different formats are also different. In addition, some binary analysis techniques consume a lot of system resources, which poses a great challenge to the stability of the firmware analysis system.
[0005] Therefore, it is necessary to provide a containerized multi-plug-in firmware analysis task scheduling system and method to solve the above problems. Summary of the invention
[0006] The present invention provides a containerized multi-plug-in firmware analysis task scheduling system and method, which adopts a containerized multi-task scheduling design to greatly improve the efficiency and stability of firmware analysis.
[0007] The embodiment of the present invention provides a containerized multi-plug-in firmware analysis task scheduling system, which is characterized by comprising:
[0008] Unpacking plug-in, which is used to nest unpack the firmware and the binary files that can be unpacked in the firmware to extract the binary files that can be directly analyzed;
[0009] An analysis plug-in, which is used to analyze the binary file, and the analysis plug-in includes a software component detection plug-in, a CVE vulnerability search plug-in, a CWE defect search plug-in, a security compilation option analysis plug-in, a sensitive information analysis plug-in, a firmware simulation plug-in, and a dynamic fuzz test plug-in;
[0010] A scheduler, which is used to send the unpackable binary file to the unpacking plug-in and send the directly analyzable binary file to the analysis plug-in according to load balancing, and when a high-load plug-in appears, create a container copy of it to improve its analysis capability to reduce the load, and when a low-load plug-in or no-load plug-in appears, remove the duplicate plug-in container copy to reduce system pressure;
[0011] A database is used to store the result information analyzed by the analysis plug-in.
[0012] Preferably, the unpacking plug-in includes an initialization process, a heartbeat monitoring process and an unpacking process;
[0013] The initialization process includes: when the plug-in container is started, the initialization unit constructs registration information; the initialization unit sends the registration information to the sending unit; the sending unit sends the registration information to the scheduler in a gRPC manner;
[0014] The heartbeat monitoring process includes: a receiving unit receives data; when the data is heartbeat monitoring request data, constructs heartbeat monitoring return data; sends the heartbeat monitoring return data to the sending unit; the sending unit sends the heartbeat monitoring return data to the scheduler in a gRPC manner;
[0015] The unpacking process includes: the receiving unit receives the data; when the data is task data, the task data is placed at the end of the task queue; the task distribution unit detects in real time whether there is an idle worker in the thread pool, and when there is an idle worker, the head task data of the task queue is popped out and the head task data is sent to the thread pool; the idle worker in the thread pool obtains the head task data and performs an unpacking operation to generate a sub-file; when the unpacking operation is completed, the idle worker marks the original task data as unpacking completed; the idle worker constructs sub-task data for the unpacked sub-file; the idle worker sends the marked completed original task data and the sub-task data to the sending unit; the sending unit sends the marked completed original task data and the sub-task data to the scheduler.
[0016] Preferably, the registration information includes the plug-in gRPC communication port number, host name, number of workers and plug-in name.
[0017] Preferably, the heartbeat monitoring return data includes load situation information, and the load situation information includes the number of queued tasks.
[0018] Preferably, the scheduler includes a plug-in registration process, a heartbeat monitoring process and a task scheduling process;
[0019] The plug-in registration process includes: when a receiving unit receives data, if the data is plug-in registration information data, the plug-in registration information data is saved in a plug-in load information table; and a sending unit notifies the plug-in container of successful registration according to the host name and port number in the plug-in registration information data;
[0020] The heartbeat monitoring process includes: the heartbeat monitoring unit periodically sends heartbeat monitoring request data to the sending unit; the sending unit sends the heartbeat monitoring request data to the plug-in container; the plug-in container replies with heartbeat monitoring return data; the receiving unit receives the data, and when the data is heartbeat monitoring return data, it sends it to the heartbeat monitoring unit; the heartbeat monitoring unit updates the plug-in load information table according to the load data in the received heartbeat monitoring return data; when the heartbeat monitoring unit does not receive the heartbeat monitoring return data of a plug-in within a preset time, the state abnormality information of the plug-in is notified to the container control unit; the container control unit restarts the service through the Docker service, and sends the unfinished tasks of the plug-in in the plug-in load information table to the plug-in;
[0021] The task scheduling process includes: uploading firmware through http service and starting tasks; constructing firmware task data and inserting it to the end of the task queue; the task distribution unit pops up the task data at the head of the task queue in real time; when the popped-up task data at the head of the queue has completed all plug-in analyses, the data is saved in the database; when the popped-up task data at the head of the queue has not completed all plug-in analyses, the unfinished analysis list is counted; according to the load data in the plug-in load information table and the unfinished analysis list, the plug-in with the smallest load is calculated; according to the plug-in with the smallest load and the plug-in information in the plug-in load information table, the task data is sent to the sending unit; the task data is recorded in the plug-in load information table; the sending unit sends the task data to the plug-in container; after the plug-in container receives the task data and analyzes and processes it, the marked completed task data is sent back to the scheduler; the receiving unit receives the data; if the analyzed data is task data, the task data is inserted into the end of the task queue.
[0022] Preferably, the scheduler also includes a dynamic expansion and contraction process, including: the container control unit periodically detects the plug-in load in the plug-in load information table; when the number of plug-in queued tasks divided by the number of workers is greater than a preset value, a copy of the plug-in container is created through the Docker service; when the number of plug-in queued tasks is 0 and the plug-in container is a copy container, the plug-in container is deleted through the Docker service, and the relevant data in the plug-in load information table is cleaned up.
[0023] Preferably, the analysis plug-in includes an initialization process, a heartbeat monitoring process, and an analysis plug-in analysis process;
[0024] The initialization process includes: when the plug-in container is started, the initialization unit constructs registration information; the initialization unit sends the registration information to the sending unit; the sending unit sends the registration information to the sending unit in a gRPC manner;
[0025] The heartbeat monitoring process includes: a receiving unit receives data; when the data is heartbeat monitoring request data, constructs heartbeat monitoring return data; sends the heartbeat monitoring return data to a sending unit; the sending unit sends the heartbeat monitoring return data to the scheduler in a gRPC manner;
[0026] The analysis plug-in analysis process includes: a receiving unit receives data; when the data is task data, the task data is placed at the end of the task queue; a task distribution unit detects in real time whether there is an idle worker in the thread pool, and when there is an idle worker, the head task data of the task queue is popped up and the head task data is sent to the thread pool; the idle worker in the thread pool obtains the head task data and performs an analysis operation; when the analysis operation is completed, the idle worker marks the head task data as completed and saves the analysis result to the original data to obtain the modified task data; the modified task data is sent to the sending unit; the sending unit sends the modified task data to the scheduler.
[0027] Preferably, the registration information includes the plug-in gRPC communication port number, host name, number of workers and plug-in name.
[0028] Preferably, the heartbeat monitoring return data includes load situation information, and the load situation information includes the number of queued tasks.
[0029] The embodiment of the present invention also provides a method for scheduling analysis tasks based on containerized multi-plug-in firmware, including:
[0030] Nested unpacking of the firmware and the binary files that can be unpacked in the firmware to extract binary files that can be directly analyzed;
[0031] Analyze the binary file, the analysis plug-in includes a software component detection plug-in, a CVE vulnerability search plug-in, a CWE defect search plug-in, a security compilation option analysis plug-in, a sensitive information analysis plug-in, a firmware simulation plug-in and a dynamic fuzz test plug-in;
[0032] Send the unpackable binary file to the unpacking plug-in and send the directly analyzable binary file to the analysis plug-in according to load balancing. When a high-load plug-in appears, create a container copy of it to improve its analysis capability to reduce the load. When a low-load plug-in or a no-load plug-in appears, remove the duplicate plug-in container copy to reduce system pressure.
[0033] The result information of the analysis by the analysis plug-in is stored.
[0034] Compared with the prior art, the technical solution of the embodiment of the present invention has the following beneficial effects:
[0035] The containerized multi-plugin firmware analysis task scheduling system and method of the embodiment of the present invention include: an unpacking plug-in, which is used to nest and unpack the firmware and the unpackable binary files in the firmware to extract the binary files that can be directly analyzed; an analysis plug-in, which is used to analyze the binary files, and the analysis plug-in includes a software component detection plug-in, a CVE vulnerability search plug-in, a CWE defect search plug-in, a security compilation option analysis plug-in, a sensitive information analysis plug-in, a firmware simulation plug-in and a dynamic fuzz test plug-in; a scheduler, which is used to send the unpackable binary files to the unpacking plug-in and send the directly analyzable binary files to the analysis plug-in according to load balancing, when a high-load plug-in appears, its container copy is created to improve its analysis capability to reduce the load, and when a low-load plug-in or a no-load plug-in appears, the duplicate plug-in container copy is removed to reduce the system pressure; a database, which is used to store the result information analyzed by the analysis plug-in, and by using the unpacking plug-in, the analysis plug-in and the scheduler, different firmware analysis tools are connected to the system in the form of containerized plug-ins to achieve communication capabilities between containers;
[0036] Furthermore, the scheduler periodically monitors the status of each plug-in container. When the status of the plug-in container is normal, it returns the number of queued tasks and the number of concurrent processing tasks of the plug-in. The scheduler implements the task allocation scheduling capability based on load balancing according to the number of queued tasks and the number of workers of each container plug-in.
[0037] Furthermore, when the scheduler detects an abnormal container during heartbeat monitoring, it will restart the plug-in container through the Docker service and restore it to the state before the abnormality, thus realizing the plug-in container keep-alive capability.
[0038] Furthermore, the scheduler creates or destroys container copies through the Docker service according to the load of each container plug-in, thereby achieving the ability to dynamically expand and shrink capacity. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are some embodiments of the present invention, not all embodiments. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.
[0040] Figure 1 A schematic diagram of the structure of a containerized multi-plug-in firmware analysis task scheduling system provided by an embodiment of the present invention;
[0041] Figure 2 A schematic diagram of the structure of a plug-in in a containerized multi-plug-in firmware analysis task scheduling system provided by an embodiment of the present invention;
[0042] Figure 3 A schematic diagram of the structure of a scheduler in a containerized multi-plug-in firmware analysis task scheduling system provided by an embodiment of the present invention;
[0043] Figure 4 A flowchart of a method for scheduling containerized multi-plug-in firmware analysis tasks is provided for one embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0046] Based on the problems existing in the prior art, the embodiments of the present invention provide a system and method for scheduling firmware analysis tasks based on containerized multi-plug-in, which adopts the design of containerized multi-task scheduling and greatly improves the efficiency and stability of firmware analysis.
[0047] Figure 1 A schematic diagram of the structure of a containerized multi-plug-in firmware analysis task scheduling system provided by an embodiment of the present invention. Figure 1 , an embodiment of the present invention provides a containerized multi-plug-in firmware analysis task scheduling system, comprising:
[0048] Unpacking plug-in, which is used to nest unpack the firmware and the binary files that can be unpacked in the firmware to extract the binary files that can be directly analyzed;
[0049] An analysis plug-in, which is used to analyze the binary file. The analysis plug-in is a plug-in with various specific functions, and its access to the system in a plug-in manner is conducive to the access of other subsequent analysis functions. The analysis plug-in includes a software component detection plug-in, a CVE (Common Vulnerabilities and Exposures) vulnerability search plug-in, a CWE (Common Weakness Enumeration) defect search plug-in, a security compilation option analysis plug-in, a sensitive information analysis plug-in, a firmware simulation plug-in, and a dynamic fuzz test plug-in;
[0050] A scheduler, which is used to send the unpackable binary file to the unpacking plug-in and send the directly analyzable binary file to the analysis plug-in according to load balancing, and when a high-load plug-in appears, create a container copy of it to improve its analysis capability to reduce the load, and when a low-load plug-in or no-load plug-in appears, remove the duplicate plug-in container copy to reduce system pressure;
[0051] A database is used to store the result information analyzed by the analysis plug-in.
[0052] Specifically, there may be multiple analysis plug-ins, including analysis plug-in 1, analysis plug-in 2, ..., analysis plug-in N.
[0053] Figure 2 A schematic diagram of the structure of a plug-in in a containerized multi-plug-in firmware analysis task scheduling system provided by an embodiment of the present invention. Figure 2 ,The structure of the unpacking plugin is consistent with the ,analysis plugin.
[0054] The unpacking plug-in includes the initialization process, the heartbeat monitoring process, and the unpacking process;
[0055] The initialization process includes: when the plug-in container is started, the initialization unit constructs registration information; the initialization unit sends the registration information to the sending unit; the sending unit sends the registration information to the scheduler in a gRPC manner;
[0056] The heartbeat monitoring process includes: a receiving unit receives data; when the data is heartbeat monitoring request data, constructs heartbeat monitoring return data; sends the heartbeat monitoring return data to the sending unit; the sending unit sends the heartbeat monitoring return data to the scheduler in a gRPC manner;
[0057] The unpacking process includes: the receiving unit receives the data; when the data is task data, the task data is placed at the end of the task queue; the task distribution unit detects in real time whether there is an idle worker in the thread pool, and when there is an idle worker, the head task data of the task queue is popped out and the head task data is sent to the thread pool; the idle worker in the thread pool obtains the head task data and performs an unpacking operation to generate a sub-file; when the unpacking operation is completed, the idle worker marks the original task data as unpacking completed; the idle worker constructs sub-task data for the unpacked sub-file; the idle worker sends the marked completed original task data and the sub-task data to the sending unit; the sending unit sends the marked completed original task data and the sub-task data to the scheduler.
[0058] Specifically, gRPC is an open source, high-performance remote procedure call (RPC) framework that can efficiently connect services within and across data centers, supporting load balancing, tracing, health checks, and authentication.
[0059] Specifically, the worker is a thread in the thread pool. The worker thread continuously takes tasks from the task queue and executes them, while the worker thread is handed over to the operating system for scheduling.
[0060] In a specific implementation, the registration information includes the plug-in gRPC communication port number, host name, number of workers, and plug-in name.
[0061] In a specific implementation, the heartbeat monitoring return data includes load situation information, and the load situation information includes the number of queued tasks.
[0062] Figure 3 A schematic diagram of the structure of a scheduler in a containerized multi-plug-in firmware analysis task scheduling system provided by an embodiment of the present invention. Figure 3 , the scheduler includes a plug-in registration process, a heartbeat monitoring process and a task scheduling process;
[0063] The plug-in registration process includes: when a receiving unit receives data, if the data is plug-in registration information data, the plug-in registration information data is saved in a plug-in load information table; and a sending unit notifies the plug-in container of successful registration according to the host name and port number in the plug-in registration information data;
[0064] The heartbeat monitoring process includes: the heartbeat monitoring unit periodically sends heartbeat monitoring request data to the sending unit; the sending unit sends the heartbeat monitoring request data to the plug-in container; the plug-in container replies with heartbeat monitoring return data; the receiving unit receives the data, and when the data is heartbeat monitoring return data, it sends it to the heartbeat monitoring unit; the heartbeat monitoring unit updates the plug-in and load information table according to the load data in the received heartbeat monitoring return data; when the heartbeat monitoring unit does not receive the heartbeat monitoring return data of a plug-in within a preset time, the state abnormality information of the plug-in is notified to the container control unit; the container control unit restarts the service through the Docker service, and sends the unfinished tasks of the plug-in in the plug-in and load information table to the plug-in;
[0065] The task scheduling process includes: uploading firmware through http service and starting tasks; constructing firmware task data and inserting it to the end of the task queue; the task distribution unit pops up the task data at the head of the task queue in real time; when the popped-up task data at the head of the queue has completed all plug-in analyses, the data is saved in the database; when the popped-up task data at the head of the queue has not completed all plug-in analyses, the unfinished analysis list is counted; according to the load data in the plug-in and load information table and the unfinished analysis list, the plug-in with the smallest load is calculated; according to the plug-in with the smallest load and the plug-in information in the plug-in and load information table, the task data is sent to the sending unit; the task data is recorded in the plug-in load information table; the sending unit sends the task data to the plug-in container; after the plug-in container receives the task data and analyzes and processes it, the marked completed task data is sent back to the scheduler; the receiving unit receives the data; if the analyzed data is task data, the task data is inserted into the end of the task queue.
[0066] In a specific implementation, the scheduler also includes a dynamic expansion and contraction process, including: the container control unit periodically detects the plug-in load in the plug-in load information table; when the number of plug-in queued tasks divided by the number of workers is greater than a preset value, a copy of the plug-in container is created through the Docker service; when the number of plug-in queued tasks is 0 and the plug-in container is a copy container, the plug-in container is deleted through the Docker service, and the relevant data in the plug-in load information table is cleaned up.
[0067] Specifically, the preset value may be 10. For example, when the number of queued tasks of the plug-in divided by the number of workers is greater than 10, a copy of the plug-in container is created through the Docker service.
[0068] In the specific implementation, the analysis plug-in includes an initialization process, a heartbeat monitoring process, and an analysis plug-in analysis process;
[0069] The initialization process includes: when the plug-in container is started, the initialization unit constructs registration information; the initialization unit sends the registration information to the sending unit; the sending unit sends the registration information to the sending unit in a gRPC manner;
[0070] The heartbeat monitoring process includes: a receiving unit receives data; when the data is heartbeat monitoring request data, constructs heartbeat monitoring return data; sends the heartbeat monitoring return data to a sending unit; the sending unit sends the heartbeat monitoring return data to the scheduler in a gRPC manner;
[0071] The analysis plug-in analysis process includes: a receiving unit receives data; when the data is task data, the task data is placed at the end of the task queue; a task distribution unit detects in real time whether there is an idle worker in the thread pool, and when there is an idle worker, the head task data of the task queue is popped up and the head task data is sent to the thread pool; the idle worker in the thread pool obtains the head task data and performs an analysis operation; when the analysis operation is completed, the idle worker marks the head task data as completed and saves the analysis result to the original data to obtain the modified task data; the modified task data is sent to the sending unit; the sending unit sends the modified task data to the scheduler.
[0072] In a specific implementation, the registration information includes the plug-in gRPC communication port number, host name, number of workers, and plug-in name.
[0073] In a specific implementation, the heartbeat monitoring return data includes load situation information, and the load situation information includes the number of queued tasks.
[0074] Figure 4 A flowchart of a method for scheduling containerized multi-plug-in firmware analysis tasks is provided for an embodiment of the present invention. Figure 4 The embodiment of the present invention provides a method for scheduling analysis tasks based on containerized multi-plug-in firmware, including:
[0075] Step S401: performing nested unpacking of the firmware and the binary files that can be unpacked in the firmware to extract the binary files that can be directly analyzed;
[0076] Step S402: Analyze the binary file, the analysis plug-in includes a software component detection plug-in, a CVE vulnerability search plug-in, a CWE defect search plug-in, a security compilation option analysis plug-in, a sensitive information analysis plug-in, a firmware simulation plug-in, and a dynamic fuzz test plug-in;
[0077] Step S403: Send the unpackable binary file to the unpacking plug-in and send the directly analyzable binary file to the analysis plug-in according to load balancing. When a high-load plug-in appears, create a container copy of it to improve its analysis capability to reduce the load. When a low-load plug-in or a no-load plug-in appears, remove the duplicate plug-in container copy to reduce system pressure.
[0078] Step S404: storing the analysis result information of the analysis plug-in.
[0079] The following is a detailed example of the method for scheduling fixed analysis tasks based on containerized multi-plug-ins:
[0080] 1. In the preparation phase, each plug-in container registers with the scheduler through gRPC, and the scheduler records the plug-in container information such as the plug-in container ID and port number;
[0081] 2. The scheduler obtains the firmware file through the http interface, builds the analysis task data and sends it to the task receiving module;
[0082] 3. The scheduler task receiving module will insert the task data into the end of the task queue;
[0083] 4. The scheduler pops up the task data at the head of the task queue in real time, analyzes the file type according to the task data, and distributes it to the unpacking plug-in if it can be unpacked. If it cannot be unpacked, it is distributed to each analysis plug-in container according to the load balancing situation. If the task data has completed all plug-in analysis, the data is saved to the database;
[0084] 5. The unpacking plug-in obtains the task data and first inserts the task data into the end of the task queue. At the same time, the task data at the head of the task queue is popped out in real time and handed over to the thread pool for processing. The idle worker threads in the thread pool will unpack the files according to the file type and construct subtask data for the extracted subfiles and send them to the scheduler.
[0085] 6. The analysis plug-in obtains the task data and first inserts the task data into the end of the task queue. At the same time, the task data at the head of the task queue is popped out in real time and handed over to the thread pool for processing. The worker thread in the thread pool analyzes the task files in the task data and sends the analysis results back to the scheduler.
[0086] 7. Repeat steps 3 to 6;
[0087] 8. The scheduler periodically sends heartbeat monitoring request data to each plug-in container;
[0088] 9. After receiving the heartbeat monitoring request data sent by the scheduler, each plug-in container immediately constructs the reply data and sends it to the scheduler. The reply data includes the load situation and container status;
[0089] 10. If the scheduler does not receive the heartbeat reply data of a plug-in container within the preset time, it restarts the plug-in container and restores the state before the plug-in container is abnormal;
[0090] 11. The scheduler receives the plug-in heartbeat monitoring reply data and analyzes its load status. If the load is higher than the preset range, a copy of the plug-in container is created. Conversely, if the load is lower and duplicate plug-in container copies exist, the duplicate container copies are removed.
[0091] In summary, the containerized multi-plug-in firmware analysis task scheduling system and method of the embodiment of the present invention include: an unpacking plug-in, which is used to nest and unpack the firmware and the unpackable binary files in the firmware to extract the binary files that can be directly analyzed; an analysis plug-in, which is used to analyze the binary files, and the analysis plug-in includes a software component detection plug-in, a CVE vulnerability search plug-in, a CWE defect search plug-in, a security compilation option analysis plug-in, a sensitive information analysis plug-in, a firmware simulation plug-in and a dynamic fuzz test plug-in; a scheduler, which is used to send the unpackable binary files to the unpacking plug-in and send the directly analyzable binary files to the analysis plug-in according to load balancing, when a high-load plug-in appears, its container copy is created to improve its analysis capability to reduce the load, and when a low-load plug-in or a no-load plug-in appears, the duplicate plug-in container copy is removed to reduce the system pressure; a database, which is used to store the result information analyzed by the analysis plug-in, and by using the unpacking plug-in, the analysis plug-in and the scheduler, different firmware analysis tools are connected to the system in the form of containerized plug-ins to achieve communication capabilities between containers;
[0092] Furthermore, the scheduler periodically monitors the status of each plug-in container. When the status of the plug-in container is normal, it returns the number of queued tasks and the number of concurrent processing tasks of the plug-in. The scheduler implements the task allocation scheduling capability based on load balancing according to the number of queued tasks and the number of workers of each container plug-in.
[0093] Furthermore, when the scheduler detects an abnormal container during heartbeat monitoring, it will restart the plug-in container through the Docker service and restore it to the state before the abnormality, thus realizing the plug-in container keep-alive capability.
[0094] Furthermore, the scheduler creates or destroys container copies through the Docker service according to the load of each container plug-in, thereby achieving the ability to dynamically expand and shrink capacity.
[0095] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A containerized multi-plug-in firmware analysis task scheduling system, characterized in that: include: Unpacking plug-in, which is used to nest unpack the firmware and the binary files that can be unpacked in the firmware to extract the binary files that can be directly analyzed; An analysis plug-in, which is used to analyze the binary file, and the analysis plug-in includes a software component detection plug-in, a CVE vulnerability search plug-in, a CWE defect search plug-in, a security compilation option analysis plug-in, a sensitive information analysis plug-in, a firmware simulation plug-in, and a dynamic fuzz test plug-in; A scheduler, which is used to send the unpackable binary file to the unpacking plug-in and send the directly analyzable binary file to the analysis plug-in according to load balancing, and when a high-load plug-in appears, create a container copy of it to improve its analysis capability to reduce the load, and when a low-load plug-in or no-load plug-in appears, remove the duplicate plug-in container copy to reduce system pressure; A database is used to store the result information analyzed by the analysis plug-in.
2. The containerized multi-plug-in firmware analysis task scheduling system according to claim 1 is characterized in that: The unpacking plug-in includes an initialization process, a heartbeat monitoring process, and an unpacking process; The initialization process includes: when the plug-in container is started, the initialization unit constructs registration information; the initialization unit sends the registration information to the sending unit; the sending unit sends the registration information to the scheduler in a gRPC manner; The heartbeat monitoring process includes: a receiving unit receives data; when the data is heartbeat monitoring request data, constructs heartbeat monitoring return data; sends the heartbeat monitoring return data to the sending unit; the sending unit sends the heartbeat monitoring return data to the scheduler in a gRPC manner; The unpacking process includes: the receiving unit receives the data; when the data is task data, the task data is placed at the end of the task queue; the task distribution unit detects in real time whether there is an idle worker in the thread pool, and when there is an idle worker, the head task data of the task queue is popped out and the head task data is sent to the thread pool; the idle worker in the thread pool obtains the head task data and performs an unpacking operation to generate a sub-file; when the unpacking operation is completed, the idle worker marks the original task data as unpacking completed; the idle worker constructs sub-task data for the unpacked sub-file; the idle worker sends the marked completed original task data and the sub-task data to the sending unit; the sending unit sends the marked completed original task data and the sub-task data to the scheduler.
3. The containerized multi-plug-in firmware analysis task scheduling system according to claim 2 is characterized in that: The registration information includes the plug-in gRPC communication port number, host name, number of workers, and plug-in name.
4. The containerized multi-plug-in firmware analysis task scheduling system according to claim 2 is characterized in that: The heartbeat monitoring return data includes load situation information, and the load situation information includes the number of queued tasks.
5. The containerized multi-plug-in firmware analysis task scheduling system according to claim 1 is characterized in that: The scheduler includes a plug-in registration process, a heartbeat monitoring process, and a task scheduling process; The plug-in registration process includes: when a receiving unit receives data, if the data is plug-in registration information data, the plug-in registration information data is saved in a plug-in load information table; and a sending unit notifies the plug-in container of successful registration according to the host name and port number in the plug-in registration information data; The heartbeat monitoring process includes: the heartbeat monitoring unit periodically sends heartbeat monitoring request data to the sending unit; the sending unit sends the heartbeat monitoring request data to the plug-in container; the plug-in container replies with heartbeat monitoring return data; the receiving unit receives the data, and when the data is heartbeat monitoring return data, it sends it to the heartbeat monitoring unit; the heartbeat monitoring unit updates the plug-in load information table according to the load data in the received heartbeat monitoring return data; when the heartbeat monitoring unit does not receive the heartbeat monitoring return data of a plug-in within a preset time, the state abnormality information of the plug-in is notified to the container control unit; the container control unit restarts the service through the Docker service, and sends the unfinished tasks of the plug-in in the plug-in load information table to the plug-in; The task scheduling process includes: uploading firmware through http service and starting tasks; constructing firmware task data and inserting it to the end of the task queue; the task distribution unit pops up the task data at the head of the task queue in real time; when the popped-up task data at the head of the queue has completed all plug-in analyses, the data is saved in the database; when the popped-up task data at the head of the queue has not completed all plug-in analyses, the unfinished analysis list is counted; according to the load data in the plug-in load information table and the unfinished analysis list, the plug-in with the smallest load is calculated; according to the plug-in with the smallest load and the plug-in information in the plug-in load information table, the task data is sent to the sending unit; the task data is recorded in the plug-in load information table; the sending unit sends the task data to the plug-in container; after the plug-in container receives the task data and analyzes and processes it, the marked completed task data is sent back to the scheduler; the receiving unit receives the data; if the analyzed data is task data, the task data is inserted into the end of the task queue.
6. The containerized multi-plug-in firmware analysis task scheduling system according to claim 5 is characterized in that: The scheduler also includes a dynamic expansion and contraction process, including: the container control unit periodically detects the plug-in load in the plug-in load information table; when the number of plug-in queued tasks divided by the number of workers is greater than a preset value, a copy of the plug-in container is created through the Docker service; when the number of plug-in queued tasks is 0 and the plug-in container is a copy container, the plug-in container is deleted through the Docker service, and the relevant data in the plug-in load information table is cleaned up.
7. The containerized multi-plug-in firmware analysis task scheduling system according to claim 1 is characterized in that: The analysis plug-in includes an initialization process, a heartbeat monitoring process, and an analysis plug-in analysis process; The initialization process includes: when the plug-in container is started, the initialization unit constructs registration information; the initialization unit sends the registration information to the sending unit; the sending unit sends the registration information to the sending unit in a gRPC manner; The heartbeat monitoring process includes: a receiving unit receives data; when the data is heartbeat monitoring request data, constructs heartbeat monitoring return data; sends the heartbeat monitoring return data to a sending unit; the sending unit sends the heartbeat monitoring return data to the scheduler in a gRPC manner; The analysis plug-in analysis process includes: a receiving unit receives data; when the data is task data, the task data is placed at the end of the task queue; a task distribution unit detects in real time whether there is an idle worker in the thread pool, and when there is an idle worker, the head task data of the task queue is popped up and the head task data is sent to the thread pool; the idle worker in the thread pool obtains the head task data and performs an analysis operation; when the analysis operation is completed, the idle worker marks the head task data as completed and saves the analysis result to the original data to obtain the modified task data; the modified task data is sent to the sending unit; the sending unit sends the modified task data to the scheduler.
8. The containerized multi-plug-in firmware analysis task scheduling system according to claim 7 is characterized in that: The registration information includes the plug-in gRPC communication port number, host name, number of workers, and plug-in name.
9. The containerized multi-plug-in firmware analysis task scheduling system according to claim 7, characterized in that: The heartbeat monitoring return data includes load situation information, and the load situation information includes the number of queued tasks.
10. A method for scheduling containerized multi-plug-in firmware analysis tasks, characterized in that: include: Nested unpacking of the firmware and the binary files that can be unpacked in the firmware to extract binary files that can be directly analyzed; Analyze the binary file, the analysis plug-in includes a software component detection plug-in, a CVE vulnerability search plug-in, a CWE defect search plug-in, a security compilation option analysis plug-in, a sensitive information analysis plug-in, a firmware simulation plug-in and a dynamic fuzz test plug-in; Send the unpackable binary file to the unpacking plug-in and send the directly analyzable binary file to the analysis plug-in according to load balancing. When a high-load plug-in appears, create a container copy of it to improve its analysis capability to reduce the load. When a low-load plug-in or a no-load plug-in appears, remove the duplicate plug-in container copy to reduce system pressure. The result information of the analysis by the analysis plug-in is stored.
Citation Information
Patent Citations
Construction method and device for container group
CN108664291A
Container coil heat expansion system and method and medium
CN117311627A
Capacity expansion and shrinkage method and device of container management system, medium and equipment
CN117493015A
Plug-in construction method and system based on GRPC
CN117950628A
System and method to execute and manage load tests using containers
US20190034313A1
