Threat killing chain extraction method based on heterogeneous graph neural network

Through the method based on heterogeneous graph neural network, the pre-trained language model and graph neural network model are used to solve the challenge of automatically extracting the kill chain of the network attack, and automatic and accurate kill chain extraction and feature modeling are achieved, and heterogeneous Constructing reports and text information processing difficulties.

CN118982020APending Publication Date: 2024-11-19UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411013371.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-11-19

AI Technical Summary

Technical Problem

The prior art is difficult to automate the kill chain phase of cyberattacks, especially when dealing with heterogeneous reports and large amounts of text information. There are challenges in identifying relationships between entities and modeling complex relationships to improve judgment accuracy.

Method used

Using a method based on heterogeneous graph neural network, the entity and relationship triplets are extracted through pre-training language models, combined with the graph neural network model training, and converted into graph multi-classification tasks to realize automatic extraction and feature capture of kill chains.

Benefits of technology

It realizes the automatic extraction of kill chain stage from unstructured text, saves manpower, handles heterogeneous reports, captures dispersed relationships, integrates information from different sources, improves judgment accuracy, and builds a comprehensive threat knowledge graph.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118982020A_ABST
    Figure CN118982020A_ABST
Patent Text Reader

Abstract

The invention discloses a threat killing chain extraction method based on a heterogeneous graph neural network. The method comprises the steps of training sample labeling; entity extraction: extracting a security entity from the network attack report; relation triple extraction: extracting the relation between the security entities from the report; establishing a threat knowledge graph, and establishing a triple consisting of edges and entities extracted from the report into a heterogeneous graph; and model training: taking the graph multi-classification task as a target to train the heterogeneous graph neural network. Each training sample graph is a sub-graph composed of entities and edges contained in the report, and the sub-graphs are classified into one or more killing chain stages; and extracting a killing chain: extracting the killing chain in the report in the test set. According to the scheme, the related killing chain can be automatically extracted from the unstructured text, so that a user is prevented from tedious manual analysis and extraction, and the pressure of safety operation personnel is relieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network security technology, and in particular to a threat kill chain extraction method based on a heterogeneous graph neural network. Background Art

[0002] The cyberattack kill chain is a concept in the security field that describes the different stages of a cyberattack, which include intelligence gathering, weaponization, interaction, exploitation, installation, command and control, and action. The attack kill chain can enable security professionals to better understand and respond to cyberattacks. On the one hand, by understanding the different stages of a cyberattack, organizations can develop more effective security defense plans, and on the other hand, by sharing information about the cyberattack kill chain, the entire industry can be more aware of new threats.

[0003] Generally speaking, a report on an attack event will describe the details of a cyber attack in detail, and this information can be associated with one or more stages of the kill chain. However, it always requires security experts to manually extract and judge which kill chain stages are involved from unstructured text such as reports, which has become very cumbersome in the context of the increasing number of cyber attack reports.

[0004] For those skilled in the art, designing an automated extraction tool to extract the kill chain faces the following challenges:

[0005] 1: Reports come from different sources and formats, how to integrate these heterogeneous information.

[0006] 2: Reports usually contain a lot of text information. How to extract key information about the kill chain from the text.

[0007] 3: There are complex associations between entities. How to identify the associations between entities?

[0008] 4: How to model these associations so that the characteristics of different kill chain stages can be obtained and the accuracy of judgment can be improved. Summary of the invention

[0009] Based on the above technical problems, the present invention proposes a threat kill chain extraction method based on a heterogeneous graph neural network, which can automatically extract the stages of the kill chain involved from unstructured text reports. In order to solve the first challenge, the present invention uses a heterogeneous graph to integrate report information from different sources. In order to solve the second challenge, the present invention uses a pre-trained language model to perform entity extraction. In order to solve the third challenge, the present invention uses a pre-trained language model as a classifier to determine whether there is a relationship between each entity pair. In order to solve the fourth challenge, the present invention uses a heterogeneous graph neural network to capture the features of different attack reports, thereby converting the kill chain extraction problem into a graph multi-classification problem. The overall technical solution of the present invention is as follows.

[0010] A threat kill chain extraction method based on heterogeneous graph neural network includes the following steps:

[0011] Step S1: labeling training samples, labeling entity types and relationship triplet types in training safety reports, and the relative position relationship between the first and last entities in the relationship triplet;

