An intrusion detection method and system based on traceability clustering and graph serialization

The intrusion detection method based on traceability clustering and graph serialization solves the problems of low detection rate and difficult data processing in the existing technology. Through the clustering and feature extraction of traceability graphs, combined with neural networks and rule bases, the intrusion detection method is improved. The accuracy and efficiency of detection enable more in-depth abnormal behavior analysis.

CN114238958BActive Publication Date: 2024-10-15HUAZHONG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111534563.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-15
Publication Date
2024-10-15
Estimated Expiration
2041-12-15

AI Technical Summary

Technical Problem

Existing intrusion detection methods have low detection rates in big data environments, are difficult to extract data features, and require large data processing time. Moreover, the neural network input requirements lead to the loss of some data information, thereby reducing the accuracy of intrusion detection.

Method used

Adopt an intrusion detection method based on traceability clustering and graph serialization. By establishing traceability graphs and clustering nodes, we generate traceability subgraphs of behavioral instances, perform feature extraction and comparison, and use neural network models and rule bases to determine the normality of behavioral instances. It combines the calculation of node importance and dependence to perform multiple rounds of label propagation and node aggregation optimization serialization.

Benefits of technology

It improves the detection accuracy and efficiency of intrusion detection, enables more in-depth analysis of user behavior, mines abnormal features, reduces workload, and enhances detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114238958B_ABST
    Figure CN114238958B_ABST
Patent Text Reader

Abstract

The invention discloses an intrusion detection method and system based on source tracing clustering and graph serialization, which belongs to the field of network security, including: establishing a source tracing graph for representing user behavior, clustering the nodes therein, and obtaining a source tracing subgraph corresponding to the behavior instances constituting the user behavior; after serializing each source tracing subgraph, inputting it into a trained feature extraction model respectively, and obtaining a feature vector of each behavior instance; comparing the feature vectors of each behavior instance of the user behavior with the feature vectors in the rule base respectively, and judging the user behavior as an intrusion behavior when the behavior instances of the user behavior are not all normal behavior instances; the rule base is a collection of feature vectors of normal behavior instances; if the minimum difference between the feature vector of the behavior instance and each feature vector in the rule base is greater than a preset detection threshold, the behavior instance is an abnormal behavior instance, otherwise it is a normal behavior instance. The invention can improve the detection accuracy and efficiency of intrusion detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of network security, and more specifically, relates to an intrusion detection method and system based on source tracing clustering and graph serialization. Background Art

[0002] As one of the core technologies of network security, intrusion detection technology collects information from several key points in a computer system or computer network and analyzes these nodes to find out whether the system or network has been attacked or violated security policies. The current mainstream host-based intrusion detection methods are generally based on tracing or audit logs. However, in a big data environment, some attacks are hidden in big data torrents and long execution paths, which exposes the traditional intrusion detection methods to low detection rates, difficulty in extracting data features, and high data processing time overhead.

[0003] Intrusion behavior detection is used to detect whether user behavior is normal behavior or intrusion behavior, which is an important aspect of intrusion detection. Existing intrusion detection methods can improve the detection accuracy to a certain extent in terms of intrusion behavior detection, but these works generally analyze the entire user behavior as the analysis object, and user behavior usually includes multiple normal or abnormal operation sequences. For example, a complete user behavior from encoding to uploading includes: code writing, program compilation, running, uploading and other operations, and attackers are good at hiding attacks in a large number of normal operations, which makes it difficult for analysts to mine attack behavior features from massive traceability data. At the same time, in the detection process, not only abnormal operations need to be identified and analyzed, but also related normal behavior operations need to be analyzed, which greatly increases the analysis workload, and hidden attacks are not easy to be discovered, and the overall detection effect is poor.

[0004] At present, convolutional neural networks, autoencoders and other neural networks are also widely used in intrusion detection. In order to meet the input requirements of the neural network, the data needs to be vectorized before sending the relevant data to the neural network. When traditional methods perform data vectorization, for longer data, the data of the specified length is often directly intercepted, and the rest of the data is directly discarded. This causes some important data information to be lost during the vectorization process, which has a negative impact on the neural network mining features, and the final intrusion detection accuracy is not high. In addition, when using neural networks, existing intrusion detection methods often train a binary classification neural network and directly use the network to output the detection results of whether the user behavior is normal, which also limits the accuracy of intrusion detection. Summary of the invention

[0005] In view of the defects and improvement needs of the prior art, the present invention provides an intrusion detection method and system based on traceability clustering and graph serialization, which aims to improve the detection accuracy and efficiency of intrusion detection.

[0006] To achieve the above object, according to one aspect of the present invention, an intrusion detection method based on source tracing clustering and graph serialization is provided, comprising:

[0007] Using the traceability data, a traceability graph is established to represent user behavior, and the nodes therein are clustered to obtain a traceability subgraph corresponding to the behavior instances constituting the user behavior.

[0008] After serializing the traceability subgraphs corresponding to each behavior instance, they are input into the trained feature extraction model to obtain the feature vectors of each behavior instance.

[0009] The feature vectors of each behavior instance of the user behavior are compared with the feature vectors in the rule base to determine whether the behavior instances of the user behavior are all normal behavior instances. If so, the user behavior is determined to be normal behavior; otherwise, the user behavior is determined to be an intrusion behavior;

[0010] Among them, the feature extraction model is a neural network model; the rule base is a collection of feature vectors of normal behavior instances; if the minimum difference between the feature vector of the behavior instance and each feature vector in the rule base is greater than a preset detection threshold, then the behavior instance is an abnormal behavior instance, otherwise it is a normal behavior instance.

