Component association relationship mining method and device based on knowledge graph and jaccard similarity, electronic equipment and storage medium
By constructing a knowledge graph and using the Jaccard similarity algorithm, the relationships between components are identified and mined, which solves the problem of insufficient identification of component relationships in existing technologies and improves system security and the effectiveness of component management.
Patent Information
- Application Number
- CN202311465975.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-06
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-11-06
AI Technical Summary
The lack of effective identification of relationships between components in existing technologies leads to the spread of vulnerabilities and security issues, making it difficult to effectively manage and maintain components.
We employ a knowledge graph and Jaccard similarity approach. By acquiring component-related datasets, we construct a knowledge graph and use Jaccard similarity to calculate the similarity between components, thereby identifying and mining the relationships between them.
It improves the accuracy and completeness of component relationship mining, enhances system security, and enables better identification and management of relationships between components, preventing the spread of vulnerabilities.
Smart Images

Figure CN117435644B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network security technology, specifically to a method, apparatus, electronic device, and storage medium for mining component association relationships based on knowledge graphs and Jaccard similarity. Background Technology
[0002] With the development of information technology, components are widely used in various operating systems, greatly improving software development efficiency. However, as software scales up, vulnerabilities and security issues in components also increase. These security issues may originate from the components used in the system; components are the ultimate targets of vulnerabilities. The CPE (Common Platform Enumeration) specification defines basic information such as the component's vendor, name, version, and type (software, hardware, operating system), but the relationships between components are often overlooked, leading to the spread of vulnerabilities and security issues. To better manage and maintain components, accurately identifying the relationships between them becomes crucial. Summary of the Invention
[0003] In view of this, the present invention provides a method, apparatus, electronic device and storage medium for mining component association relationships based on knowledge graphs and Jaccard similarity, in order to solve the problem of lack of identification of association relationships between components.
[0004] In a first aspect, the present invention provides a method for mining component association relationships based on knowledge graphs and Jaccard similarity. The method includes: obtaining components to be associated; obtaining components belonging to the same level as the component to be associated based on a pre-built knowledge graph, wherein the same level includes any one or more levels of the same vulnerability type, the same component type, or the same vendor; calculating the similarity between the component to be associated and the components belonging to the same level using Jaccard similarity to obtain the similarity calculation result; and obtaining the associated components of the component to be associated based on the similarity calculation result.
[0005] In this embodiment, the associations between components are constructed using a knowledge graph, improving the accuracy and completeness of mining related components. The Jaccard algorithm and knowledge graph are employed for mining related components, addressing the problem of lacking identification of relationships between components. This method can more efficiently mine related components, thereby better ensuring system security. This method can be widely applied in the field of software security and is of great significance for the analysis and prevention of component vulnerabilities.
[0006] In one alternative implementation, the knowledge graph is constructed as follows: A dataset related to components and vulnerabilities is acquired, including a CVE dataset, a CWE dataset, a CPE dataset, a vulnerability analysis article dataset, and a component description information dataset; entities are extracted from the dataset, including CVE, CWE, component entities, and article entities; relationship recognition technology is used to mine the relationships between entities; and a knowledge graph is constructed based on the entities, the relationships between entities, and their corresponding attributes, including name, description information, category, and readability.
[0007] In this embodiment, the CVE dataset, CWE dataset, CPE dataset, vulnerability analysis article dataset, and component description information dataset are used as the original datasets for constructing the knowledge graph, making the dataset more comprehensive. The knowledge graph is constructed using entities, relationships between entities, and corresponding attributes. Therefore, the associated text information of the components to be mined includes information from various levels of the selected article entities, component description information, and attributes corresponding to CVE and CWE, making the obtained associated text information richer and more comprehensive. This results in more accurate and higher-quality keywords being mined subsequently.
[0008] In one optional implementation, when the same layer includes the same component type and the same vendor, components belonging to the same layer as the component to be associated are obtained based on a pre-built knowledge graph. This includes: determining the component type and vendor of the component to be associated based on the attributes of the component to be associated; obtaining the first type of component corresponding to the component type and the second type of component corresponding to the vendor in the knowledge graph according to the component type and vendor; obtaining the vulnerabilities associated with the first type of component and the second type of component in the knowledge graph; and, in conjunction with the knowledge graph, filtering the components affected by the vulnerabilities according to the vulnerability type of the associated vulnerabilities and the corresponding article entities, and obtaining components belonging to the same component type and components belonging to the same vendor by combining the first type of component and the second type of component.
[0009] In one optional implementation, by combining a knowledge graph, components associated with vulnerabilities are filtered based on the vulnerability type and corresponding article entities. A first type of component and a second type of component are then combined to obtain components belonging to the same component type and components belonging to the same vendor. This includes: using the knowledge graph to determine vulnerabilities belonging to a specific vulnerability type based on the vulnerability type associated with the vulnerabilities; filtering vulnerabilities based on the readability of the article entities associated with vulnerabilities belonging to that vulnerability type; and, based on the components with the effects of the filtered vulnerabilities, combining the first type of component and the second type of component to obtain components belonging to the same component type and components belonging to the same vendor.
[0010] In one optional implementation, when the same layer includes the same vulnerability type, components belonging to the same layer as the component to be associated are obtained based on a pre-built knowledge graph, including: obtaining the vulnerabilities associated with the component to be associated based on the knowledge graph; determining the vulnerabilities belonging to the vulnerability type based on the vulnerability type associated with the vulnerabilities of the component to be associated based on the knowledge graph; and filtering the components that affect the vulnerabilities of the vulnerability type based on the vendor and component type of the components affected by the vulnerabilities of the vulnerability type to obtain components belonging to the same vulnerability type as the component to be associated.
[0011] In this embodiment, the determination of associated components is achieved at three levels: vulnerability type, component type, and vendor. At the same time, when determining associated components, the readability of the article entity is used to achieve convergence constraints.
[0012] In one optional implementation, the similarity between the component to be associated and components belonging to the same level is calculated using Jaccard similarity to obtain a similarity calculation result. This includes: calculating the similarity between the component to be associated and component description information belonging to the same level using Jaccard similarity to obtain a similarity calculation result at the same level.
[0013] In one optional implementation, obtaining the associated components of the component to be associated based on the similarity calculation results includes: determining the associated components of the component to be associated at the same level based on the similarity calculation results at the same level; comparing the associated components of the component to be associated at different levels to determine the association strength of each associated component.
[0014] In this embodiment, the correlation strength of the related components is determined by identifying the related components at three levels and comparing the related components at the three levels.
[0015] In this embodiment, a knowledge graph is constructed using publicly available datasets, including CVE, CWE, CPE, publicly available vulnerability analysis articles on the internet, and detailed descriptions of components. Based on this knowledge graph, and using the Jaccard algorithm in graph theory, the relationships between components are mined from multiple dimensions, including readability, by analyzing component descriptions, associated vulnerability descriptions, and associated vulnerability analysis articles. This provides better support for component cybersecurity. Simultaneously, this method can automatically identify the relationships between software components, enabling better management and maintenance of the software system and improving network security performance. This patent allows software developers and cybersecurity professionals to understand the principles and applications of this technology, providing better support for software development and cybersecurity.
[0016] Secondly, the present invention provides a component association mining device based on knowledge graph and Jaccard similarity, comprising: a component acquisition module for acquiring components to be associated; an association module for acquiring components belonging to the same level as the component to be associated based on a pre-built knowledge graph, wherein the same level includes any one or more levels of the same vulnerability type, the same component type, or the same vendor; a similarity calculation module for calculating the similarity between the component to be associated and components belonging to the same level using Jaccard similarity to obtain a similarity calculation result; and a result determination module for obtaining the associated components of the component to be associated based on the similarity calculation result.
[0017] In one alternative implementation, the knowledge graph is constructed as follows: A dataset related to components and vulnerabilities is acquired, including a CVE dataset, a CWE dataset, a CPE dataset, a vulnerability analysis article dataset, and a component description information dataset; entities are extracted from the dataset, including CVE, CWE, component entities, and article entities; relationship recognition technology is used to mine the relationships between entities; and a knowledge graph is constructed based on the entities, the relationships between entities, and their corresponding attributes, including name, description information, category, and readability.
[0018] In one optional implementation, when the same layer includes the same component type and the same manufacturer, the association module includes: a first determining module, used to determine the component type and manufacturer of the component to be associated based on the attributes of the component to be associated; a first obtaining module, used to obtain the first type of component corresponding to the component type and the second type of component corresponding to the manufacturer in the knowledge graph according to the component type and manufacturer; a second obtaining module, used to obtain the vulnerabilities associated with the first type of component and the second type of component in the knowledge graph; and a filtering module, used to combine the knowledge graph, filter the components affected by the vulnerabilities according to the vulnerability type to which the associated vulnerabilities belong and the corresponding article entities, and combine the first type of component and the second type of component to obtain components belonging to the same component type and components belonging to the same manufacturer.
[0019] In one optional implementation, the filtering module is specifically used to: combine the knowledge graph to determine the vulnerabilities belonging to the vulnerability type based on the associated vulnerability type; filter the vulnerabilities based on the readability of the article entities associated with the vulnerabilities belonging to the vulnerability type; and based on the components of the filtered vulnerability effects, combine the first type of components and the second type of components to obtain components belonging to the same component type and components belonging to the same vendor.
[0020] In one optional implementation, when the same layer includes the same vulnerability type, the association module is specifically used to: obtain the vulnerabilities associated with the component to be associated based on the knowledge graph; combine the knowledge graph to determine the vulnerabilities belonging to the vulnerability type based on the vulnerability type to which the vulnerabilities associated with the component to be associated belong; and filter the components that are affected by the vulnerabilities belonging to the vulnerability type based on the vendor and component type of the components to which they are affected, to obtain the components that belong to the same vulnerability type as the component to be associated.
[0021] In one optional implementation, the similarity calculation module is specifically used to: calculate the similarity between the component to be associated and the component description information belonging to the same level using Jaccard similarity, and obtain the similarity calculation result at the same level.
[0022] In one optional implementation, the result determination module is specifically used to: determine the associated components of the component to be associated at the same level based on the similarity calculation results at the same level; compare the associated components of the component to be associated at different levels, and determine the association strength of each associated component.
[0023] Thirdly, the present invention provides a computer device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the component association mining method based on knowledge graph and Jaccard similarity as described in the first aspect or any corresponding embodiment.
[0024] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the component association mining method based on knowledge graph and Jaccard similarity as described in the first aspect or any corresponding embodiment thereof. Attached Figure Description
[0025] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0026] Figure 1 This is a flowchart illustrating a component association mining method based on knowledge graph and Jaccard similarity according to an embodiment of the present invention. Figure 2 This is a schematic diagram of a knowledge graph paradigm constructed according to an embodiment of the present invention; Figure 3This is a flowchart illustrating another component association mining method based on knowledge graph and Jaccard similarity according to an embodiment of the present invention; Figure 4 This is a structural block diagram of a component association mining device based on knowledge graph and Jaccard similarity according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0028] According to an embodiment of the present invention, a method for mining component association relationships based on knowledge graphs and Jaccard similarity is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0029] This embodiment provides a component association mining method based on knowledge graphs and Jaccard similarity, which can be used in electronic devices such as computers, mobile phones, and tablets. Figure 1 This is a flowchart of a component association mining method based on knowledge graphs and Jaccard similarity according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S101: Obtain the component to be associated. The component to be associated is the component whose association relationship needs to be mined, that is, the component with which the association relationship can be determined by the component association relationship mining method based on knowledge graph and Jaccard similarity provided by this invention.
[0030] Step S102 involves acquiring components belonging to the same level as the component to be associated based on a pre-built knowledge graph. The same level includes any one or more levels such as the same vulnerability type, the same component type, or the same vendor. The knowledge graph can be constructed using datasets related to components and vulnerabilities. Specifically, this dataset can be publicly available datasets on the internet, such as standard datasets related to components and vulnerabilities; it can also be crawled from cybersecurity communities and public accounts related to cybersecurity; additionally, it can be obtained from websites such as GitHub (a hosting platform for open-source and private software projects), Open Source China, and Wikipedia. The construction method of the knowledge graph can be referenced from relevant technologies and will not be elaborated further here. To facilitate querying and visualization of related terms for components at different levels, the constructed knowledge graph can be stored in a Neo4j database. When component association mining is needed, the component can be identified in the knowledge graph based on its name, and then Neo4j's Cypher search query language can be used to identify components belonging to the same level as the component to be associated. For the three levels of vulnerability type, component type, and vendor, one, two, or all three levels can be selected for association.
[0031] Step S103: The similarity between the component to be associated and components belonging to the same level is calculated using Jaccard similarity to obtain the similarity calculation results. Specifically, the Jaccard coefficient is an index used to compare the similarity of two sets, measuring their similarity by calculating the ratio of the number of elements in the intersection to the number of elements in the union of the two sets. The specific calculation formula is as follows:
[0032] This represents the number of elements in the intersection of sets A and B. This represents the number of elements in the union of sets A and B. The Jaccard coefficient ranges from [0,1]. A higher value indicates that the two sets are more similar; 0 means the two sets are completely unrelated, and 1 means the two sets are identical.
[0033] In this embodiment, the elements in set A and set B are specifically the components to be associated and the relevant information of the components belonging to the same level. For example, set A includes the relevant information of the components to be associated, and set B includes the relevant information of any component belonging to the same level. By calculating the similarity between set A and set B, the degree of association between the components to be associated and any component can be determined.
[0034] Step S104: Obtain the associated components of the component to be associated based on the similarity calculation results. Specifically, step S103 determines the degree of association between the component to be associated and any given component. This degree of association allows us to determine the associated components of the component to be associated, thus realizing the mining of component association relationships.
[0035] In this embodiment, the associations between components are constructed using a knowledge graph, improving the accuracy and completeness of mining related components. The Jaccard algorithm and knowledge graph are employed for mining related components, addressing the problem of lacking identification of relationships between components. This method can more efficiently mine related components, thereby better ensuring system security. This method can be widely applied in the field of software security and is of great significance for the analysis and prevention of component vulnerabilities.
[0036] This embodiment provides a method for mining component association relationships based on knowledge graphs and Jaccard similarity. The process includes the following steps: Step S201: Obtain the component to be associated. For details, please refer to [link to relevant documentation]. Figure 1 Step S101 of the illustrated embodiment will not be described again here.
[0037] Step S202: Based on the pre-built knowledge graph, obtain components that belong to the same level as the component to be associated. The same level includes any one or more levels of the same vulnerability type, the same component type, or the same vendor.
[0038] The knowledge graph is constructed in the following way: Step S2021 involves acquiring datasets related to components and vulnerabilities. These datasets include CVE datasets, CWE datasets, CPE datasets, vulnerability analysis article datasets, and component description information datasets. CVE (Common Vulnerabilities and Exposures) is a standardized method for identifying publicly disclosed vulnerabilities and security issues. CWE (Common Weakness Enumeration) is a common vulnerability classification method used to describe and identify weaknesses and vulnerabilities in software and hardware systems. CPE (Common Platform Enumeration) is a standardized method for describing computer systems and applications, used to identify various software and hardware products. Therefore, component information can be obtained from the CPE dataset, and vulnerability description information and vulnerability types can be obtained from the CVE and CWE datasets, respectively. Furthermore, a vulnerability analysis article dataset is constructed by crawling vulnerability analysis articles obtained from major cybersecurity communities and cybersecurity-related WeChat public accounts. Component description information can be obtained from GitHub, Open Source China, and Wikipedia.
[0039] Step S2022: Extract entities from the dataset. Entities include CVE, CWE, component entities, and article entities. Before entity extraction, the acquired dataset can be cleaned, deduplicated, segmented, and stop-word removed. Then, entity extraction is performed based on the processed dataset. Specifically, the entity extraction method can refer to entity extraction methods in related technologies; this invention does not limit this. Since component information can be obtained from the CPE dataset, and vulnerability description information and vulnerability types can be obtained from the CVE and CWE datasets respectively, the extracted entities include CVE (vulnerability), CWE (vulnerability type), component entities, and article entities.
[0040] Step S2023 involves using relationship identification technology to mine the relationships between entities. This technology specifically includes regular expression matching and identifying relationships between CVEs, CWEs, component entities, and article entities based on existing data associations. Some relationships between entities are directly described in the dataset; for example, CVE information clearly defines the type and function of a CWE component. In such cases, the relationships between entities can be determined based on the existing data associations. Alternatively, relationships can be determined through regular expression matching. For instance, if a vulnerability analysis article contains CVE-2003-0001, then an association can be established between the article and this CVE.
[0041] Step S2024: Construct a knowledge graph based on entities, relationships between entities, and corresponding attributes. Attributes include name, description, category, and readability. Specifically, the attributes corresponding to the CWE entity include name and Chinese description; the attributes corresponding to the CVE entity include name and Chinese description of the vulnerability; the attributes corresponding to the component entity include component name, Chinese description of the component, and component category (software, hardware, and operating system); the attributes corresponding to the article entity include article title, article address, article content text, and article readability. This readability includes readability of the remediation plan, readability of vulnerability execution, readability of vulnerability reproduction, readability of article length, and readability of vulnerability analysis. The attribute of entity relationships includes name. Some entities and their corresponding attributes are shown in Table 1. Table 1
[0042] In Table 1, `vuln_article` belongs to the article entity; `AffectingComponents` belongs to the component entity. The paradigm representation of the knowledge graph constructed using this embodiment is as follows: Figure 2As shown, this knowledge graph specifically reflects the CVEs (vulnerabilities) associated with the AffectingComponents component, the article entity vuln_article associated with the CVE, and the CWE (vulnerability type) to which the vulnerability belongs.
[0043] It's important to note that article readability can be assessed using various metrics, including regular expression matching and expert advice. For example, to evaluate the readability of vulnerability reproduction in an article, keywords can be defined, such as "reproduction," "vulnerability demonstration," "vulnerability display," "vulnerability environment," "environment setup," "environment description," "test environment," and "runtime environment." By statistically analyzing the frequency of these keywords in the article, different thresholds and scores can be set: a score greater than or equal to 10 corresponds to a readability index of 10; a score between 6 and 10 corresponds to 6; and a score less than 6 corresponds to 0. Furthermore, different readability metrics can have different thresholds. For instance, when analyzing article readability, four thresholds (0, 12, 20, 30) and five scores (0, 4, 6, 8, 10) can be set based on the corresponding keywords. A word frequency of 30 or greater corresponds to a score of 10; a word frequency of 0 equal to 0 corresponds to a score of 0; a word frequency between 0 and 12 corresponds to a score of 4, and so on.
[0044] Step S203: Calculate the similarity between the component to be associated and components belonging to the same level using Jaccard similarity to obtain the similarity calculation results; for details, please refer to [link to relevant documentation]. Figure 1 Step S103 of the illustrated embodiment will not be described again here.
[0045] Step S204: Obtain the associated components of the component to be associated based on the similarity calculation results. For details, please refer to [link to related components]. Figure 1 Step S104 of the illustrated embodiment will not be described again here.
[0046] This embodiment provides a component association mining method based on knowledge graph and Jaccard similarity, which includes the following steps: Step S301: Obtain the component to be associated; for details, please refer to [link to relevant documentation]. Figure 1 Step S101 of the illustrated embodiment will not be described again here.
[0047] Step S302: Based on the pre-built knowledge graph, obtain components that belong to the same level as the component to be associated. The same level includes any one or more levels of the same vulnerability type, the same component type, or the same vendor.
[0048] Specifically, when the same layer includes the same component type and the same manufacturer, step S302 above includes: Step S3021: Determine the component type and vendor of the component to be associated based on its attributes. Specifically, based on the knowledge graph constructed in step S202, each component has attributes such as name and Chinese description. Therefore, after determining the component to be associated, the corresponding component is identified in the knowledge graph based on its name, and its description information is obtained. The component type and vendor of the component to be associated can be obtained through this name and description information. For example, if the component to be associated is apache:any23, its description information is: Apache Anything To Triples (Any23) is a library, web service, and command-line tool used to extract structured data from microformats, RDFa, RDF, RDF / XML, Turtle, N-Triples, and N-Quads. Therefore, the component type can be determined to be software, and the corresponding vendor is Apache.
[0049] Step S3022: Based on the component type and manufacturer, obtain the first type of component corresponding to the corresponding component type and the second type of component corresponding to the corresponding manufacturer in the knowledge graph. Specifically, after determining the component type and manufacturer of the component to be associated, search the knowledge graph for components with the same component type as the component to be associated as the first type of component, and then search the knowledge graph for components with the same manufacturer as the component to be associated as the first type of component. For example, search for components with the component type "software" as the first type of component, and search for components with the manufacturer "Apache" as the second type of component.
[0050] Step S3023: Obtain the vulnerabilities associated with the first type of components and the second type of components in the knowledge graph; specifically, it can be seen from the paradigm representation of the knowledge graph constructed in the above steps that there is a connection relationship between the components and their associated vulnerabilities. Therefore, the vulnerabilities associated with each component in the first type of components and the vulnerabilities associated with each component in the second type of components can be searched from the knowledge graph.
[0051] Step S3024: Combining the knowledge graph, the components that affect the vulnerability are filtered according to the vulnerability type and the corresponding article entity of the associated vulnerability. The components belonging to the first type and the second type are combined to obtain components belonging to the same component type and components belonging to the same vendor.
[0052] Specifically, step S3024 above includes: Step a1: Combining the knowledge graph, determine the vulnerability belonging to a specific vulnerability type based on the associated vulnerability type. As can be seen from the paradigm representation of the knowledge graph constructed in the previous steps, there is a connection between vulnerabilities and their respective vulnerability types. Therefore, the vulnerability type to which each vulnerability belongs can be determined from this knowledge graph. Under each vulnerability type, there may be multiple vulnerabilities belonging to different types; these can also be determined by searching the knowledge graph. Specifically, vulnerabilities belonging to the corresponding vulnerability types can be determined for each component associated with the first type of component and each component associated with the second type of component.
[0053] Step a2 involves filtering vulnerabilities based on the readability of the associated article entities belonging to the vulnerability type. Specifically, the paradigm representation of the knowledge graph constructed in the previous steps shows a connection between vulnerabilities and their associated article entities. Therefore, the article entities associated with each vulnerability can be determined from this knowledge graph. Furthermore, as the analysis above shows, each article entity has different levels of readability; therefore, article entities can be filtered based on readability. For example, vulnerabilities associated with the components to be associated can be identified first. Then, the readability of the associated article entities is statistically analyzed, and a preset threshold is set based on the statistical values. For instance, if the readability of all associated article entities is not less than 8 points, then article entities with a readability greater than 8 points can be selected. Finally, the associated vulnerabilities are determined based on the filtered article entities, thus achieving vulnerability filtering.
[0054] Step a3: Based on the components whose effects are identified after filtering, combine the first type of components and the second type of components to obtain components belonging to the same component type and components belonging to the same vendor. Specifically, determine the components whose effects are identified based on the filtered vulnerabilities. These components include components filtered based on component type and components filtered based on vendor. Then, combine the components filtered based on component type with the first type of components to obtain components belonging to the same component type, and combine the components filtered based on vendor with the second type of components to obtain components belonging to the same vendor.
[0055] When the same layer includes the same vulnerability type, the above step S302 includes: Step S3025: Obtain the vulnerabilities associated with the component to be associated based on the knowledge graph; specifically, it can be seen from the paradigm representation of the knowledge graph constructed in the above steps that there is a connection relationship between the component and its associated vulnerabilities. Therefore, the vulnerabilities associated with the component to be associated can be determined from the knowledge graph.
[0056] Step S3026: Combining the knowledge graph, determine the vulnerability belonging to the vulnerability type based on the vulnerability type associated with the component to be associated. Specifically, as can be seen from the paradigm representation of the knowledge graph constructed in the above steps, there is a connection relationship between the vulnerability and its corresponding vulnerability type. Therefore, the vulnerability type to which each vulnerability belongs can be determined from the knowledge graph. Under each vulnerability type, there may be multiple vulnerabilities belonging to different types, and these can also be determined by searching the knowledge graph.
[0057] Step S3027: Based on the vendor and component type of the component whose vulnerability action belongs to the vulnerability type, the components that have action are filtered to obtain components belonging to the same vulnerability type as the component to be associated. Specifically, as can be seen from the paradigm representation of the knowledge graph constructed in the above steps, there is a connection between vulnerabilities and their action components. Therefore, the component that each vulnerability action involves can be determined from the knowledge graph. After determining the action components, their vendor and component type are determined based on the attributes of these components. Then, components with the same vendor and component type as the component to be associated are filtered as components belonging to the same vulnerability type as the component to be associated.
[0058] Step S303: Use Jaccard similarity to calculate the similarity between the component to be associated and components belonging to the same level, and obtain the similarity calculation results.
[0059] Specifically, step S303 includes: Step S3031: The similarity between the component to be associated and the component description information of components belonging to the same level is calculated using Jaccard similarity to obtain the similarity calculation results at the same level. Specifically, before performing the similarity calculation, a word segmentation dictionary and stop word list constructed by experts can be used to process the component description information of each component through word segmentation, deduplication, and stop word removal. Then, the similarity of the processed content is calculated using Jaccard similarity to obtain the similarity between the component to be associated and each component in that level.
[0060] Step S304: Obtain the associated components of the component to be associated based on the similarity calculation results.
[0061] Specifically, the above steps include: Step S3041: Determine the associated components of the component to be associated under the same level based on the similarity calculation results under the same level; specifically, the similarity between the component to be associated and each component in each level is obtained through similarity calculation. Then, the multiple similarities obtained in each level can be sorted to obtain the similarity with higher ranking, and the components corresponding to these similarities are used as the associated components of the component to be associated in the corresponding level.
[0062] Step S3042: Compare the associated components of the component to be associated at different levels to determine the association strength of each associated component. Specifically, multiple associated components may be obtained for each level, and associated components in different levels may be the same component. Therefore, the associated components of the component to be associated at different levels can be compared to determine how many levels each associated component appears in. For example, if an associated component appears in three levels (i.e., all three levels include the associated component), it is considered a strongly associated component. If an associated component appears in two levels (i.e., two levels include the associated component), it is considered a generally associated component. If an associated component appears in only one level (i.e., only one level includes the associated component), it is considered a weakly associated component.
[0063] As a specific application embodiment of the present invention, such as Figure 3 As shown, the component association mining method based on knowledge graph and Jaccard similarity is implemented through the following process: S01. Data Collection and Knowledge Graph Construction. The datasets involved in this invention include CVE, CWE, CPE, and various vulnerability analysis articles. These are all publicly available datasets. The CVE, CWE, and CPE datasets can be obtained directly from their respective official websites. The vulnerability analysis articles are crawled using the Scrapy framework, and the relevant text content is extracted.
[0064] For example, the following is an entry from the CVE dataset (some content is omitted using ellipses), which indicates the vulnerability type as CWE-191, representing an integer overflow vulnerability. One of the affected CPE components is cpe:2.3:a:microsoft:office:2003:sp1, where cpe:2.3 indicates CPE specification version 2.3, 'a' indicates software, 'microsoft' indicates the component manufacturer, 'office' is the component product name, and '2003' is the affected version number. The specific program code for this dataset is as follows: "cve" : { "data_type" : "CVE", "data_format" : "MITRE", "data_version" : "4.0", "CVE_data_meta" : { "ID": "CVE-2006-0001", "ASSIGNER" : "secure@microsoft.com" }, "problemtype" : { "problemtype_data" : [ { "description" : [ { "lang" : "en", "value" : "CWE-119" } ] } ] }, "references" : { "reference_data" : [ { "url" : "http: / / www.computerterrorism.com / research / ct12-09-2006-2.htm", "name" : "http: / / www.computerterrorism.com / research / ct12-09-2006-2.htm", "refsource" : "MISC", "tags" : [ "Exploit", "Patch", "Vendor Advisory" ] }, ] }, "description" : { "description_data" : [ { "lang" : "en", "value" : "Stack-based buffer overflow in Microsoft Publisher 2000through 2003 allows user-assisted remote attackers to execute arbitrary codevia a crafted PUB file, which causes an overflow when parsing fonts." } ] } }, "configurations" : { "CVE_data_version" : "4.0", "nodes": [ { "operator" : "OR", "children" : [ ], "cpe_match" : [ { "vulnerable" : true, "cpe23Uri" : "cpe:2.3:a:microsoft:office:2003: : : : : : : ", "cpe_name" : [ ] } ] } The text related to the aforementioned vulnerability was translated using a combination of human and machine translation. The translated English description of the vulnerability is as follows: A stack-based buffer overflow in Microsoft Publisher 2000 to 2003 allows a remotely assisted attacker to execute arbitrary code through a specially crafted PUB file, which can lead to an overflow when parsing fonts.
[0065] The `vuln_article` entity is an analysis article related to a vulnerability, scraped from the internet. Through entity identification and extraction, its correspondence with CVEs is found. For example, an article titled "CVE-2021-40444-Microsoft MSHTML Remote Command Execution Vulnerability Analysis" affects the CVE-2021-40444 vulnerability and related components. Its readability at various levels is as follows: The values "word_len": 10, "word_rev": 0, "word_anal": 10, "word_pat": 0, and "word_exp": 0 indicate that the word length and vulnerability analysis are both 10, making it highly readable.
[0066] S02. Determine the associated components of the component to be associated from three levels (vulnerability type, component type, and same vendor). For example, the component to be associated is apache:any23, whose description is: Apache Anything To Triples (Any23) is a library, web service, and command-line tool used to extract structured data from microformats, RDFa, RDF, RDF / XML, Turtle, N-Triples, and N-Quads. Its corresponding vendor is Apache; the only CVE entities associated with the component entity named apache:any23 are these three vulnerabilities: CVE-2022-25312, CVE-2022-25312, and CVE-2021-40146. Among them, CVE-2022-25312 belongs to CWE-611, CVE-2021-38555 belongs to CWE-611, and CVE-2021-40146 belongs to NVD-CWE-noinfo. That is, the vulnerability types corresponding to the components to be associated are CWE-611 and NVD-CWE-noinfo (indicating no CWE information associated with this vulnerability). Here, we consider vulnerability type CWE-611 and query its three vulnerabilities (CVE-2022-25312, CVE-2021-38555, and CVE-2021-40146) at the vulnerability type level. The component type corresponding to the components to be associated is software. Information from the corresponding component library is obtained by searching in the knowledge graph. For example, at the vendor level, relevant information about components produced by Apache can be obtained (including component description, vulnerability description, vulnerability type description, and article content, etc.). Next, based on vulnerability type, component type, and vendor, the associated components at each level are determined. Simultaneously, when determining associated components, the readability of article entities across various dimensions is used to filter the relevant vulnerability analysis articles. Specifically, for vulnerability analysis articles related to the component apache:any23, evaluation is conducted at three levels: vulnerability exploitation, vulnerability analysis, and vulnerability mitigation measures. The results show that the readability of these articles is no less than 8 points. Therefore, article entities with a readability score of 8 or higher can be used to filter vulnerabilities. The specific filtering process is detailed in step S302 above and will not be repeated here.
[0067] S03. When filtering based on three levels—vendor, component type, and vulnerability type—an expert-constructed word segmentation dictionary and stop word list are used to perform word segmentation, deduplication, and stop word removal on the descriptive information related to each component. Then, Jaccard similarity is calculated to obtain the associated components as the output. The associated components are categorized by strength in the output: strong association indicates that the component is associated in all three levels—component category, vendor, and vulnerability category; moderate association indicates that the component is associated in two of the above aspects; and weak association indicates that the component is associated in one of the aspects. In this embodiment, the components with high similarity across the three levels include: apache:apache, lyonbros:turtl, apache:jena, apache:pdfbox, apache:tika, apache:poi, and apache:nutch. Among these, apache:jena, apache:pdfbox, apache:tika, apache:poi, apache:nutch, and apache:any23 are strongly associated components. Expert analysis revealed that the apache:any23 component exploits the interfaces of these strongly associated components to extract structured data from PDF, Office, RDF, or HTML files. These components are all from the Apache vendor, are software, and all involve vulnerabilities classified as CWE-611. Verification and evaluation by cybersecurity experts confirmed this finding and yielded positive results.
[0068] In this embodiment, a knowledge graph is constructed using publicly available datasets, including CVE, CWE, CPE, publicly available vulnerability analysis articles on the internet, and detailed descriptions of components. Based on this knowledge graph, and using the Jaccard algorithm in graph theory, the relationships between components are mined from multiple dimensions, including readability, by analyzing component descriptions, associated vulnerability descriptions, and associated vulnerability analysis articles. This provides better support for component cybersecurity. Simultaneously, this method can automatically identify the relationships between software components, enabling better management and maintenance of the software system and improving network security performance. This patent allows software developers and cybersecurity professionals to understand the principles and applications of this technology, providing better support for software development and cybersecurity.
[0069] This embodiment also provides a component association mining device based on knowledge graphs and Jaccard similarity. This device is used to implement the above embodiments and preferred embodiments, and details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0070] This embodiment provides a component association mining device based on knowledge graphs and Jaccard similarity, such as... Figure 4 As shown, it includes: Component acquisition module 401 is used to acquire components to be associated; The association module 402 is used to obtain components that belong to the same level as the component to be associated based on the pre-built knowledge graph. The same level includes any one or more levels of the same vulnerability type, the same component type, or the same vendor. The similarity calculation module 403 is used to calculate the similarity between the component to be associated and the component belonging to the same level using Jaccard similarity, and obtain the similarity calculation result; The result determination module 404 is used to obtain the associated components of the component to be associated based on the similarity calculation results.
[0071] In one alternative implementation, the knowledge graph is constructed as follows: A dataset related to components and vulnerabilities is acquired, including a CVE dataset, a CWE dataset, a CPE dataset, a vulnerability analysis article dataset, and a component description information dataset; entities are extracted from the dataset, including CVE, CWE, component entities, and article entities; relationship recognition technology is used to mine the relationships between entities; and a knowledge graph is constructed based on the entities, the relationships between entities, and their corresponding attributes, including name, description information, category, and readability.
[0072] In one optional implementation, when the same layer includes the same component type and the same manufacturer, the association module includes: a first determining module, used to determine the component type and manufacturer of the component to be associated based on the attributes of the component to be associated; a first obtaining module, used to obtain the first type of component corresponding to the component type and the second type of component corresponding to the manufacturer in the knowledge graph according to the component type and manufacturer; a second obtaining module, used to obtain the vulnerabilities associated with the first type of component and the second type of component in the knowledge graph; and a filtering module, used to combine the knowledge graph, filter the components affected by the vulnerabilities according to the vulnerability type to which the associated vulnerabilities belong and the corresponding article entities, and combine the first type of component and the second type of component to obtain components belonging to the same component type and components belonging to the same manufacturer.
[0073] In one optional implementation, the filtering module is specifically used to: combine the knowledge graph to determine the vulnerabilities belonging to the vulnerability type based on the associated vulnerability type; filter the vulnerabilities based on the readability of the article entities associated with the vulnerabilities belonging to the vulnerability type; and based on the components of the filtered vulnerability effects, combine the first type of components and the second type of components to obtain components belonging to the same component type and components belonging to the same vendor.
[0074] In one optional implementation, when the same layer includes the same vulnerability type, the association module is specifically used to: obtain the vulnerabilities associated with the component to be associated based on the knowledge graph; combine the knowledge graph to determine the vulnerabilities belonging to the vulnerability type based on the vulnerability type to which the vulnerabilities associated with the component to be associated belong; and filter the components that are affected by the vulnerabilities belonging to the vulnerability type based on the vendor and component type of the components to which they are affected, to obtain the components that belong to the same vulnerability type as the component to be associated.
[0075] In one optional implementation, the similarity calculation module is specifically used to: calculate the similarity between the component to be associated and the component description information belonging to the same level using Jaccard similarity, and obtain the similarity calculation result at the same level.
[0076] In one optional implementation, the result determination module is specifically used to: determine the associated components of the component to be associated at the same level based on the similarity calculation results at the same level; compare the associated components of the component to be associated at different levels, and determine the association strength of each associated component.
[0077] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0078] This invention also provides a computer device having the above-described features. Figure 4 The device shown is a component association mining device based on knowledge graph and Jaccard similarity.
[0079] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 5As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 5 Take a processor 10 as an example.
[0080] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0081] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.
[0082] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device as shown by a landing page for an app. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, which can be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0083] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0084] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.
[0085] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0086] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for mining component association relationships based on knowledge graphs and Jaccard similarity, characterized in that, The method includes: Get the components to be associated; Based on the pre-built knowledge graph, components that belong to the same level as the components to be associated are obtained. The same level includes any one or more levels of the same vulnerability type, the same component type, or the same vendor. The similarity between the component to be associated and components belonging to the same level is calculated using Jaccard similarity to obtain the similarity calculation results; Based on the similarity calculation results, the associated components of the component to be associated are obtained; When the same layer includes the same component type and the same vendor, components belonging to the same layer as the component to be associated are obtained based on the pre-built knowledge graph, including: The component type and manufacturer of the component to be associated are determined based on the attributes of the component to be associated. Based on the component type and manufacturer, obtain the first type of component corresponding to the corresponding component type and the second type of component corresponding to the corresponding manufacturer in the knowledge graph; Identify vulnerabilities related to the first and second types of components within the knowledge graph; Based on the knowledge graph, the components responsible for vulnerability impact are filtered according to the vulnerability type and corresponding article entity of the associated vulnerability. Combining the first and second types of components, components belonging to the same component type and components belonging to the same vendor are obtained, including: Based on the knowledge graph, vulnerabilities belonging to the associated vulnerability types are determined. Vulnerabilities are filtered based on the readability of the article entities associated with the vulnerabilities belonging to the aforementioned vulnerability types; wherein, the readability includes the readability of the remediation plan, the readability of vulnerability execution, the readability of vulnerability reproduction, the readability of article length, and the readability of vulnerability analysis; Based on the components whose vulnerability effects have been filtered, the components belonging to the first type and the second type are combined to obtain components belonging to the same component type and components belonging to the same vendor. The associated components of the component to be associated are obtained based on the similarity calculation results, including: Based on the similarity calculation results at the same level, determine the associated components of the components to be associated at the same level; Compare the associated components of the components to be associated at different levels to determine the association strength of each associated component.
2. The method according to claim 1, characterized in that, The knowledge graph is constructed in the following manner: Obtain datasets related to components and vulnerabilities, including CVE datasets, CWE datasets, CPE datasets, vulnerability analysis article datasets, and component description information datasets; Extract entities from the dataset, including CVE, CWE, component entities, and article entities; Relationship recognition technology is used to mine the relationships between the entities; A knowledge graph is constructed based on the entities, the relationships between the entities, and the corresponding attributes. The attributes include name, description information, category, and readability.
3. The method according to claim 2, characterized in that, When the same layer includes the same vulnerability type, components belonging to the same layer as the component to be associated are obtained based on the pre-built knowledge graph, including: Based on knowledge graphs, vulnerabilities associated with components to be associated are identified; Based on the knowledge graph, vulnerabilities belonging to the vulnerability type associated with the component to be associated are determined. The components affected by the vulnerability are filtered based on the vendor and component type of the component that belongs to the vulnerability type to obtain the components that belong to the same vulnerability type as the component to be associated.
4. The method according to claim 2, characterized in that, The similarity between the component to be associated and components belonging to the same level is calculated using Jaccard similarity, and the similarity calculation results are obtained, including: The similarity between the component to be associated and the component description information of components belonging to the same level is calculated using Jaccard similarity to obtain the similarity calculation results at the same level.
5. A component association mining device based on knowledge graphs and Jaccard similarity, characterized in that, The device includes: The component acquisition module is used to acquire components to be associated. The association module is used to obtain components that belong to the same level as the component to be associated based on a pre-built knowledge graph. The same level includes any one or more levels of the same vulnerability type, the same component type, or the same vendor. The similarity calculation module is used to calculate the similarity between the component to be associated and components belonging to the same level using Jaccard similarity, and obtain the similarity calculation results; The result determination module is used to obtain the associated components of the component to be associated based on the similarity calculation results; When the same layer includes the same component type and the same vendor, components belonging to the same layer as the component to be associated are obtained based on the pre-built knowledge graph, including: The component type and manufacturer of the component to be associated are determined based on the attributes of the component to be associated. Based on the component type and manufacturer, obtain the first type of component corresponding to the corresponding component type and the second type of component corresponding to the corresponding manufacturer in the knowledge graph; Identify vulnerabilities related to the first and second types of components within the knowledge graph; Based on the knowledge graph, the components responsible for vulnerability impact are filtered according to the vulnerability type and corresponding article entity of the associated vulnerability. Combining the first and second types of components, components belonging to the same component type and components belonging to the same vendor are obtained, including: Based on the knowledge graph, vulnerabilities belonging to the associated vulnerability types are determined. Vulnerabilities are filtered based on the readability of the article entities associated with the vulnerabilities belonging to the aforementioned vulnerability types; wherein, the readability includes the readability of the remediation plan, the readability of vulnerability execution, the readability of vulnerability reproduction, the readability of article length, and the readability of vulnerability analysis; Based on the components whose vulnerability effects have been filtered, the components belonging to the first type and the second type are combined to obtain components belonging to the same component type and components belonging to the same vendor. The associated components of the component to be associated are obtained based on the similarity calculation results, including: Based on the similarity calculation results at the same level, determine the associated components of the components to be associated at the same level; Compare the associated components of the components to be associated at different levels to determine the association strength of each associated component.
6. A computer device, characterized in that, include: A memory and a processor are interconnected, the memory stores computer instructions, and the processor executes the component association mining method based on knowledge graph and Jaccard similarity as described in any one of claims 1 to 4 by executing the computer instructions.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the component association mining method based on knowledge graph and Jaccard similarity as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Component vulnerability analysis method and device, equipment and storage medium
CN116305171A
Internet of Things firmware vulnerability mining method and device and electronic equipment
CN116541357A