[0012] Step S2: Entity extraction, extracting entities from the training security report using a pre-trained language model and generating a feature vector for each entity;

[0013] Step S3: Relation triple extraction, using a fully connected layer to determine whether there is a relationship between the entities obtained in step S2;

[0014] Step S4: Establish a threat knowledge graph, organize the relationship triples extracted from all training security reports in the training sample into a heterogeneous graph, and establish a threat knowledge graph;

[0015] Step S5: Model training, converting the kill chain extraction task into a multi-classification task, and training the graph neural network model with the subgraph multi-classification task;

[0016] Step S6: Threat kill chain extraction. Perform steps S2 and 3 on the training security report in the test set in sequence, add the result to step S4 to update and establish a threat knowledge graph, and then perform step S5 to generate the kill chain involved in the training security report.

[0017] Specifically, the entity types annotated in step S1 include: attacker, malware, malicious family, application, vulnerability, operating system and tool; the relationship triple types include: exploit, execute, attack and belong to.

[0018] Specifically, the sample labeling in step S1 uses position encoding based on sine or cosine, and the position encoding PE expression is:

[0019]

[0020] Among them, pos is the position of the word in the sample sequence, i is the index of the position encoding dimension, and d is the embedding dimension of the model, that is, the dimension of word embedding.

[0021] Specifically, step S2 further includes: converting the text into a word vector and feeding it into a Transformer-based pre-trained language model, and fine-tuning it using the annotations in step S1, and the calculation formula is:

[0022] [x′1,x′2,…,x′ n ]=Trabsfirner([x1,x2,…x n]);

[0023] p([w1,w2,…w n ]) = MLP[x′1,x′2,…,x′ n ];

[0024] Among them, [w1,w2,…w n ] are the words in the training safety report, [x1,x2,…x n ] is the word vector, [x′1,x′2,…,x′ n ] is the extracted intermediate layer embedding; the embedding is sent to the MLP fully connected layer for classification, and finally a series of probabilities is obtained, which can determine whether the input word is the target entity type that needs to be extracted.

[0025] Specifically, step S3 includes the following sub-steps:

[0026] Step S31: for each pair of extracted entities, concatenate the feature vector obtained in step S2 with its relative position vector in the triplet;

[0027] Step S32: input the concatenated vector into another fully connected layer to determine whether there is a relationship between the pair of entities;

[0028] The splicing is specifically the middle layer embedding and position encoding splicing, and the splicing vector P is expressed as:

[0029] P(w i , w j )=MLP((pos i ||x′ i )||(pos j ||x′ j ));

[0030] Among them, x′ i is the intermediate layer embedding extracted in step S2, x′ j Encode the extracted entity locations.

[0031] Specifically, step S5 includes the following sub-steps:

[0032] Step 51: Use the obtained entity embedding and edge embedding as the initial vectors of edges and points in the heterogeneous threat knowledge graph;

[0033] Step 52: Input the heterogeneous threat knowledge graph into the R-GCN model to obtain aggregated entity and edge embeddings;

[0034] Step 53: Extract subgraph g from the threat knowledge graph according to the edges and nodes contained in the report i ;

[0035] Step 54: Subgraph gi The input aggregation module extracts the subgraph g i The total embedding h g ;

[0036] Step 55: Input the total embedding into the MLP multi-classifier to obtain results belonging to certain categories, which are all kill chain processes.

[0037] Specifically, the R-GCN model aggregates node information according to the different edge types, so that the model can learn the heterogeneous information in the report; by inputting the threat knowledge graph established in step S4 into the R-GCN model, the new embedding h′ of all nodes is obtained. i ; The model formula is:

[0038]

[0039] in, is the set of nodes that have type r relationship with node i, c i,r is the regularization constant, which is generally The number of nodes in the is a learnable parameter related to the edge type.

[0040] Specifically, the subgraph g i Total embedding h g The calculation formula is:

[0041] h g =readout(g i , h′ i );

[0042] Among them, h′ i is the new embedding of the node, That is, sum the data by node type, and take the average for the same node type.

[0043] Specifically, the total embedding is input into the MLP multi-classifier, and the calculation formula is:

[0044] p(k1, k2, ..., k7) = MLP(h g );