[0011] A behavior instance is a series of system call sequences that operate on related data and reflect user behavior through information flow association in a user login session; the present invention decomposes user behavior into multiple behavior instances by clustering the nodes in the traceability graph, and detects each behavior instance separately, and finally determines the detection result of the entire user behavior by combining the detection results of each behavior instance. Compared with taking the entire user behavior as the detection object, the present invention can analyze the related operations in the user behavior more deeply, more fully dig out the anomalies in the user behavior, effectively improve the detection accuracy, and, by decomposing the user behavior, can effectively improve the detection efficiency. In general, the present invention can effectively improve the detection accuracy and efficiency of intrusion detection.

[0012] The present invention only utilizes the neural network model to extract the feature vector of the behavior instance, and further uses the rule base composed of the feature vectors of the normal behavior instance to determine whether the behavior instance is normal. Compared with directly using the neural network to output the normal or not detection result, the present invention considers more information in the detection process and can further improve the detection accuracy.

[0013] Furthermore, the nodes in the traceability graph are clustered, including:

[0014] (S1) Calculate the importance of each node and initialize the state of each node to be unmarked;

[0015] (S2) Calculate the average importance of unlabeled nodes as the labeling threshold, and filter out unlabeled nodes whose importance is higher than the labeling threshold. If the number of filtered nodes is 0, proceed to step (S5); otherwise, mark the filtered nodes as active propagation nodes, and use the ID of each node as a label;

[0016] (S3) selecting active propagation nodes in descending order of importance, and after each active propagation node is selected, propagating its label to its unlabeled adjacent nodes, and marking the nodes that receive the label;

[0017] (S4) If the number of nodes marked in step (S3) is 0, proceed to step (S2); otherwise, take the nodes marked in step (S3) as active propagation nodes, and take the received labels as the labels of the corresponding nodes, and proceed to step (S3);

[0018] (S5) Nodes with the same label and the edges between these nodes are taken as a traceability subgraph, so as to obtain multiple traceability subgraphs corresponding to multiple behavior instances of the user behavior.

[0019] The method of clustering nodes in the traceability graph of the present invention is an active label propagation method, that is, the node with higher importance actively propagates its label to its child node. Compared with passive propagation, the present invention can fully consider the differences between the importance of nodes, which is conducive to improving the accuracy of behavior instance division; based on this, the method of clustering nodes in the traceability graph of the present invention is also a multi-round label propagation algorithm. In each round of label propagation, the corresponding label threshold is recalculated according to the unlabeled nodes until the label threshold is no longer updated, thereby ensuring that the behavior instance with small-scale nodes is also labeled, further ensuring the accuracy of behavior instance division. In general, the present invention uses an active, multi-round label propagation method to cluster nodes in the traceability graph, which can accurately complete the division of behavior instances.

[0020] Furthermore, the traceability subgraph is serialized, including:

[0021] After sorting the nodes in the traceability subgraph in descending order of node importance, the K nodes with the greatest importance are selected as the central nodes; the neighborhood normalization step is performed on each central node to obtain the serialization results corresponding to each central node, and the serialization results of the traceability subgraph are combined;

[0022] The neighborhood normalization step includes the following steps:

[0023] (T1) Sort the central node and its child nodes in the order of distance from near to far and importance from large to small at the same distance to obtain the neighborhood of the central node;

[0024] (T2) If the neighborhood size L < K, fill the neighborhood with virtual nodes with importance 0 to make the neighborhood size K; if the neighborhood size L > K, for the 2nd to Kth nodes in the neighborhood, update their importance to the sum of their own importance and the average importance of their directly adjacent nodes, and discard the nodes after the Kth node;

[0025] (T3) Extract the importance of the nodes in the neighborhood to form a sequence as the serialized result corresponding to the central node;

[0026] Where K is a positive integer.

[0027] The method for serializing the traceability subgraph in the present invention is a graph serialization method with optimized node aggregation, that is, considering both distance and importance, sorting the central node and its child nodes to construct its neighborhood. When the neighborhood is large, while discarding redundant nodes, the importance of the retained nodes will be updated using the importance of adjacent child nodes, so that the serialized result can maximize the retention of traceability information and further improve the detection accuracy of intrusion detection.

[0028] In some optional embodiments, K = 16.

[0029] In the present invention, when K = 16, for each behavior instance, after serializing its corresponding traceability subgraph, a 16×16 two-dimensional data is obtained. Using this data as the input of the feature extraction model to extract the feature vector of the behavior instance, better detection results can be obtained.

[0030] Further, for any node p, the calculation method of its importance SI(p) is:

[0031] SI(p) = αA(p)+(1 - α)H(p);

[0032] Where A(p) and H(p) respectively represent the node attribute and node dependency of node p, and α represents the proportion of node attributes.

[0033] When calculating the importance of nodes in the present invention, the node attributes and node dependencies of the nodes are comprehensively considered, so that the importance of the nodes can reflect more traceability information and can further improve the detection accuracy of subsequent detection results.

[0034] Further preferably, α = 0.375.

[0035] When the present invention comprehensively considers the node attributes and node dependencies of the node to calculate the importance of the node, the proportion of the node attributes is set to 0.375, which can achieve a better intrusion detection effect.

[0036] Further,

[0037] Among them, H p0 Represents the initial node dependency of node p. The initial node dependency of a node that has no dependency relationship with other nodes is 0, and the initial node dependency of the remaining nodes is x, where x is a positive number. p Represents the node set consisting of all child nodes of node p, p i Represents the child node of node p, SI(p i ) represents node p i Node dependency.

