Open source component scanning method and system, electronic equipment and storage medium
Through the automated open source component vulnerability scanning method, the component type and parsing time are identified, the scanning sequence is optimized, and the target user identification information is combined to solve the problem of low efficiency of traditional manual scanning, achieve efficient vulnerability detection and cost reduction, and ensure the communication system safety.
Patent Information
- Application Number
- CN202410912187.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-10-18
AI Technical Summary
Traditional open source component vulnerability checks rely on manual scanning, which is inefficient and costly. Existing open source scanning tools cannot effectively and quickly scan, resulting in insufficient vulnerability detection efficiency.
By obtaining the project text of open source components, identifying the component type, parsing the text and determining the scanning order according to the parsing time and type priority, automatic vulnerability scanning is implemented, marking and tracing are combined with the target user identification information, and the sorting of scanning results is optimized.
It realizes automated vulnerability scanning of open source components, reduces manual participation costs, improves scanning efficiency and accuracy, and ensures the security of communication systems.
Smart Images

Figure CN118797657A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of security vulnerability scanning, and in particular to an open source component scanning method, system, electronic device and storage medium. Background Art
[0002] Open source components are widely used in the communications industry, and using them can significantly reduce software development and operation and maintenance costs. Since open source software is free and has accessible source code, it can save companies money on license fees, proprietary software, and development costs. It can also improve the quality and reliability of communications. Open source components have usually been extensively tested and verified, and because of their open code, they are constantly being repaired and improved by the community. Therefore, they are usually more stable, secure, and reliable than proprietary software. At the same time, using open source components can promote innovation and flexibility. Open source software usually has a modular and extensible architecture, which allows users to customize and expand it according to specific needs. And because the source code of open source software is available, companies and organizations can also conduct secondary development to meet their unique needs.
[0003] It can be seen that open source components have many advantages in the communications industry. Open source components can help enterprises and organizations in the communications industry reduce operation and maintenance costs while improving the quality and efficiency of their products and services. At the same time, their source code and community support also allow users to freely customize and improve components to meet their specific needs and requirements.
[0004] Open source components in the traditional communications industry are often checked for vulnerabilities through manual scanning. Manual scanning has great disadvantages such as large workload, low efficiency, and high labor costs. Although the existing open source scanning tools on the market have solved the problems of low efficiency and high labor requirements of manual scanning to a certain extent, they only output scanning results in order based on the upload time, and cannot achieve scanning effectively and quickly. Therefore, how to effectively solve the problem of scanning sorting to achieve scanning effectively and quickly has become an important problem that needs to be solved in the field of vulnerability detection technology. Summary of the invention
[0005] The present invention provides an open source component scanning method, system, electronic device and storage medium to solve the defects existing in the related technology.
[0006] The present invention provides an open source component scanning method, comprising: Obtain the project text of each open source component to be detected; Identify the project text, determine the type of each open source component to be detected, parse the project text, determine the parsed text and parsing time of the project text, and determine the scanning order of the parsed text based on the parsing time and according to the priority of the type of each open source component to be detected; Based on the scanning order, the parsed text is scanned for vulnerabilities.
[0007] An open source component scanning method provided by the present invention also includes: Obtain identification information of a target user of the project text; Based on the identification information, the project text is marked.
[0008] According to an open source component scanning method provided by the present invention, the priority of each type of open source component to be detected includes a first priority and a second priority, and the scanning time of the open source component to be detected with the first priority is shorter than the scanning time of the open source component to be detected with the second priority.
[0009] According to an open source component scanning method provided by the present invention, the scanning order of the parsed text is determined based on the parsing time and according to the priority of the type of each open source component to be detected, including: Determining a comprehensive ranking value of the parsed text based on the size of the project text and the parsing time; Based on the comprehensive ranking value, the scanning order of the parsed text is determined according to the priority of the types of the open source components to be detected.
[0010] According to an open source component scanning method provided by the present invention, the comprehensive ranking value of the parsed text is determined based on the size of the project text and the parsing time, including: The size of the project text and the parsing time are weighted and summed to obtain the comprehensive ranking value.
[0011] According to an open source component scanning method provided by the present invention, the scanning order of the parsed text is determined based on the comprehensive ranking value and according to the priority of the type of each open source component to be detected, including: The scanning order of the parsed text of each type of the open source component to be detected is determined based on the comprehensive ranking value in descending order of priority of the types of the open source components to be detected.
[0012] According to an open source component scanning method provided by the present invention, the vulnerability scanning of the parsed text based on the scanning order includes: Identify open source component data that contains vulnerabilities; Based on the scanning order, the parsed text is matched with the open source component data to determine whether the parsed text contains a vulnerability.
[0013] The present invention also provides an open source component scanning system, comprising: An open source component uploading unit, used to obtain the project text of each open source component to be detected; an open source component preprocessing unit, configured to identify the project text, determine the type of each open source component to be detected, parse the project text, determine the parsed text and parsing time of the project text, and determine the scanning order of the parsed text based on the parsing time and according to the priority of the type of each open source component to be detected; The vulnerability search unit is used to perform vulnerability scanning on the parsed text based on the scanning order.
[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the open source component scanning methods described above is implemented.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the open source component scanning method as described in any one of the above is implemented.
[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the open source component scanning method described above is implemented.
[0017] The open source component scanning method, system, electronic device and storage medium provided by the present invention can realize automated vulnerability scanning of each open source component to be detected, reduce manual participation, and reduce scanning costs. Moreover, the introduction of identification information of the target user of the method can facilitate the tracing of the target user. By combining the priority of the type of each open source component to be detected and the parsing time obtained by parsing the project text, the scanning order of the parsed text is determined, and the sorting effect of the scanning results can be achieved first, thereby improving the scanning efficiency of the parsed text of each open source component to be detected. The method can be applied to the communication field to ensure the security of the communication system. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 It is a flowchart of the open source component scanning method provided by the present invention.
[0020] Figure 2 It is a structural schematic diagram of the open source component scanning system provided by the present invention.
[0021] Figure 3 It is a structural schematic diagram of an open source component uploading unit in the open source component scanning system provided by the present invention.
[0022] Figure 4 It is a structural schematic diagram of an open source component preprocessing unit in the open source component scanning system provided by the present invention.
[0023] Figure 5 It is a structural schematic diagram of a vulnerability search unit in the open source component scanning system provided by the present invention.
[0024] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings 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.
[0026] In the prior art, the vulnerability check of open source components by manual scanning has great disadvantages such as large workload, low efficiency, and high labor cost. The vulnerability detection method implemented by the open source scanning tool only outputs the scanning results in the order based on the upload time, which cannot effectively and quickly implement the scanning. Therefore, an open source component scanning method is provided in the embodiment of the present invention.
[0027] Figure 1 A schematic diagram of a flow chart of an open source component scanning method provided in an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method includes: S1, obtain the project text of each open source component to be detected; S2, identifying the project text, determining the type of each open source component to be detected, and parsing the project text to determine the parsed text and parsing information of the project text, and determining the scanning order of the parsed text based on the parsing information and according to the priority of the type of each open source component to be detected; S3 performs vulnerability scanning on the parsed text based on the scanning order.
[0028] Specifically, the open source component scanning method provided in the embodiment of the present invention is executed by an open source component scanning system, which can be configured in a computer, which can be a local computer or a cloud computer, and the local computer can be a computer, a tablet, etc., which is not specifically limited here. The method can be executed according to a specified period, and the specified period can be set as needed, for example, it can be a week, a month, a quarter, etc., which is not specifically limited here.
[0029] First, step S1 is performed to obtain the project text of each open source component to be detected. The open source component to be detected refers to the open source component that needs to be determined whether it has a vulnerability, and there may be multiple open source components. The specific number of open source components to be detected can be set as needed and is not specifically limited here.
[0030] Each open source component to be detected has a project text, which is a project description document used to help users better understand and use the open source component to be detected and provide support for the actual application of the open source component to be detected.
[0031] The project text may include at least one of the following: Project goal: clarify the goals and vision of the open source component to be tested so that users can understand what the open source component to be tested can do; Functional features: Introduce the main functional features of the open source component to be tested so that users can understand its feasibility and applicability; Installation and Usage Guide: Provides documentation on how to install and configure the open source component to be detected, as well as guidance on how to use the open source component to be detected; Application Programming Interface (API) and development documentation: Provide API documentation and developer guides to support secondary development and customization; FAQ: List some common problems and solutions to help users solve problems quickly; Version history: records the version update history and major improvements of the open source components to be detected to help users choose the best version; License Agreement: Detailed description of the license type and usage constraints of the open source component to be detected.
[0032] After obtaining the project text of each open source component to be detected, the project text of each open source component to be detected may be stored in a database.
[0033] Thereafter, step S2 is executed to identify the project text and determine the type of each open source component to be detected. It is understandable that the time consumption of different types of open source components to be detected during vulnerability scanning may be different, because the code structure, implementation logic, functional characteristics, etc. of each type of open source component to be detected are different, and there are also different vulnerability risks and security issues. For example, for some simple libraries or tools, they usually have only a few functions or classes, and are mainly responsible for a more specific task. When scanning, possible vulnerabilities and risks can be quickly detected. For some complex applications or systems, their codes may be distributed among multiple directories, modules, or even servers, and involve multiple different functions and services. In this case, more time and resources are required to perform vulnerability scanning to ensure its security and stability.
[0034] In addition, different types of open source components to be detected may involve different security risks and threats. For example, some open source components to be detected may have vulnerabilities such as buffer overflow, code injection, and password cracking, while other open source components to be detected may have security issues in access control, authentication, data transmission, etc. Therefore, when performing vulnerability scanning, it is necessary to distinguish between different types of open source components to be detected, and use corresponding technologies and tools to analyze and evaluate them. In short, different types of open source components to be detected may take different amounts of time to scan for vulnerabilities, and need to be evaluated and handled according to the specific situation.
[0035] In the embodiment of the present invention, the types of open source components to be detected may include operating systems, application servers, databases, programming languages, frameworks, application software, security tools, device firmware, etc. Among them, operating systems include Linux, Windows, macOS and other operating systems; application servers include Apache, Nginx, Tomcat, etc.; databases include MySQL, PostgreSQL, Oracle, etc.; programming languages include Java, Python, C++, etc.; frameworks include Spring, Django, Ruby on Rails, etc.; application software include WordPress, Drupal, Magento, etc.; security tools include Metasploit, OpenVAS, etc.; device firmware includes firmware for routers, switches and other devices.
[0036] By identifying the types of each open source component to be detected, the management and risk assessment of the open source components to be detected can be better performed, and they can be processed according to different types later. Therefore, during the vulnerability scanning process, vulnerability scanning can also be performed based on different types to improve the scanning efficiency.
[0037] Here, the priority of each type of open source component to be detected can be determined according to the scanning time of each open source component to be detected. For example, the priority of each type of open source component to be detected may include a first priority and a second priority, and the scanning time of the open source component to be detected with the first priority may be less than the scanning time of the open source component to be detected with the second priority.
[0038] The first priority open source components to be detected can be open source components that take a short time to scan, such as log libraries, JSON parsing libraries, image processing libraries, etc. The log library usually has only one or a few functional points, and the code is relatively small, so the time for vulnerability scanning is usually short. The JSON parsing library is mainly used for simple data format conversion, and its code is relatively simple, so the vulnerability scanning time is relatively short. The image processing library usually only involves operations such as reading, converting or editing image files, so the code volume is relatively small and the scanning time is relatively short.
[0039] The second priority open source components to be detected may be open source components that take a long time to detect, such as web frameworks, database systems, operating systems, etc. Web frameworks usually contain a large amount of code and complex functional modules, and need to support multiple databases and web protocols, so vulnerability scanning takes a long time; database systems usually contain complex data structures, processing algorithms, query languages and other functions, and also require a high degree of security and reliability, so vulnerability scanning will also take a long time; the operating system is a core component of the computer system, with a very high amount of code and complexity, and involves security issues at multiple levels and links, so vulnerability scanning takes a long time.
[0040] In the embodiment of the present invention, a parsing script may also be used to parse the project text to determine the parsed text and parsing duration of the project text. Here, the parsing script is a program code for parsing the project text, and the parsing script may be stored in a database.
[0041] The scanning order of the parsed text is determined by using the parsing time and the priority of the type of each open source component to be detected. Here, the scanning order of the parsed text of each open source component to be detected can be determined according to the parsing time and the priority of the type of each open source component to be detected. The difference in parsing time indicates that the complexity of the project text is different, and the scanning order determined thereby can improve the scanning efficiency. For example, in each open source component to be detected with different priorities, the scanning order of the parsed text is determined in the order from short to long according to the parsing time. First, in the open source components to be detected with the first priority, the parsing time of the project text of each open source component to be detected with the first priority can be arranged in the order from short to long as the scanning order of the parsed text. Then, in the open source components to be detected with the second priority, the parsing time of the project text of each open source component to be detected with the second priority can be arranged in the order from short to long as the scanning order of the parsed text.
[0042] Finally, step S3 is executed to perform vulnerability scanning on the parsed text of each open source component to be detected according to the determined scanning order.
[0043] The process of vulnerability scanning is to determine whether each open source component to be detected has a vulnerability through the parsed text of each open source component to be detected. A matching method can be used to match the parsed text of each open source component to be detected with the open source component data containing vulnerabilities. If the parsed text of a certain open source component to be detected has matching open source component data, it is determined that the open source component to be detected has a vulnerability, and the vulnerability information can be determined. The vulnerability information may include information such as the number of vulnerabilities, the type of vulnerability, and the name of the vulnerability. It can be seen that the vulnerability detection result may include whether the open source component to be detected has a vulnerability and the vulnerability information when a vulnerability exists. Among them, the open source component data containing vulnerabilities can be uploaded in advance by the user and stored in the vulnerability relationship library.
[0044] Here, the matching method used includes but is not limited to being implemented through a software composition analysis (SCA) tool, etc. For example, Dependency-Check in the SCA tool can be used to detect publicly disclosed vulnerabilities contained in the dependencies of the open source component to be detected.
[0045] Afterwards, the vulnerability detection results can be associated with the project text and stored, and the user can determine whether to use the corresponding open source component to be detected by viewing the vulnerability detection results.
[0046] The open source component scanning method provided in the embodiment of the present invention first obtains the project text of each open source component to be detected; thereafter, the project text is identified to determine the type of each open source component to be detected, and the project text is parsed to determine the parsed text and parsing time of the project text, and the parsing time is used to determine the scanning order of the parsed text according to the priority of the type of each open source component to be detected; finally, based on the scanning order, the parsed text is scanned for vulnerabilities. The method can realize automated vulnerability scanning of each open source component to be detected, reduce manual participation, and reduce scanning costs. Moreover, the introduction of identification information of the target user of the method can facilitate the tracing of the target user. In combination with the priority of the type of each open source component to be detected and the parsing time obtained by parsing the project text, the scanning order of the parsed text is determined, and the sorting effect of the scanning results can be achieved first, thereby improving the scanning efficiency of the parsed text of each open source component to be detected. The method can be applied to the communication field to ensure the security of the communication system.
[0047] In the prior art, there is a lack of accurate uploader tracing effect when a large number of uploaders upload texts of different projects. Based on this, on the basis of the above embodiment, the method further includes: Obtain identification information of a target user of the project text; Based on the identification information, the project text is marked.
[0048] Specifically, since the project text of each open source component to be detected can be uploaded to the open source component scanning system by the target user and received by the open source component scanning system, the open source component scanning system can also obtain the identification information of the target user of the project text. The target user refers to the user who uploaded the project text, and the identification information of the target user can be the unique identifier (Identifier) of the open source component to be detected uploaded by the target user, also called a software package identifier or a name identifier, or it can be the ID or name of the target user.
[0049] The unique identifier of the open source component to be detected is a string used to identify a software package or library, which may include: Package name: usually used in Linux distributions to uniquely identify a software package; Group name / domain name: a unique identifier used to specify Java packages and Python modules; Git URL: Use the Git repository URL as a unique identifier; Maven coordinates: Maven coordinates refer to the three elements that uniquely identify Java components in the Maven build system: groupId, artifactId, and version; PyPI package name: used to uniquely identify the Python package; NPM module name: used to uniquely identify a Node.js module.
[0050] The target user's identification information can be used to mark the project text so that the project text carries the target user's identification information. The target user's identification information is then also included in the vulnerability detection results. This allows the target user to be accurately traced after multiple target users upload project texts, thereby matching the vulnerability detection results with the target users.
[0051] On the basis of the above embodiment, the priority of each type of open source component to be detected includes a first priority and a second priority, and the scanning time of the open source component to be detected with the first priority is shorter than the scanning time of the open source component to be detected with the second priority. In this way, when determining the scanning order of the parsed text by using the parsing time and the priority of the type of each open source component to be detected, the parsed text that is easy to obtain the scanning result can be arranged at the front position in the scanning order to ensure that it is scanned for vulnerabilities first.
[0052] On the basis of the above embodiment, the step of determining the scanning order of the parsed text based on the parsing time and according to the priority of the types of the open source components to be detected includes: Determining a comprehensive ranking value of the parsed text based on the size of the project text and the parsing time; Based on the comprehensive ranking value, the scanning order of the parsed text is determined according to the priority of the types of the open source components to be detected.
[0053] Specifically, when determining the scanning order of the parsed text, the size of the project text and the parsing time may be used to determine the comprehensive ranking value of the parsed text.
[0054] It is understandable that when calculating the comprehensive ranking value, the parsing time of the project text is shorter than the scanning time of the vulnerability. For example, in vulnerability scanning, it is often necessary to match the parsed text with the open source component data containing the vulnerability, which means that there are other operations to be done after parsing. By combining the parsing time and the size of the target text to calculate the comprehensive ranking value, the complexity of the project text can be more fully expressed.
[0055] Thereafter, the comprehensive ranking value of the parsed text can be used to determine the scanning order of the parsed text according to the priority of the type of each open source component to be detected. For example, the scanning order of the parsed text can be determined in the order of the comprehensive ranking value of the parsed text from short to long under each open source component to be detected with different priorities. First, among the open source components to be detected with the first priority, the comprehensive ranking values of the parsed texts of the first priority open source components to be detected can be arranged in order from short to long as the scanning order of the parsed text. Then, among the open source components to be detected with the second priority, the comprehensive ranking values of the parsed texts of the second priority open source components to be detected can be arranged in order from short to long as the scanning order of the parsed text, so that the sorting effect of obtaining the scanning result first can be achieved.
[0056] On the basis of the above embodiment, the step of determining the comprehensive ranking value of the parsed text based on the size of the project text and the parsing time includes: The size of the project text and the parsing time are weighted and summed to obtain the comprehensive ranking value.
[0057] Specifically, when calculating the comprehensive ranking value of the parsed text, the following formula can be used: ; in, , are all positive parameters, For the Parsing time of each project text, For the The size of the item text.
[0058] On the basis of the above embodiment, the step of determining the scanning order of the parsed text based on the comprehensive ranking value and according to the priority of the types of the open source components to be detected includes: The scanning order of the parsed text of each type of the open source component to be detected is determined based on the comprehensive ranking value in descending order of priority of the types of the open source components to be detected.
[0059] Specifically, when determining the scanning order of the parsed text, the scanning order of the parsed text of each type of open source component to be detected can be determined based on the comprehensive ranking value in the order of the priority of each type of open source component to be detected from high to low. That is, in the order of priority from high to low, the open source components to be detected of each priority are traversed, and for each open source component to be detected of each priority, the scanning order of the parsed text of each open source component to be detected of the priority is determined using the order of the comprehensive ranking value from low to high.
[0060] Based on the above embodiment, the vulnerability scanning of the parsed text based on the scanning order includes: Identify open source component data that contains vulnerabilities; Based on the scanning order, the parsed text is matched with the open source component data to determine whether the parsed text contains a vulnerability.
[0061] Specifically, when performing vulnerability scanning on the parsed text, the open source component resources containing vulnerabilities stored in the vulnerability relationship library may be determined first.
[0062] Then, according to the determined scanning order, a matching algorithm is used to match the parsed text of each open source component to be detected with the open source component resources, and whether the parsed text contains vulnerabilities is determined based on the matching results.
[0063] Based on the above embodiment, the step of parsing the project text to determine the parsed text and parsing time of the project text includes: Convert the project texts of the open source components to be detected with the same priority into JSON files; The JSON file is parsed to obtain the parsed text and the parsing time.
[0064] Specifically, when parsing the project text, the project text of the open source components to be detected with the same priority can be converted into a JSON file first, and then the JSON file can be parsed to obtain the parsed text and parsing time, so as to facilitate vulnerability scanning of the parsed text of the open source components to be detected with the same priority.
[0065] like Figure 2 As shown, based on the above embodiment, an open source component scanning system is provided in an embodiment of the present invention, including: The open source component uploading unit 100 is used to obtain the project text of each open source component to be detected; The open source component preprocessing unit 200 is used to identify the project text, determine the type of each open source component to be detected, and parse the project text to determine the parsed text and parsing time of the project text, and determine the scanning order of the parsed text based on the parsing time and according to the priority of the type of each open source component to be detected; The vulnerability search unit 300 is used to perform vulnerability scanning on the parsed text based on the scanning order.
[0066] like Figure 3 As shown, based on the above embodiment, in the open source component scanning system provided in the embodiment of the present invention, the open source component uploading unit includes an uploading marking module 120, which is used to: Obtain identification information of a target user of the project text; Based on the identification information, the project text is marked.
[0067] In addition, the open source component uploading unit further includes a file uploading module 110 and a first communication module 130, and the file uploading module 110 and the first communication module 130 are respectively connected to the upload marking module 110. The file uploading module 110 is used to obtain the project text of each open source component to be detected, and the first communication module 130 is used to establish the interaction between the open source component uploading unit and the open source component preprocessing unit component.
[0068] On the basis of the above-mentioned embodiments, in the open source component scanning system provided in the embodiments of the present invention, the priority of each type of open source component to be detected includes a first priority and a second priority, and the scanning time of the open source component to be detected with the first priority is shorter than the scanning time of the open source component to be detected with the second priority.
[0069] like Figure 4 As shown, based on the above embodiment, in the open source component scanning system provided in the embodiment of the present invention, the open source component preprocessing unit includes a file sorting module 240 for: Determining a comprehensive ranking value of the parsed text based on the size of the project text and the parsing time; Based on the comprehensive ranking value, the scanning order of the parsed text is determined according to the priority of the types of the open source components to be detected.
[0070] In addition, the open source component preprocessing unit may further include a type identification module 220 , a file parsing module 230 , a second communication module 210 and a database module 250 .
[0071] The type identification module 220 is used to identify the project text and determine the type of each open source component to be detected.
[0072] The file parsing module 230 is used to parse the project text and determine the parsed text and parsing time of the project text.
[0073] The second communication module 210 is used to connect with the open source component uploading unit and the vulnerability finding unit.
[0074] The database module 250 is used to store the parsing script and the project text in a database.
[0075] On the basis of the above-mentioned embodiment, in the open source component scanning system provided in the embodiment of the present invention, the file sorting module 240 is specifically used for: The size of the project text and the parsing time are weighted and summed to obtain the comprehensive ranking value.
[0076] On the basis of the above-mentioned embodiment, in the open source component scanning system provided in the embodiment of the present invention, the file sorting module 240 is further specifically used for: The scanning order of the parsed text of each type of the open source component to be detected is determined based on the comprehensive ranking value in descending order of priority of the types of the open source components to be detected.
[0077] like Figure 5 As shown, based on the above embodiment, in the open source component scanning system provided in the embodiment of the present invention, the vulnerability search unit includes a vulnerability matching module 320 for: Identify open source component data that contains vulnerabilities; Based on the scanning order, the parsed text is matched with the open source component data to determine whether the parsed text contains a vulnerability.
[0078] In addition, the vulnerability search unit further includes a third communication module 310 , a data upload module 350 , a vulnerability relationship library module 330 and a vulnerability recording module 340 .
[0079] The third communication module 310 is used to connect with the open source component preprocessing unit.
[0080] The data upload module 350 is used to obtain the open source component data containing vulnerabilities.
[0081] The vulnerability relationship library module 330 is used to store open source component data.
[0082] The vulnerability recording module 340 is used to record vulnerability detection results.
[0083] Specifically, the functions of each unit and each module in the open source component scanning system provided in the embodiment of the present invention correspond one-to-one to the operation process of each step in the above method embodiment, and the effects achieved are also consistent. Please refer to the above embodiment for details, and no further details will be given in the embodiment of the present invention.
[0084] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the open source component scanning method provided in the above embodiments.
[0085] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the relevant technology or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0086] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the open source component scanning method provided in the above embodiments.
[0087] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the open source component scanning method provided in the above embodiments.
[0088] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0089] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.
[0090] 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 make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An open source component scanning method, It is characterized in that include: Obtain the project text of each open source component to be detected; Identify the project text, determine the type of each open source component to be detected, parse the project text, determine the parsed text and parsing time of the project text, and determine the scanning order of the parsed text based on the parsing time and according to the priority of the type of each open source component to be detected; Based on the scanning order, the parsed text is scanned for vulnerabilities.
2. The open source component scanning method according to claim 1, It is characterized in that Also includes: Obtain identification information of a target user of the project text; Based on the identification information, the project text is marked.
3. The open source component scanning method according to claim 1, It is characterized in that The priorities of the types of the open source components to be detected include a first priority and a second priority, and the scanning time of the open source components to be detected with the first priority is shorter than the scanning time of the open source components to be detected with the second priority.
4. The open source component scanning method according to claim 1, It is characterized in that The determining, based on the parsing time and according to the priority of the types of the open source components to be detected, a scanning order of the parsed text includes: Determining a comprehensive ranking value of the parsed text based on the size of the project text and the parsing time; Based on the comprehensive ranking value, the scanning order of the parsed text is determined according to the priority of the types of the open source components to be detected.
5. The open source component scanning method according to claim 4, It is characterized in that The step of determining the comprehensive ranking value of the parsed text based on the size of the project text and the parsing time includes: The size of the project text and the parsing time are weighted and summed to obtain the comprehensive ranking value.
6. The open source component scanning method according to claim 4, It is characterized in that The step of determining the scanning order of the parsed text based on the comprehensive ranking value and according to the priority of the types of the open source components to be detected includes: The scanning order of the parsed text of each type of the open source component to be detected is determined based on the comprehensive ranking value in descending order of priority of the types of the open source components to be detected.
7. The open source component scanning method according to any one of claims 1 to 6, It is characterized in that The performing vulnerability scanning on the parsed text based on the scanning order includes: Identify open source component data that contains vulnerabilities; Based on the scanning order, the parsed text is matched with the open source component data to determine whether the parsed text contains a vulnerability.
8. An open source component scanning system, It is characterized in that include: An open source component uploading unit, used to obtain the project text of each open source component to be detected; an open source component preprocessing unit, configured to identify the project text, determine the type of each open source component to be detected, parse the project text, determine the parsed text and parsing time of the project text, and determine the scanning order of the parsed text based on the parsing time and according to the priority of the type of each open source component to be detected; The vulnerability search unit is used to perform vulnerability scanning on the parsed text based on the scanning order.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the open source component scanning method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the open source component scanning method according to any one of claims 1 to 7 is implemented.