[0045] Among them, h g For subgraph g i , k1, k2, ..., k7 are the probability results obtained, and the kill chain category involved in the training security report is determined according to the size of the probability results.

[0046] Beneficial effects of the invention: The invention proposes a threat kill chain extraction method based on heterogeneous graph neural network, which has the following beneficial effects compared with the existing extraction methods: manual extraction, rule-based extraction, and deep language model-based methods:

[0047] (1) The technical solution of the present invention is end-to-end and can automatically extract the threat kill chain from unstructured text, saving manpower.

[0048] (2) The technical solution of the present invention can process text content without specific organizational forms and rules.

[0049] (3) The information describing the attack kill chain may be distributed in various parts of the text, and the technical solution of the present invention can capture their scattered relationships.

[0050] (4) The technical solution of the present invention can integrate heterogeneous reports from different sources to build comprehensive knowledge of threat information. By modeling the complex relationships between security entities through graph neural networks and extracting the features of different attack events, the technical solution of the present invention can identify the kill chain process involved based on the features. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 It is a schematic flow chart of a threat kill chain extraction method based on a heterogeneous graph neural network of the present invention. DETAILED DESCRIPTION

[0052] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described with reference to the accompanying drawings.

[0053] In order to overcome the shortcomings of the prior art, the present invention proposes a threat kill chain extraction method based on a heterogeneous graph neural network. The method extracts security entities and their relationships from unstructured text reports and uses them to establish a threat knowledge heterogeneous graph. Kill chain extraction is achieved by extracting report-related subgraphs from the heterogeneous graph and classifying the subgraphs, which includes the following steps:

[0054] Step 1: Training sample annotation. Annotate the entity and relation triplets in the training security report. Entity types include: attacker, malware, malicious family, application, vulnerability, operating system, country, tool. Relation types of relation triplets include: exploit, execute, attack, belong to. In addition, the relative position relationship between the first and last entities in the relation triplet needs to be annotated.

[0055] Step 2: Entity Extraction. Use the first pre-trained language model to extract entities from the report and generate a feature vector for each entity.

[0056] Step 3: Relation triple extraction: Use the fully connected layer to determine whether there is a relationship between the entities obtained in step 2.

[0057] Step 4: Establish a threat knowledge graph. Organize the relation triplets extracted from all reports in the training sample into a heterogeneous graph to establish a threat knowledge graph.

[0058] Step 5: Model training. Convert the kill chain extraction task into a multi-classification task and train the graph neural network model with the subgraph multi-classification task.

[0059] Step 6: Threat kill chain extraction. Perform steps 2 and 3 on the reports in the test set in sequence, add the results to step 4 to build a threat knowledge graph, and then perform step 5 to generate the kill chain involved in the report.

[0060] In this embodiment, step 3 specifically includes the following sub-steps:

[0061] Step 301: For each pair of extracted entities, concatenate the feature vector obtained in step 2 with its relative position vector in the triplet.

[0062] Step 302: Input the concatenated vector into the fully connected layer to determine whether there is a relationship between the pair of entities.

[0063] In this embodiment, step 5 specifically includes the following sub-steps:

[0064] Step 501: Use the entity embedding and edge embedding obtained in step 4 and step 5 as the initial vectors of edges and points in the heterogeneous threat knowledge graph.

[0065] Step 502: Input the heterogeneous threat knowledge graph into the R-GCN model to obtain aggregated entity and edge embeddings.

[0066] Step 503: extract a subgraph from the threat knowledge graph according to the edges and nodes included in the report.

[0067] Step 504: Input the subgraph into the aggregation module to extract the embedding of the subgraph.

[0068] Step 505: Input the embedding into a multi-classifier to obtain results belonging to certain categories, where the categories are all kill chain processes.

[0069] In a preferred embodiment of the present invention, Figure 1 As shown, a threat kill chain extraction method based on heterogeneous graph neural network includes the following steps:

[0070] Step 1: Label the unstructured report text in the training set for subsequent entity relationship extraction. Entity types include: attacker, malware, malicious family, application, vulnerability, operating system, country, tool. Relationship types of relationship triples include: exploit, execute, attack, belong to. For example, the labeling result in "We discovered a piece of malware called "ShadowExploit" that successfully exploited an vulnerability called CVE-XXX in the operating system" is ShadowExploit (malware)-exploitation-CVE-XXX (vulnerability). In addition, the relative position of the extracted entity in the article / report needs to be marked. The present invention uses sine / cosine-based position coding, and the formula is as follows:

[0071]

[0072] Where pos is the position of the word in the sequence, i is the index of the position encoding dimension, and d is the embedding dimension of the model, that is, the dimension of word embedding.

[0073] Step 2: Convert the text into word vectors and feed them into the Transformer-based pre-trained language model, and fine-tune it using the annotations in step 1.

[0074] [x′1,x′2,…,x′ n ]=Trabsfirner([x1,x2,…x n ])

[0075] p([w1,w2,…w n ]) = MLP[x′1,x′2,…,x′ n ]

[0076] where [w1,w2,…w n ] is the word in the report, [x1,x2,…x n ] is the word vector, [x′1,x′2,…,x′ n ] is the extracted intermediate layer embedding. The embedding is sent to the fully connected layer for classification, and finally a series of probabilities is obtained. The model can determine whether the input word is the target entity type that needs to be extracted.

[0077] Step 3: For each pair of entities in step 2, we concatenate their intermediate layer embedding and position encoding and send them to another MLP for relationship judgment.

[0078] P(w i , wj )=MLP((pos i ||x′ i )||(pos j ||x′ j ))

[0079] Step 4: All report texts in the training set are processed through steps 1, 2, and 3 to obtain a series of triplets, which are organized in the form of a heterogeneous graph. The node types in the graph include attackers, malware, malicious families, applications, vulnerabilities, operating systems, countries, and tools. The edge types in the graph include: exploit, execution, and attack.

[0080] Step 5: Initialize the entity embedding with the intermediate embedding in the step and feed it into the R-GCN model. The model formula is as follows:

[0081]

[0082] is the set of nodes that have type r relationship with node i, C i,r is the regularization constant, which is generally The number of nodes in . is a learnable parameter related to the edge type. The model can aggregate node information according to the edge type, so that the model can learn the heterogeneous information in the report. By inputting the threat knowledge graph established in step 4 into R-GCN, we obtain the new embedding h′ of all nodes.

[0083] Then, subgraphs are extracted from the threat knowledge graph according to the entities involved in the report. For example, if "Cobalt", "CVE-XXX", and "APT27" are extracted from a report, then the subgraph gi containing these entities is extracted from the threat knowledge graph.

[0084] Subgraph g i and its node embedding h′ i Feed it into the aggregation module to extract the total embedding of the subgraph:

[0085] h g =readout(g i , h′ i )

[0086] The working principle of readout is as follows:

[0087]

[0088] That is, sum the data by node type, and take the average for the same node type.

[0089] Finally, h gSend it to MLP to get the result of multi-classification:

[0090] p(k1, k2, ..., k7) = MLP(h g )

[0091] For example, if the probability result is (0.8, 0.1, 0.3, 0.4, 0.1, 0.16, 0.9), then it can be determined that this report involves the first and the first kill chain: intelligence collection and action.

[0092] Step 6: Finally, taking the data in the test set as an example of actual use, first input the report in the test set into the model in steps 2 and 3 to extract entities and relationships, and then add (update) it to the threat knowledge graph established in step 4. Then input the graph into the RGCN in step 5 to extract the node embedding of the newly added part, that is, the report subgraph. The embedding is readout aggregated and finally sent to the MLP to obtain the kill chain involved in the report.

[0093] The present invention has shown and described the basic principles and main features of the present invention and the advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A threat kill chain extraction method based on heterogeneous graph neural network, characterized in that: The following steps are involved: Step S1: labeling training samples, labeling entity types and relationship triplet types in training safety reports, and the relative position relationship between the first and last entities in the relationship triplet; Step S2: Entity extraction, extracting entities from the training security report using a pre-trained language model and generating a feature vector for each entity; Step S3: Relation triple extraction, using a fully connected layer to determine whether there is a relationship between the entities obtained in step S2; Step S4: Establish a threat knowledge graph, organize the relationship triples extracted from all training security reports in the training sample into a heterogeneous graph, and establish a threat knowledge graph; Step S5: Model training, converting the kill chain extraction task into a multi-classification task, and training the graph neural network model with the subgraph multi-classification task; Step S6: Threat kill chain extraction. Perform steps S2 and 3 on the training security report in the test set in sequence, add the result to step S4 to update and establish a threat knowledge graph, and then perform step S5 to generate the kill chain involved in the training security report.