[0038] The present invention calculates the node dependency of a node according to the above formula. The calculated node dependency reflects both the characteristics of the node itself and the relationship between the node and its child nodes.

[0039] Furthermore, the method for determining the detection threshold includes:

[0040] (W1) obtaining a first test set consisting of feature vectors of abnormal behavior instances and a second test set consisting of feature vectors of normal behavior instances, and calculating the difference between each feature vector in the first test set and each feature vector in the rule base, and taking the minimum difference as the initial value of the detection threshold;

[0041] (W2) using the detection threshold to detect the behavior instances in the first test set and the second test set respectively to calculate the detection rate and the false positive rate;

[0042] (W3) Gradually adjust the value of the detection threshold. After each adjustment, use the detection threshold to detect the behavior instances in the first test set and the second test set respectively to calculate the detection rate and the false detection rate, and compare them with the previous calculation results to obtain the change in detection rate and the change in false detection rate. The difference between the change in detection rate and the change in false detection rate is used as the optimization result under the corresponding value. If the optimization result is less than 0 under the current value, the previous value is determined as the final value of the detection threshold.

[0043] The present invention uses two test sets and adjusts the detection threshold in combination with the actual detection rate and false positive rate, and takes the determined optimal value as the final detection threshold. Setting the detection threshold in this way can be applicable to different data sets, and the best detection rate and no-reduction rate can be obtained under different data sets.

[0044] Furthermore, the feature vectors of each behavior instance of the user behavior are compared with the feature vectors in the rule base to determine whether the behavior instances of the user behavior are all normal behavior instances, including:

[0045] For each behavior instance, calculate the difference between its feature vector and each feature vector in the rule base, and find the minimum difference;

[0046] For all behavior instances, find the maximum value from the corresponding minimum difference. If the maximum value is less than the detection threshold, it is determined that the behavior instances of the user behavior are all normal behavior instances; otherwise, it is determined that there are abnormal behavior instances in the behavior instances of the user behavior.

[0047] The present invention first finds the minimum difference between the feature vector of each behavior instance and the feature vectors in the rule library comparison library, then finds the maximum value from all the minimum differences, and directly uses the comparison result of the maximum value and the detection threshold to complete the final detection judgment, thereby saving recognition time and quickly completing the detection and judgment of the entire user behavior.

[0048] According to another aspect of the present invention, an intrusion detection system based on source tracing clustering and graph serialization is provided, comprising:

[0049] A traceability information collection module is used to use traceability data to establish a traceability graph for representing user behavior;

[0050] The behavior instance clustering module is used to cluster the nodes in the traceability graph to obtain multiple traceability subgraphs corresponding to multiple instances of user behavior.

[0051] The traceability subgraph serialization module is used to serialize the traceability subgraph corresponding to the behavior instance;

[0052] and an anomaly detection module, which is used to input the traceability subgraph serialization results corresponding to each behavior instance into the trained feature extraction model, obtain the feature vector of each behavior instance, and compare the feature vector of each behavior instance of the user behavior with the feature vector in the rule base, so as to determine whether the behavior instances of the user behavior are all normal behavior instances. If so, the user behavior is determined to be normal behavior; otherwise, the user behavior is determined to be an intrusion behavior;

[0053] Among them, the feature extraction model is a neural network model; the rule base is a collection of feature vectors of normal behavior instances; if the minimum difference between the feature vector of the behavior instance and each feature vector in the rule base is greater than a preset detection threshold, then the behavior instance is an abnormal behavior instance, otherwise it is a normal behavior instance.

[0054] According to yet another aspect of the present invention, there is provided a computer-readable storage medium comprising a stored computer program;

[0055] When the computer program is executed by the processor, the device where the computer-readable storage medium is located is controlled to execute the intrusion detection method based on source tracing clustering and graph serialization provided by the present invention.

[0056] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects:

[0057] (1) The present invention decomposes user behavior into multiple behavior instances by clustering the nodes in the traceability graph, and detects each behavior instance separately. Finally, the detection result of the entire user behavior is determined by combining the detection results of each behavior instance, which can effectively improve the detection accuracy and efficiency of intrusion detection.

[0058] (2) The present invention only utilizes the neural network model to extract the feature vector of the behavior instance, and further uses the rule base composed of the feature vectors of the normal behavior instance to determine whether the behavior instance is normal. This allows more information to be considered during the detection process, further improving the detection accuracy.

[0059] (3) The present invention adopts an active, multi-round label propagation method to cluster the nodes in the traceability graph, and considers the importance of the nodes in the clustering process, which can accurately complete the division of behavior instances.

[0060] (4) The present invention uses a graph serialization method with node aggregation optimization to serialize the traceability system. The obtained serialization result can maximize the retention of traceability information and further improve the detection accuracy of intrusion detection.

[0061] (5) When calculating the importance of a node, the present invention will comprehensively consider the node attributes and node dependencies of the node, so that the importance of the node can reflect more traceability information, which can further improve the detection accuracy of subsequent detection results.

[0062] (6) The present invention uses two test sets and adjusts the detection threshold in combination with the actual detection rate and false positive rate, and uses the determined optimal value as the final detection threshold. Setting the detection threshold in this way can be applicable to different data sets. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 A schematic diagram of an intrusion detection method and system based on source tracing clustering and graph serialization provided by an embodiment of the present invention;

[0064] Figure 2 A schematic diagram of a method for constructing a provenance graph provided by an embodiment of the present invention;

[0065] Figure 3 A schematic diagram of a multi-round label propagation method provided by an embodiment of the present invention;

[0066] Figure 4 A schematic diagram of a graph serialization method for node aggregation optimization provided by an embodiment of the present invention;

[0067] Figure 5 A schematic diagram of extracting behavior instance features provided by an embodiment of the present invention;

[0068] Figure 6 A flowchart of user behavior detection provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0069] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0070] In the present invention, the terms "first", "second", etc. (if any) in the present invention and the accompanying drawings are used to distinguish similar objects but not necessarily to describe a specific order or sequence.

[0071] In order to solve the technical problems of large analysis workload and low detection accuracy of existing intrusion detection methods, the present invention provides an intrusion detection method and system based on traceability clustering and graph serialization, the overall idea of ​​which is: decomposing user behavior into multiple behavior instances, detecting each behavior instance separately, and combining the detection results of each behavior instance to obtain the detection result of the entire user behavior; on this basis, the behavior instance is divided by using traceability graph clustering, and in the clustering process, the importance of the node and the difference in the size of the node corresponding to the behavior instance are fully considered to ensure the accuracy of the behavior instance division; when serializing the traceability subgraph of the behavior instance, the traceability information is retained to the maximum extent.

[0072] The following are examples.

[0073] Embodiment 1:

[0074] An intrusion detection method based on traceability clustering and graph serialization, such as Figure 1 As shown, including:

[0075] Using the traceability data, a traceability graph is established to represent user behavior, and the nodes therein are clustered to obtain a traceability subgraph corresponding to the behavior instances constituting the user behavior.

[0076] After serializing the traceability subgraphs corresponding to each behavior instance, they are input into the trained feature extraction model to obtain the feature vectors of each behavior instance.

[0077] The feature vectors of each behavior instance of the user behavior are compared with the feature vectors in the rule base to determine whether the behavior instances of the user behavior are all normal behavior instances. If so, the user behavior is determined to be normal behavior; otherwise, the user behavior is determined to be an intrusion behavior;

[0078] Among them, the feature extraction model is a neural network model; the rule base is a collection of feature vectors of normal behavior instances. Optionally, in this embodiment, the rule base can be constructed by obtaining the traceability subgraph serialization results of known normal behavior instances, forming a rule data set, and inputting it into the feature extraction model; if the minimum difference between the feature vector of the behavior instance and the feature vectors in the rule base is greater than a preset detection threshold, then the behavior instance is an abnormal behavior instance, otherwise it is a normal behavior instance.

[0079] This embodiment decomposes the user behavior into multiple behavior instances by clustering the nodes in the traceability graph, and detects each behavior instance separately. Finally, the detection result of the entire user behavior is determined by combining the detection results of each behavior instance. This embodiment can analyze the relevant operations in the user behavior more deeply, more fully explore the anomalies in the user behavior, effectively improve the detection accuracy, and by decomposing the user behavior, the detection efficiency can be effectively improved.

[0080] The traceability information consists of system calls that reflect user behavior. The objects involved in each system call, such as applications, files, processes, Sockets, etc., constitute the nodes of the traceability system, and the ID of each node is globally unique; the content recorded in the traceability information includes the node ID, node attributes, and other nodes on which the node depends, which can be collected using the traceability tracking system; the traceability graph established based on the traceability information can be used to represent user behavior. The traceability graph is constructed in the following way: the nodes in the traceability system correspond to the nodes in the traceability graph, and the attributes of the nodes in the traceability system correspond to the attributes of the nodes in the traceability graph. If there is a dependency relationship between two nodes in the traceability system, then in the traceability graph, there is a directed edge between the corresponding two nodes, and the directed edge points to the dependent node.

[0081] The amount of traceability information is very large. In order to ensure the efficiency of behavior detection, this embodiment extracts useful information from the massive traceability information before constructing the traceability graph, including nodes, node attributes, and dependencies between nodes.

[0082] Figure 2 This is an example of building a traceability graph based on traceability information. The left side is the traceability information, and the right side is the corresponding traceability graph.

[0083] In the traceability information, "2.0", "3.0", "2.1", etc. indicate the node ID. The traceability information can describe node attributes. For example, "2.0NAME / usr / local / sbin / vsftpd" indicates that 2.0 has a NAME attribute, and the attribute value of the NAME attribute is " / usr / local / sbin / vsftpd". The traceability information can also describe the dependency relationship between nodes. For example, "2.0FORKPARENT[ANC]3.0" indicates that node 2.0 depends on node 3.0.

[0084] In the constructed traceability graph, the nodes in the traceability system, i.e., node 2.0, node 3.0, node 2.1, etc., correspond to the nodes in the traceability graph; the attributes of the nodes in the traceability system correspond to the attributes of the nodes in the traceability graph, and in this embodiment, the traceability graph only stores the number of attributes of each node, but not the specific attribute values; in the traceability system, the dependency relationship between nodes corresponds to the directed edges in the traceability graph. For example, in the traceability system, node 2.0 depends on node 3.0, then in the traceability graph, there is a directed edge from node 2.0 to node 3.0.

[0085] A behavior instance is a series of system call sequences that operate on related data and reflect user behavior through information flow association in a user login session; label propagation algorithms such as LPA (Label Propagation Algorithm) can be used to complete the clustering of the traceability graph. In order to accurately decompose user behavior into multiple behavior instances, this embodiment proposes a new active, multi-round label propagation method to cluster the nodes in the traceability graph; specifically, Figure 1 and Figure 3 As shown, in this embodiment, clustering the nodes in the traceability graph includes:

[0086] (S1) Calculate the importance of each node and initialize the state of each node to be unmarked;

[0087] (S2) Calculate the average importance of unlabeled nodes as the labeling threshold, and filter out unlabeled nodes whose importance is higher than the labeling threshold. If the number of filtered nodes is 0, proceed to step (S5); otherwise, mark the filtered nodes as active propagation nodes, and use the ID of each node as a label;

[0088] In step (S2), the nodes screened out based on the marking threshold are representative nodes of the behavior instance and are also ancestor nodes of the node corresponding to the behavior instance; if the number of screened out nodes is 0, it means that there is no new behavior instance;

[0089] (S3) selecting active propagation nodes in descending order of importance, and after each active propagation node is selected, propagating its label to its unlabeled adjacent nodes, and marking the nodes that receive the label;

[0090] (S4) If the number of nodes marked in step (S3) is 0, proceed to step (S2); otherwise, take the nodes marked in step (S3) as active propagation nodes, and take the received labels as the labels of the corresponding nodes, and proceed to step (S3);

[0091] Based on steps (S2) to (S4), the label of the representative node of each behavior instance can be actively propagated to each child node of the representative node;

[0092] (S5) taking nodes with the same label and the edges between these nodes as a traceability subgraph, and obtaining multiple traceability subgraphs corresponding to multiple behavior instances of the user behavior;

[0093] The method of clustering nodes in the traceability graph in this embodiment is an active label propagation method, that is, nodes with higher importance actively propagate their labels to their child nodes. Compared with passive propagation, the present invention can fully consider the differences between the importance of nodes, which is conducive to improving the accuracy of behavior instance division; considering that different behavior instances may have nodes of different sizes, and the node importance of nodes is also different, which will lead to inconsistent average node importance of different behavior instances. If only one round of label propagation is performed, it is easy for those behavior instances with small-scale nodes to fail to be marked, which will affect the final intrusion detection effect. For example, Figure 3 In the first round of active label propagation, the marking threshold is T=9, and the representative nodes of the selected behavior instances are nodes 50 and 45. After the label propagation is completed, there are still many nodes that are not marked. Based on this, in this embodiment, after a round of label propagation is completed, that is, when the number of nodes that can be marked is 0, the threshold of the unmarked nodes is continuously updated, and a new round of active label propagation is started, thereby ensuring that the nodes of each behavior instance are marked. For example, Figure 3 In the repeated label propagation process, after updating the label threshold according to the unlabeled nodes, the label threshold is T=5, and the representative nodes of the selected behavior instances are nodes 8 and 9. After the label propagation is completed, all nodes have been labeled. In general, based on the above-mentioned active, multi-round label propagation method, this embodiment can accurately complete the division of behavior instances and ensure the detection accuracy of subsequent detections; in order to make the node importance reflect more traceability information, as a preferred implementation method, in this embodiment, when calculating the importance of the node, the node characteristics of the traceability graph will be used, and the node's own attributes and the node's node dependency will be comprehensively considered. Specifically, for any node p, its importance SI(p) is calculated as follows:

[0094] SI(p)=αA(p)+(1-α)H(p);

[0095] Wherein, A(p) and H(p) represent the node attribute and node dependency of node p respectively, and α represents the node attribute ratio; optionally, in this embodiment, the number of attributes possessed by the node is directly used as the node attribute of the node;

[0096] The node dependency is related to the dependency relationship between nodes. In the traceability graph, if a node is the ancestor node of multiple nodes, it means that the node is the main dependent object of most processes and files in the traceability graph, and the node dependency of the node should be high. Based on this, in this embodiment, the node dependency H(p) is calculated as follows:

[0097]

[0098] Among them, H p0 Represents the initial node dependency of node p; self-referential nodes, i.e. nodes with both out-degree and in-degree 1 pointing to themselves, have no dependency relationship with other nodes and are transition nodes. Such nodes are not very important in the traceability graph. Therefore, in this embodiment, the initial dependency of self-referential nodes is 0, and the initial dependency of other nodes is set to 1; M p Represents the node set consisting of all child nodes of node p, p i Represents the child node of node p, SI(p i ) represents node p i According to the calculation formula of node dependency, the importance of a node is not only related to itself, but also to its child nodes.

[0099] Experiments show that when α=0.375, the intrusion detection result is better. Therefore, in this embodiment, when calculating the node importance, α=0.375 is set.

[0100] In order to avoid losing important traceability information as much as possible when serializing the traceability subgraph, this embodiment proposes a graph serialization method for node aggregation optimization to perform graph serialization. The graph serialization method for node aggregation optimization comprehensively considers distance and importance, sorts the central node and its child nodes to construct its neighborhood. When the neighborhood is large, while discarding redundant nodes, the importance of the retained nodes is updated using the importance of the adjacent child nodes. Specifically, it includes:

[0101] After sorting the nodes in the traceability subgraph in descending order of node importance, the K nodes with the greatest importance are selected as the central nodes;

[0102] The neighborhood normalization step is performed on each central node to obtain the serialized results corresponding to the central nodes, and they are combined into the serialized result of the traceability subgraph;

[0103] The neighborhood normalization step includes the following steps:

[0104] (T1) Sort the central node and its child nodes in the order of increasing distance and decreasing importance at the same distance to obtain the neighborhood of the central node;