2. According to claim 1, a threat kill chain extraction method based on heterogeneous graph neural network is characterized in that: The entity types annotated in step S1 include: attacker, malware, malicious family, application, vulnerability, operating system and tool; the relationship triple types include: exploit, execute, attack and belong to.

3. According to claim 2, a threat kill chain extraction method based on heterogeneous graph neural network is characterized in that: The sample annotation in step S1 uses position encoding based on sine or cosine, and the position encoding PE expression is: Among them, pos is the position of the word in the sample sequence, i is the index of the position encoding dimension, and d is the embedding dimension of the model, that is, the dimension of word embedding.

4. According to claim 1, a threat kill chain extraction method based on heterogeneous graph neural network is characterized in that: The step S2 further includes: converting the text into a word vector and feeding it into a pre-trained language model based on Transformer, and fine-tuning it using the annotations in step S1, and the calculation formula is: [x′1,x′2,...,x′ n ]=Transformer([x1,x2,...x n ]); p([w1,w2,...w n ])=MLP[x′1,x′2,...,x′ n ]; Among them, [w1, w2, ... w n ] are the words in the training safety report, [x1, x2, ...x n ] is the word vector, [x′1, x′2, ..., x′ n ] is the extracted intermediate layer embedding; the embedding is sent to the MLP fully connected layer for classification, and finally a series of probabilities is obtained, which can determine whether the input word is the target entity type that needs to be extracted.

5. According to the method for extracting threat kill chains based on heterogeneous graph neural networks in claim 1, it is characterized in that: The step S3 comprises the following sub-steps: Step S31: for each pair of extracted entities, concatenate the feature vector obtained in step S2 with its relative position vector in the triplet; Step S32: input the concatenated vector into another fully connected layer to determine whether there is a relationship between the pair of entities; The splicing is specifically the middle layer embedding and position encoding splicing, and the splicing vector P is expressed as: P(w i ,w j )=MLP((pos i ||x′ i )||(pos j ||x′ j )); Among them, x′ i is the intermediate layer embedding extracted in step S2, x′ j Encode the extracted entity locations.

6. The threat kill chain extraction method based on heterogeneous graph neural network according to claim 1 is characterized in that: The step S5 comprises the following sub-steps: Step 51: Use the obtained entity embedding and edge embedding as the initial vectors of edges and points in the heterogeneous threat knowledge graph; Step 52: Input the heterogeneous threat knowledge graph into the R-GCN model to obtain aggregated entity and edge embeddings; Step 53: Extract the subgraph gi from the threat knowledge graph according to the edges and nodes contained in the report; Step 54: Subgraph g i The input aggregation module extracts the subgraph g i The total embedding h g ; Step 55: Input the total embedding into the MLP multi-classifier to obtain results belonging to certain categories, which are all kill chain processes.

7. The threat kill chain extraction method based on heterogeneous graph neural network according to claim 6 is characterized in that: The R-GCN model aggregates node information according to the edge types, so that the model can learn the heterogeneous information in the report; By inputting the threat knowledge graph established in step S4 into the R-GCN model, we get the new embedding h′ of all nodes i ; The model formula is: in, is the set of nodes that have type r relationship with node i, c i,r is the regularization constant, which is generally The number of nodes in the is a learnable parameter related to the edge type.

8. The threat kill chain extraction method based on heterogeneous graph neural network according to claim 7 is characterized in that: The subgraph g i Total embedding h g The calculation formula is: h g =readout(g i ,h′ i ); Among them, h′ i is the new embedding of the node, That is, sum the data by node type, and take the average for the same node type.

9. The threat kill chain extraction method based on heterogeneous graph neural network according to claim 8 is characterized in that: The total embedding is input into the MLP multi-classifier, and the calculation formula is: p(k1,k2,...,k7)=MLP(h g ); Among them, h g For subgraph g i , k1, k2, ..., k7 are the probability results obtained, and the kill chain category involved in the training security report is determined according to the size of the probability results.

Citation Information

Cited By

  • Network security test method and device, equipment and storage medium

    CN116405230A