[0105] (T2) If the neighborhood size L < K, fill the neighborhood with virtual nodes with importance 0 to make the neighborhood size K; if the neighborhood size L > K, for the 2nd to Kth nodes in the neighborhood, update their importance to the sum of their own importance and the average importance of their directly adjacent nodes, and discard the nodes after the Kth node;

[0106] K is a positive integer. Optionally, in this embodiment, K = 16. Then, for each behavior instance, after serializing the corresponding traceability subgraph, a 16×16 two-dimensional data is obtained, and this data is used as the input of the feature extraction model to extract the feature vector of the behavior instance, and better detection results can be obtained; in this embodiment, the formula for updating the importance of any node p is:

[0107]

[0108] where SI old and SI new respectively represent the node importance before and after the update of node p, represents the node importance of the directly adjacent child nodes of node p;

[0109] (T3) Extract the importance of the nodes in the domain to form a sequence as the serialized result corresponding to the central node;

[0110] In this embodiment, the graph serialization method optimized by node aggregation is used for serializing the traceability subgraph, which can maximize the retention of traceability information by using node aggregation;

[0111] The following combines Figure 4 to further explain the traceability subgraph serialization method in this embodiment. For simplicity of representation, Figure 4 in which, K = 8. The numbers in the nodes are the node importance of the corresponding nodes; Figure 4 On the left of Figure 4The right side of is the result obtained by the graph serialization method with node aggregation optimization. It can be seen that the graph serialization method with node aggregation optimization will use the importance of adjacent child nodes to update the importance of retained nodes while discarding redundant nodes. Taking a node with an importance of 7 as an example, the node has 4 directly adjacent child nodes with importances of 2, 2, 1, and 1 respectively. After its importance is updated, its importance becomes 8.5. In this process, the traceability information contained in the discarded nodes can be retained as much as possible. Therefore, the graph serialization method with node aggregation optimization in this embodiment can maximize the retention of traceability information in the process of traceability subgraph serialization, thereby further improving the detection accuracy of intrusion detection.

[0112] like Figure 5 As shown, in this embodiment, a convolutional neural network is used as a feature extraction model. Before intrusion detection, the model is trained using a data set consisting of a graph sequence corresponding to a known behavior instance constituting a normal behavior, so as to obtain a trained feature extraction model. The model can learn the features of normal behavior more intensively during the training process, and can mine the features of normal behavior more accurately during actual feature extraction.

[0113] After completing the serialization of the traceability subgraph, this embodiment uses the serialization result as the input of the convolutional neural network, uses the "convolution-pooling" layer in the convolutional neural network to mine the representative features of the behavior instance, and then integrates the features through the fully connected layer, and uses the output of the fully connected layer as the feature vector of the corresponding behavior instance to perform the final intrusion detection; it should be noted that the convolutional neural network is only an optional embodiment of the present invention and should not be understood as the only limitation of the present invention. Other models that can be used to extract features, such as autoencoders, can also be applied to the present invention;

[0114] In this embodiment, the rule base is used to complete intrusion detection. Only when all behavior instances in a user behavior are normal, the user behavior is normal. When the minimum difference between the feature vector of the behavior instance and all feature vectors in the rule base is still greater than the preset detection threshold, the behavior instance is determined to be an abnormal behavior instance. Optionally, in this embodiment, the Euclidean distance is specifically used to measure the difference between feature vectors. For two vectors X(x1, x2, ... xn), Y(y1, y2, ... y n ), the calculation formula of the Euclidean distance is as follows;

[0115]

[0116] Wherein, n represents the dimension of vectors X and Y; it should be noted that the Euclidean distance is only an optional implementation manner and should not be understood as the only limitation of the present invention. In some other embodiments of the present invention, other methods such as cosine similarity may also be used to measure the difference between feature vectors;

[0117] The detection threshold for judging whether a behavior instance is abnormal can be set accordingly according to the actual application. In order to adapt to different data sets, in this embodiment, the detection threshold will be adjusted according to the detection rate and the false positive rate to obtain the best detection effect; the detection rate refers to the proportion of intrusion behaviors correctly detected as intrusion behaviors; the false positive rate refers to the proportion of normal behaviors detected as intrusion behaviors; the higher the detection rate and the lower the false positive rate, the better the detection effect;

[0118] Specifically, in this embodiment, the method for determining the detection threshold includes:

[0119] (W1) obtaining a first test set consisting of feature vectors of abnormal behavior instances and a second test set consisting of feature vectors of normal behavior instances, and calculating the difference between each feature vector in the first test set and each feature vector in the rule base, and taking the minimum difference as the initial value of the detection threshold;

[0120] (W2) using the detection threshold to detect the behavior instances in the first test set and the second test set respectively to calculate the detection rate and the false positive rate;

[0121] (W3) Gradually adjust the value of the detection threshold. After each adjustment, use the detection threshold to detect the behavior instances in the first test set and the second test set to calculate the detection rate and the false detection rate, and compare them with the previous calculation results to obtain the change in detection rate and the change in false detection rate. The difference between the change in detection rate and the change in false detection rate is used as the optimization result under the corresponding value. If the optimization result is less than 0 under the current value, the previous value is determined as the final value of the detection threshold. The detection threshold determined in this way can obtain the best detection rate and false detection rate.

[0122] In order to save identification time and improve intrusion detection efficiency, this embodiment does not determine whether each behavior instance is normal or not, but is based on the rule that if any behavior instance is abnormal, the entire user behavior is abnormal. Figure 6 As shown, for each behavior instance, the Euclidean distance between its feature vector and each feature vector in the rule base is calculated, and the minimum Euclidean distance is found;

[0123] For all behavior instances, find the maximum value from the corresponding minimum difference Euclidean distance. If the maximum value is less than the detection threshold, it is determined that the behavior instances of the user behavior are all normal behavior instances, and accordingly, the user behavior is normal behavior; otherwise, it is determined that there are abnormal behavior instances in the behavior instances of the user behavior, and accordingly, the user behavior is an intrusion behavior.

[0124] This embodiment only uses the neural network model to extract the feature vector of the behavior instance, and further uses the rule base composed of the feature vectors of the normal behavior instance to determine whether the behavior instance is normal. Compared with directly using the neural network to output the normal or not detection result, this embodiment takes into account more information in the detection process and can further improve the detection accuracy.

[0125] Embodiment 2:

[0126] An intrusion detection system based on traceability clustering and graph serialization, such as Figure 1 As shown, including:

[0127] A traceability information collection module is used to use traceability data to establish a traceability graph for representing user behavior;

[0128] The behavior instance clustering module is used to cluster the nodes in the traceability graph to obtain multiple traceability subgraphs corresponding to multiple instances of user behavior.

[0129] The traceability subgraph serialization module is used to serialize the traceability subgraph corresponding to the behavior instance;

[0130] and an anomaly detection module, which is used to input the traceability subgraph serialization results corresponding to each behavior instance into the trained feature extraction model, obtain the feature vector of each behavior instance, and compare the feature vector of each behavior instance of the user behavior with the feature vector in the rule base, so as to determine whether the behavior instances of the user behavior are all normal behavior instances. If so, the user behavior is determined to be normal behavior; otherwise, the user behavior is determined to be an intrusion behavior;

[0131] Among them, the feature extraction model is a neural network model; the rule base is a collection of feature vectors of normal behavior instances; if the minimum difference between the feature vector of the behavior instance and each feature vector in the rule base is greater than a preset detection threshold, then the behavior instance is an abnormal behavior instance, otherwise it is a normal behavior instance. ;

[0132] In this embodiment, the specific implementation of each module can refer to the description in the above embodiment 1 and will not be repeated here.

[0133] Embodiment 3:

[0134] A computer-readable storage medium comprising a stored computer program;

[0135] When the computer program is executed by the processor, the device where the computer-readable storage medium is located is controlled to execute the intrusion detection method based on provenance clustering and graph serialization provided in the above-mentioned embodiment 1.

[0136] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. An intrusion detection method based on source tracing clustering and graph serialization, characterized in that: Including: Establish a traceability graph for representing user behavior using traceability data, and cluster the nodes therein to obtain traceability subgraphs that correspond one-to-one to the behavior instances constituting the user behavior; After serializing the traceability subgraphs corresponding to each behavior instance, input them into a trained feature extraction model respectively to obtain the feature vectors of each behavior instance; Compare the feature vectors of each behavior instance of the user behavior with the feature vectors in the rule library respectively to determine whether the behavior instances of the user behavior are all normal behavior instances. If so, determine that the user behavior is a normal behavior; otherwise, determine that the user behavior is an intrusion behavior; Wherein, the feature extraction model is a neural network model; the rule library is a set of feature vectors of normal behavior instances; if the minimum difference degree between the feature vector of a behavior instance and each feature vector in the rule library is greater than a preset detection threshold, then this behavior instance is an abnormal behavior instance, otherwise it is a normal behavior instance; Clustering the nodes in the traceability graph includes: (S1) Calculate the importance of each node and initialize the state of each node as unmarked; (S2) Calculate the average importance of the unmarked nodes as the marking threshold, and filter out the unmarked nodes whose importance is higher than the marking threshold. If the number of filtered nodes is 0, go to step (S5); otherwise, mark the filtered nodes as active propagation nodes and use the ID of each node as the label; (S3) Select active propagation nodes in order of decreasing importance. After each selection of an active propagation node, propagate its label to its unmarked adjacent nodes and mark the nodes that receive the label; (S4) If the number of nodes marked in step (S3) is 0, go to step (S2); otherwise, use the nodes marked in step (S3) as active propagation nodes and use the received label as the label of the corresponding node, and go to step (S3); (S5) Take the nodes with the same label and the edges between these nodes as a traceability subgraph to obtain multiple traceability subgraphs that correspond one-to-one to the multiple behavior instances of the user behavior; Serializing the traceability subgraph includes: Sort the nodes in the traceability subgraph in order of decreasing node importance, and then take the K nodes with the greatest importance as the central nodes; perform a neighborhood normalization step for each central node respectively to obtain the serialization result corresponding to each central node, and combine them into the serialization result of the traceability subgraph; The neighborhood normalization step includes the following steps: (T1) Sort the central node and its child nodes in order of increasing distance and decreasing importance at the same distance to obtain the neighborhood of the central node; (T2) If the neighborhood size L < K, fill the neighborhood with virtual nodes with importance 0 to make the neighborhood size K; if the neighborhood size L > K, for the 2nd to Kth nodes in the neighborhood, update their importance to the sum of their own importance and the average importance of their directly adjacent nodes, and discard the nodes after the Kth node; (T3) extract the importance of nodes in the field and form a sequence as the serialization result corresponding to the central node; Wherein, K is a positive integer.

2. The intrusion detection method based on source tracing clustering and graph serialization according to claim 1, characterized in that: For any node p, its importance SI(p) is calculated as follows: SI(p)=αA(p)+(1-α)H(p); Among them, A(p) and H(p) represent the node attributes and node dependency of node p respectively, and α represents the node attribute ratio.

3. The intrusion detection method based on source tracing clustering and graph serialization as claimed in claim 2, characterized in that: α=0.375。 4. The intrusion detection method based on source tracing clustering and graph serialization as claimed in claim 2, characterized in that: Among them, H p0 Represents the initial node dependency of node p. The initial node dependency of a node that has no dependency relationship with other nodes is 0, and the initial node dependency of the remaining nodes is x, where x is a positive number. p Represents the node set consisting of all child nodes of node p, p i Represents the child node of node p, SI(p i ) represents node p i Node dependency.

5. The intrusion detection method based on source tracing clustering and graph serialization according to claim 1, characterized in that: The method for determining the detection threshold comprises: (W1) obtaining a first test set consisting of feature vectors of abnormal behavior instances and a second test set consisting of feature vectors of normal behavior instances, and calculating the difference between each feature vector in the first test set and each feature vector in the rule base, and taking the minimum difference as the initial value of the detection threshold; (W2) using the detection threshold to detect the behavior instances in the first test set and the second test set respectively to calculate the detection rate and the false positive rate; (W3) gradually adjusting the value of the detection threshold. After each adjustment, respectively using the detection threshold to detect the behavior instances in the first test set and the second test set to calculate the detection rate and the false detection rate, and comparing them with the previous calculation results to obtain the change in detection rate and the change in false detection rate. The difference between the change in detection rate and the change in false detection rate is used as the optimization result under the corresponding value. If the optimization result is less than 0 under the current value, the previous value is determined as the final value of the detection threshold.

6. The intrusion detection method based on source tracing clustering and graph serialization according to claim 1, characterized in that: Comparing the feature vectors of each behavior instance of the user behavior with the feature vectors in the rule base respectively to determine whether the behavior instances of the user behavior are all normal behavior instances, including: For each behavior instance, respectively calculate the difference between its feature vector and each feature vector in the rule base, and find the minimum difference; For all behavior instances, find the maximum value from the corresponding minimum difference. If the maximum value is less than the detection threshold, it is determined that the behavior instances of the user behavior are all normal behavior instances; otherwise, it is determined that there are abnormal behavior instances in the behavior instances of the user behavior.

7. An intrusion detection system based on traceability clustering and graph serialization, characterized in that: include: A traceability information collection module is used to use traceability data to establish a traceability graph for representing user behavior; A behavior instance clustering module, used to cluster the nodes in the traceability graph to obtain multiple traceability subgraphs corresponding to multiple instances of the user behavior; The traceability subgraph serialization module is used to serialize the traceability subgraph corresponding to the behavior instance; and an anomaly detection module, which is used to input the traceability subgraph serialization results corresponding to each behavior instance into the trained feature extraction model, obtain the feature vector of each behavior instance, and compare the feature vector of each behavior instance of the user behavior with the feature vector in the rule base, so as to determine whether the behavior instances of the user behavior are all normal behavior instances. If so, the user behavior is determined to be normal behavior; otherwise, the user behavior is determined to be an intrusion behavior; Among them, the feature extraction model is a neural network model; the rule base is a set of feature vectors of normal behavior instances; if the minimum difference degree between the feature vector of a behavior instance and each feature vector in the rule base is greater than a preset detection threshold, then this behavior instance is an abnormal behavior instance, otherwise it is a normal behavior instance; Clustering the nodes in the traceability graph includes: (S1) Calculate the importance of each node and initialize the status of each node as unmarked; (S2) Calculate the average importance of unmarked nodes as the marking threshold, and filter out unmarked nodes with importance higher than the marking threshold. If the number of filtered nodes is 0, go to step (S5); otherwise, mark the filtered nodes as active propagation nodes and use the ID of each node as the label; (S3) Select active propagation nodes in descending order of importance. After each selection of an active propagation node, propagate its label to its unmarked adjacent nodes and mark the nodes that receive the label; (S4) If the number of nodes marked in step (S3) is 0, go to step (S2); otherwise, use the nodes marked in step (S3) as active propagation nodes and use the received label as the label of the corresponding node, and go to step (S3); (S5) Take the nodes with the same label and the edges between these nodes as a traceability subgraph, and obtain multiple traceability subgraphs corresponding one by one to multiple behavior instances of the user behavior; Serializing the traceability subgraph includes: After sorting the nodes in the traceability subgraph in descending order of node importance, select the K nodes with the highest importance as the central nodes; perform a neighborhood normalization step on each central node respectively to obtain the serialization result corresponding to each central node, and combine them into the serialization result of the traceability subgraph; The neighborhood normalization step includes the following steps: (T1) Sort the central node and its child nodes in order of distance from near to far and importance from large to small at the same distance to obtain the neighborhood of the central node; (T2) If the neighborhood size L < K, fill the neighborhood with virtual nodes with importance 0 to make the neighborhood size K; if the neighborhood size L > K, for the 2nd to Kth nodes in the neighborhood, update their importance to the sum of their own importance and the average importance of their directly adjacent nodes, and discard the nodes after the Kth node; (T3) Extract the importance of the nodes in the neighborhood to form a sequence as the serialization result corresponding to the central node; Among them, K is a positive integer.

8. A computer-readable storage medium, characterized in that: Including a stored computer program; When the computer program is executed by a processor, it controls the device where the computer-readable storage medium is located to execute the intrusion detection method based on traceability clustering and graph serialization according to any one of claims 1 to 6.