An event chain extraction method and device, electronic equipment and storage medium
By combining graph detection models and indexed lists, the problem of low efficiency in event chain extraction in existing technologies is solved, and efficient event chain generation and querying are achieved.
Patent Information
- Application Number
- CN202311594331.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-27
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-11-27
AI Technical Summary
Existing technologies require a large number of if-else statements and repetitive redundant code to extract event chains with temporal and/or causal relationships from massive amounts of detection data, resulting in low extraction efficiency.
A graph detection model is adopted, which constructs a detection graph through multiple behavioral units, uses an indexed linked list to record target events, generates an event chain, and reduces if-else statements and repetitive redundant code.
It improves the efficiency of event chain extraction, reduces code redundancy, and increases event query speed.
Smart Images

Figure CN117633796B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing technology, specifically to an event chain extraction method, apparatus, electronic device, and storage medium. Background Technology
[0002] In scenarios where network traffic detection devices, static detection engines, and dynamic analysis engines are used to detect threats, extracting events, behaviors, attack chains, etc. with time and / or causal relationships from massive amounts of detection data has always been a difficult problem to solve, often requiring a lot of manpower for manual extraction and data processing.
[0003] To improve extraction efficiency, automated decision-making can be used to automatically extract events, behaviors, and attack chains. However, in automated decision-making scenarios, the decision-making process involves a large number of complex multi-level logical judgments and multiple conditions, which leads to a large number of if-else statements and repetitive redundant code in the code, resulting in low extraction efficiency. Summary of the Invention
[0004] In view of the above-mentioned problems in the prior art, the purpose of this disclosure is to provide an event chain extraction method, apparatus, electronic device and storage medium, which can solve the technical problem that the extraction of event chains with time and / or causal relationships in the prior art requires a large number of if else statements and repetitive redundant code, resulting in low extraction efficiency.
[0005] To achieve the above objectives, embodiments of this disclosure provide an event chain extraction method, including: Acquire the data to be tested; The data to be detected is input into a preset graph detection model; the graph detection model includes multiple behavioral units, which are determined according to preset event detection behavioral rules; Whenever the graph detection model outputs a target event that the data to be detected has been hit, the target event is recorded in the target index node of a preset index linked list to generate a target event chain corresponding to the data to be detected; each node in the index linked list corresponds to an event chain, and the target index node corresponds to the target event chain.
[0006] In some embodiments, the steps for constructing the graph detection model include: A detection graph is generated based on preset event detection behavior rules. The detection graph includes graph nodes and edges between adjacent graph nodes. The graph nodes are used to record information about the behavior units generated by the behavior rules. The edges are used to record the association relationships between adjacent behavior units. Based on the detection map, a start boundary array and an end boundary array are generated, wherein the start boundary array is used to store the start behavior unit corresponding to the start event representing the start behavior of the event, and the end boundary array is used to store the termination behavior unit corresponding to the termination event representing the termination behavior of the event. The graph detection model is obtained based on the detection graph, the start boundary array, and the end boundary array.
[0007] In some embodiments, the graph detection model outputs the target event hit by the data to be detected, including: Check if a target index node associated with the data to be detected exists in the current index chain; If it does not exist, then search for the target starting behavior unit that the data to be detected hits in the starting boundary array, determine the starting event corresponding to the target starting behavior unit as the target event and output it; If it exists, the target event that the data to be detected hits is found in the detection graph and output. If the target event is not found in the detection graph, the target termination behavior unit that the data to be detected hits is found in the end boundary array, and the termination event corresponding to the target termination behavior unit is determined as the target event and output.
[0008] In some embodiments, when the target event is the starting event, the starting event is recorded as the head node of the target event chain in the free node of the index linked list, and the free node is determined as the target index node; When the target event is the termination event, the termination event is linked as the tail node of the target event chain to the tail of the event chain currently recorded by the target index node, thus obtaining the target event chain.
[0009] In some embodiments, finding the target event that the data to be detected matches from the detection graph includes: Based on the event information of the last node in the event chain currently recorded by the target index node, the target behavior unit associated with the last node is found in the detection graph; The event corresponding to the target behavior unit is identified as the target event.
[0010] In some embodiments, finding the target behavior unit associated with the last node from the detection graph includes: Obtain a list of associated nodes that match the last node; the list of associated nodes is used to record the next associated node in the detection graph that is associated with the last node and has been hit before; Search the list of associated nodes for the data to be detected to match the associated nodes; If an associated node is found that matches the data to be detected, the behavioral unit corresponding to the highest priority associated node is determined as the target behavioral unit. If no associated node is found that matches the data to be detected, then other graph nodes that are not currently recorded in the associated node list of the detection graph are traversed, and the behavioral units that match the data to be detected are determined as the target behavioral units.
[0011] In some embodiments, the method further includes: If a target behavior unit is found in the list of associated nodes, the priority weight of the associated node corresponding to the target behavior unit is increased by a preset value. If a target behavior unit is found among the other graph nodes, the graph node corresponding to the target behavior unit is recorded in the associated node list.
[0012] This disclosure also provides an event chain extraction device, comprising: The acquisition module is configured to acquire the data to be detected. The input module is configured to input the data to be detected into a preset graph detection model; the graph detection model includes multiple behavioral units, which are determined according to preset event detection behavioral rules; The recording module is configured to record the target event into the target index node of a preset index linked list whenever the graph detection model outputs a target event that the data to be detected hits, so as to generate a target event chain corresponding to the data to be detected; each node in the index linked list corresponds to an event chain, and the target index node corresponds to the target event chain.
[0013] This disclosure also provides an electronic device, including at least a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program in the memory.
[0014] This disclosure also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.
[0015] Compared with existing technologies, the event chain extraction method, apparatus, electronic device, and storage medium provided in this disclosure, when generating an event chain associated with the data to be detected, input the data to be detected into a preset graph detection model. Then, whenever the graph detection model outputs a target event matched by the data to be detected, the target event is recorded in the target index node of a preset index linked list to generate the target event chain corresponding to the data to be detected. This disclosure utilizes the interconnected nature of multiple nodes in graph algorithms to establish a graph detection model, improving the efficiency of event querying on the event chain. It uses an index linked list to solve the problem of event chain formation, eliminating the need for numerous if-else statements and repetitive redundant code, resulting in higher extraction efficiency. Attached Figure Description
[0016] In drawings that are not necessarily drawn to scale, the same reference numerals may describe similar parts in different views. The same reference numerals with or without letter suffixes may indicate different instances of similar parts. The drawings generally illustrate various embodiments by way of example rather than limitation and are used, together with the description and claims, to illustrate the claimed embodiments. Where appropriate, the same reference numerals are used in all drawings to refer to the same or similar parts. Such embodiments are illustrative and not intended to be exhaustive or exclusive embodiments of the apparatus or method.
[0017] Figure 1 This is a flowchart of the event chain extraction method according to an embodiment of the present disclosure; Figure 2 This is a flowchart illustrating the construction process of the graph detection model according to an embodiment of the present disclosure; Figure 3 This is another flowchart of the event chain extraction method according to an embodiment of the present disclosure; Figure 4 This is yet another flowchart of the event chain extraction method according to an embodiment of the present disclosure; Figure 5 This is a schematic diagram of the event chain extraction device according to an embodiment of the present disclosure. Detailed Implementation
[0018] The specific embodiments of this disclosure will now be described in detail with reference to the accompanying drawings, but these are not intended to limit the scope of this disclosure.
[0019] It should be understood that various modifications can be made to the embodiments disclosed herein. Therefore, the above description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope and spirit of this disclosure will be apparent to those skilled in the art.
[0020] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present disclosure and, together with the general description of the disclosure given above and the detailed description of the embodiments given below, serve to explain the principles of the disclosure.
[0021] These and other features of this disclosure will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.
[0022] It should also be understood that although this disclosure has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this disclosure, which have the features described in the claims and are therefore all within the scope of protection defined herein.
[0023] The above and other aspects, features and advantages of this disclosure will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.
[0024] Specific embodiments of the present disclosure are described thereafter with reference to the accompanying drawings; however, it should be understood that the disclosed embodiments are merely examples of the present disclosure and can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the present disclosure. Therefore, the specific structural and functional details disclosed herein are not intended to be limiting, but merely to serve as the basis and representative basis for the claims to teach those skilled in the art to use the present disclosure in a variety of substantially any suitable detailed structures.
[0025] First, a brief explanation of the terminology used in the embodiments of this disclosure will be provided: (1) Feature chain: refers to an ordered set of features with causal relationships.
[0026] (2) Event: refers to the event of the target behavior. The event chain is a set of events with temporal or causal relationships.
[0027] (3) Graph: is a data structure used to store many-to-many relationships.
[0028] (4) Cache: refers to the structure used to store previously searched results, which is used to speed up the search.
[0029] (5) BFS: Breadth-first search, a search algorithm for acyclic graphs.
[0030] (6) Search boundary: indicates the conditional boundary between the start and end of the search.
[0031] Figure 1 This is a flowchart of the event chain extraction method according to an embodiment of this disclosure. Figure 1 As shown, this disclosure provides an event chain extraction method, including: S101: Obtain the data to be detected.
[0032] The event chain extraction method of this disclosure is applied to electronic devices such as servers, which can acquire the data to be detected in real time or at regular intervals. The server can be a network attack detection engine, a network vulnerability detection engine, a network traffic detection device, or a server specifically designed for event chain extraction.
[0033] The data to be detected is a high-noise log, i.e., a completely unprocessed primary log. This data may contain events that have a temporal or causal relationship with one or more event chains (determined based on the target behavior). For example, a network attack detection engine can acquire real-time network runtime logs, detect and analyze attack behaviors within them, determine the events corresponding to the attack behaviors, and then extract the corresponding event chain (which is an attack chain) based on the detected events. The data to be detected can also be network traffic logs acquired by network traffic detection devices, etc., and its specific type is not specifically limited in this disclosure.
[0034] S102: Input the data to be detected into a preset graph detection model; wherein the graph detection model includes multiple behavioral units, and the behavioral units are determined according to preset event detection behavioral rules.
[0035] In this step, the series of behavioral rules corresponding to event detection can be pre-divided into multiple independent behavioral units. There are certain temporal or causal relationships between each behavioral unit. Then, a graph detection model is constructed based on multiple behavioral units. Each node in the graph detection model represents the aforementioned behavioral units, and the nodes are interconnected to represent the relationships between the behavioral units. After that, the data to be detected is input into the constructed graph detection model, and the data to be detected is analyzed based on the behavioral units with relationships in the graph detection model.
[0036] S103: Whenever the graph detection model outputs a target event that the data to be detected has been hit, the target event is recorded in the target index node of a preset index linked list to generate a target event chain corresponding to the data to be detected; wherein, each node in the index linked list corresponds to an event chain, and the target index node corresponds to the target event chain.
[0037] When the target event is matched by the data to be detected, the corresponding target event is determined to be detected from the data to be detected. At this time, the target event is recorded in the target index node of the preset index linked list. This process is repeated until all the data to be detected has been detected. The preset index linked list has already given the chaining rules of the target event chain based on the target index node. Therefore, in this real-time example, after all the data to be detected has been detected, there is no need to consider how the event chain is formed. Based on the target index node that records the target event, the target event chain corresponding to the data to be detected can be quickly generated.
[0038] The event chain extraction method provided in this disclosure, when generating an event chain associated with the data to be detected, inputs the data to be detected into a preset graph detection model. Then, whenever the graph detection model outputs a target event matched by the data to be detected, the target event is recorded in the target index node of a preset index linked list to generate the target event chain corresponding to the data to be detected. This disclosure utilizes the interconnected nature of multiple nodes in a graph algorithm to establish a graph detection model, improving the efficiency of event querying on the event chain. It uses an index linked list to solve the problem of event chain formation, eliminating the need for numerous if-else statements and repetitive redundant code, resulting in higher event chain extraction efficiency.
[0039] In some embodiments, such as Figure 2 As shown, the steps for constructing the graph detection model include: S201: Generate a detection graph according to preset event detection behavior rules, wherein the detection graph includes graph nodes and edges between adjacent graph nodes; the graph nodes are used to record information of the behavior units generated by the behavior rules; the edges are used to record the association relationships between adjacent behavior units; S202: Generate a start boundary array and an end boundary array based on the detection map, wherein the start boundary array is used to store the start behavior unit corresponding to the start event representing the start behavior of the event, and the end boundary array is used to store the termination behavior unit corresponding to the termination event representing the termination behavior of the event. S203: The graph detection model is obtained based on the detection graph, the start boundary array, and the end boundary array.
[0040] When constructing a graph detection model, each behavioral unit, which is split according to behavioral rules, is stored in the form of graph nodes. That is, each graph node represents a behavioral unit, and the edges between adjacent graph nodes represent the association between adjacent behavioral units. Based on this, a detection graph for detecting events can be constructed.
[0041] In practice, behavior rules for event detection can be constructed using YAML statements. These rules can then be broken down into multiple behavior units, and a detection graph can be generated based on the relationships between these units. YAML is a highly readable format for expressing data serialization. By using convenient YAML statements, highly readable and maintainable behavior rules for event detection can be constructed. Specifically, YAML statements operate on a unit-by-unit basis, reserving storage space within each unit to indicate its relationships with other units, thus facilitating the determination of the positions of graph nodes.
[0042] Optionally, when determining edges based on the association between adjacent behavioral units, a certain weight can be set for each edge according to YAML rules, representing the probability of the next behavioral unit occurring after a certain behavioral unit occurs.
[0043] The constructed detection graph is a directed complete graph, ensuring that the entire graph can be traversed starting from any node, thus guaranteeing comprehensive and accurate event detection. However, paths in a directed complete graph may form cycles, causing the event chain corresponding to an event to never end, and making it impossible to define which behavior marks the beginning or end of the event chain; that is, the starting and ending behaviors of the event chain cannot be clearly described. Therefore, in this embodiment, after generating the detection graph, a start boundary array and an end boundary array are generated based on the detection graph to describe the starting and ending behaviors of the event chain, respectively. After generating the start and end boundary arrays based on the detection graph, a complete graph detection model can be obtained by combining the detection graph.
[0044] After the graph detection model is constructed through steps S201 to S203, the acquired data to be detected is input into the graph detection model. The graph detection model performs detection and analysis on the data to be detected based on the preset graph nodes (including the graph nodes in the detection graph, the nodes in the start boundary array, and the nodes in the end boundary array) and the relationships between the graph nodes. If a target event is detected from the data to be detected, it is determined that the data to be detected has hit the target event. Then, the corresponding event chain is extracted based on the hit target event.
[0045] When a target event detected in the data to be detected hits a node in the start boundary array, the behavior corresponding to that node is determined to be the starting behavior of the target event, and that node is the starting node of the event chain, that is, a new event chain record is started; when a target event detected in the data to be detected hits a node in the end boundary array, the event chain record associated with that target event is determined to be terminated, and that node is the ending node of the event chain.
[0046] When a graph detection model detects data, it extracts key features from the data and compares them with the graph nodes and their relationships within the model to detect the corresponding target events. After constructing the graph detection model through steps S201 to S203, the model is validated. If the validation is successful, the model is considered the final graph detection model. If the validation fails, the event detection rules are redefined, and a new graph detection model is generated based on these rules to obtain a more accurate and dynamically adjusted model.
[0047] In some embodiments, such as Figure 3 As shown, in step S103, the graph detection model outputs the target event hit by the data to be detected, including: S301: Check if there is a target index node in the current index chain that is associated with the data to be detected; S302: If it does not exist, then search for the target starting behavior unit that the data to be detected hits in the starting boundary array, determine the starting event corresponding to the target starting behavior unit as the target event and output it; S303: If it exists, find the target event that the data to be detected hits in the detection graph and output it. If the target event cannot be found in the detection graph, find the target termination behavior unit that the data to be detected hits in the end boundary array, determine the termination event corresponding to the target termination behavior unit as the target event and output it.
[0048] The indexed list serves as an index for the event chain, with each index node corresponding to an event chain. In this embodiment, the index node is the head node of the event chain, recording the general detection features (classification features) of the event chain to facilitate subsequent event detection and classification. Other nodes in the event chain only record the behavioral features of the event, not the classification features, to reduce the use of numerous if-else statements and repetitive redundant code, reduce data storage space, and improve the efficiency of event chain extraction.
[0049] When the data to be detected is input into the graph detection model, the system first checks whether there is a target index node associated with the data to be detected in the current index chain. If not, it determines that the event chain corresponding to the data to be detected is a new event chain that appears for the first time. At this time, it searches for the target starting behavior unit that the data to be detected hits in the starting boundary array. If the corresponding target starting behavior unit is found, it is determined that there is a behavior unit corresponding to the head node of the event chain. At this time, the starting event corresponding to the target starting behavior unit can be determined as the target event and output to generate a new event chain based on the starting event. If a target index node associated with the data to be detected exists in the current index chain, the event chain corresponding to the data to be detected is determined to be a previously occurring event chain. At this time, the target event that the data to be detected hits is searched in the detection graph. If the target event is found in the detection graph, it is output, and the specific behavioral characteristics of the target event are recorded in the behavior unit corresponding to the target event. If the target event is not found in the detection graph, it is determined that there is no event-associated behavior unit. The target termination behavior unit that the data to be detected hits is searched in the end boundary array. If it is found, the termination event corresponding to the target termination behavior unit is determined as the target event and output, indicating that the target event chain ends after the termination event. Based on the termination event, the target event chain corresponding to the data to be detected is determined from the preset event chain list, and the target event chain is disconnected from the event chain list to realize the extraction of the target event chain.
[0050] If no target termination behavior unit is found in the end boundary array, it is determined that there is no target event associated with the event chain in the data to be detected. At this time, steps S301 to S303 can be repeated to re-detect the data to be detected until the target event is detected. If the target event is still not detected after multiple detections, it is determined that there is no target event associated with the target event chain in the data to be detected.
[0051] Through S301 to S303 above, the graph detection model first searches for the target index node associated with the data to be detected from the index linked list, and then searches for the corresponding target event from the start boundary array, the detection graph, or the end boundary array and outputs it. When querying using the target index node in the index linked list, since each target index node represents an event chain, the time complexity of the query is O(n), where n is the number of nodes. There is no need to directly traverse the detection graph to search, which can greatly improve the event detection efficiency and determine the position of the target event in the target event chain.
[0052] In some embodiments, the method further includes: S401: When the target event is the starting event, the starting event is recorded as the head node of the target event chain in the free node of the index chain, and the free node is determined as the target index node; S402: When the target event is the termination event, the termination event is linked as the tail node of the target event chain to the tail of the event chain currently recorded by the target index node to obtain the target event chain.
[0053] When the target event determined in step S302 is the starting event, this starting event can be recorded as the head node of the target event chain in an idle node of the index linked list and designated as the target index node. This facilitates the judgment during the detection of other data to be detected and improves the efficiency of subsequent target event detection. For example, when the next data to be detected is associated with this target index node, it can be determined that the target event in the next data to be detected is not the starting event of the event chain. The target event matched by the next data to be detected can be directly found from the detection graph and output.
[0054] When the target event determined by step S302 is a termination event, the termination event is linked as the tail node of the target event chain to the tail of the event chain currently recorded by the target index node to obtain the target event chain, thereby completing the extraction of the event chain.
[0055] In this embodiment, the tail node pointer of the event chain can be recorded in an index linked list. This facilitates updating the detection hit information of the data to be detected (including target events found in the detection graph, target events found in the start boundary array, and end boundary array) based on the tail node pointer after obtaining the target event chain, thereby updating the index linked list and the event chain. Updating the index linked list includes adding and deleting target nodes in the index linked list, and updating the event chain includes adding and deleting events in the event chain, as well as adding and deleting events in the event chain. During the update, since the query is limited to the tail node pointer, the time complexity of the query is O(n), which is significantly improved compared to the query of the detection graph, such as in the case of a BFS query, where the time complexity is O(n^2). Furthermore, in this embodiment, the chaining problem of the event chain can be solved simply by maintaining the aforementioned index linked list.
[0056] In some embodiments, step S303, finding the target event that the data to be detected matches from the detection map, includes: S3031: Based on the event information of the last node in the event chain currently recorded by the target index node, find the target behavior unit associated with the last node in the detection graph; S3032: The event corresponding to the target behavior unit is determined as the target event.
[0057] Since different events in the event chain have certain relationships, when searching for the target event that the data to be detected hits in the detection graph, the event information of the last node in the event chain currently recorded by the target index node can be used as the starting point for searching the data to be detected in the detection graph. The next node (next event) of the last node (last event) that has been detected can be found as the target event. In this way, it is not necessary to start the search from the beginning event of the event chain, which can reduce the time complexity of the query. In the worst case, the entire detection graph is traversed starting from the last node. In this way, the related events can be linked into the corresponding event chains in sequence according to the last node in the event chain currently recorded by the target index node, so as to obtain the complete event chain.
[0058] In some embodiments, such as Figure 4 As shown, in step S3031, the step of searching for the target behavior unit associated with the last node from the detection graph includes: S501: Obtain a list of associated nodes matched by the last node; the list of associated nodes is used to record the next associated node in the detection graph that is associated with the last node and has been hit before; S502: Search the list of associated nodes to be detected for the associated nodes that match the data to be detected; S503: If an associated node is found that matches the data to be detected, the behavioral unit corresponding to the highest priority associated node is determined as the target behavioral unit. S504: If no associated node is found that matches the data to be detected, then traverse other graph nodes that are not currently recorded in the associated node list of the detection graph, and determine the behavioral unit that matches the data to be detected as the target behavioral unit.
[0059] In this step, a list of associated nodes can be pre-set, recording nodes that have been previously searched. When searching for the next node of the last node, the search prioritizes looking for the next associated node in the aforementioned list. If multiple associated nodes are found, the behavior unit corresponding to the highest-priority associated node can be identified as the target behavior unit, and then the target event can be determined based on this target behavior unit. The priority of associated nodes can be determined based on the execution order and frequency of the behavior units corresponding to the associated nodes. Each associated node in the list can be stored in the form of a next array. If no multiple associated nodes are found, other graph nodes not currently recorded in the associated node list of the detection graph are traversed to detect the target event, thus increasing the detection efficiency of the data to be detected.
[0060] In some embodiments, the method further includes: S601: If a target behavior unit is found in the list of associated nodes, the priority weight of the associated node corresponding to the target behavior unit is increased by a preset value; S602: If a target behavior unit is found from the other graph nodes, the graph node corresponding to the target behavior unit is recorded in the associated node list.
[0061] After finding the target behavior unit from the associated node list in step S503, it can be determined that the target behavior unit has a high priority. The priority weight of its corresponding associated node is increased by a preset value, and the associated nodes in the associated node list are reordered according to the increased priority weight. This continuously adjusts the associated node list, improving the accuracy and efficiency of the event chain. If the target behavior unit is found from other graph nodes in step S504, the graph node corresponding to the target behavior unit can be recorded in the associated node list, and a certain priority weight can be set for that graph node. The associated node list is then sorted and updated according to this priority weight.
[0062] The event chain extraction method provided in this disclosure is applicable to detection scenarios involving multiple behavioral rules, multiple temporal relationships, and multiple causal relationships in the data to be detected. It can extract event chains from massive amounts of log information and data to be detected. Furthermore, based on the characteristics of graph algorithms and the weights of graph nodes and edges, it can also be applied to detection scenarios involving multiple condition matching for filtering and detection of data to be detected, thus having a wide range of applications.
[0063] Figure 5 This is a schematic diagram of an event chain extraction device according to an embodiment of this disclosure. Figure 5 As shown, based on the above-described event chain extraction method, this disclosure also provides an event chain extraction apparatus, comprising: Module 10 is configured to acquire data to be detected. The input module 20 is configured to input the data to be detected into a preset graph detection model; the graph detection model includes multiple behavioral units, which are determined according to preset event detection behavioral rules; The recording module 30 is configured to record the target event into the target index node of a preset index linked list whenever the graph detection model outputs a target event that the data to be detected is hit, so as to generate a target event chain corresponding to the data to be detected; each node in the index linked list corresponds to an event chain, and the target index node corresponds to the target event chain.
[0064] In some embodiments, the event chain extraction apparatus further includes a graph detection model construction module, configured as follows: A detection graph is generated based on preset event detection behavior rules. The detection graph includes graph nodes and edges between adjacent graph nodes. The graph nodes are used to record information about the behavior units generated by the behavior rules. The edges are used to record the association relationships between adjacent behavior units. Based on the detection map, a start boundary array and an end boundary array are generated, wherein the start boundary array is used to store the start behavior unit corresponding to the start event representing the start behavior of the event, and the end boundary array is used to store the termination behavior unit corresponding to the termination event representing the termination behavior of the event. The graph detection model is obtained based on the detection graph, the start boundary array, and the end boundary array.
[0065] In some embodiments, the graph detection model outputs the target event hit by the data to be detected, including: Check if a target index node associated with the data to be detected exists in the current index chain; If it does not exist, then search for the target starting behavior unit that the data to be detected hits in the starting boundary array, determine the starting event corresponding to the target starting behavior unit as the target event and output it; If it exists, the target event that the data to be detected hits is found in the detection graph and output. If the target event is not found in the detection graph, the target termination behavior unit that the data to be detected hits is found in the end boundary array, and the termination event corresponding to the target termination behavior unit is determined as the target event and output.
[0066] In some embodiments, the recording module 30 is further configured to: When the target event is the starting event, the starting event is recorded as the head node of the target event chain in the free node of the index chain, and the free node is determined as the target index node; When the target event is the termination event, the termination event is linked as the tail node of the target event chain to the tail of the event chain currently recorded by the target index node, thus obtaining the target event chain.
[0067] In some embodiments, finding the target event that the data to be detected matches from the detection graph includes: Based on the event information of the last node in the event chain currently recorded by the target index node, the target behavior unit associated with the last node is found in the detection graph; The event corresponding to the target behavior unit is identified as the target event.
[0068] In some embodiments, finding the target behavior unit associated with the last node from the detection graph includes: Obtain a list of associated nodes that match the last node; the list of associated nodes is used to record the next associated node in the detection graph that is associated with the last node and has been hit before; Search the list of associated nodes for the data to be detected to match the associated nodes; If an associated node is found that matches the data to be detected, the behavioral unit corresponding to the highest priority associated node is determined as the target behavioral unit. If no associated node is found that matches the data to be detected, then other graph nodes that are not currently recorded in the associated node list of the detection graph are traversed, and the behavioral units that match the data to be detected are determined as the target behavioral units.
[0069] In some embodiments, the recording module 30 is further configured to: If a target behavior unit is found in the list of associated nodes, the priority weight of the associated node corresponding to the target behavior unit is increased by a preset value. If a target behavior unit is found among the other graph nodes, the graph node corresponding to the target behavior unit is recorded in the associated node list.
[0070] It should be noted that the event chain extraction device provided in this disclosure corresponds to the event chain extraction method in the above embodiments. Based on the above event chain extraction method, those skilled in the art can understand the specific implementation of the event chain extraction device in this disclosure and its various variations. Any option in the event chain extraction method embodiments is also applicable to the event chain extraction device, and will not be described again here.
[0071] This disclosure also provides an electronic device, including at least a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the event chain extraction method described above when executing the computer program in the memory.
[0072] In some embodiments, the processor executing the computer program may be a processing device that includes one or more general-purpose processing devices, such as a microprocessor, a central processing unit (CPU), a graphics processing unit (GPU), etc. More specifically, the processor may be a complex instruction set computing (CISC) microprocessor, a reduced instruction set computing (RISC) microprocessor, a very long instruction word (VLIW) microprocessor, a processor that runs other instruction sets, or a processor that runs a combination of instruction sets. The processor may also be one or more special-purpose processing devices, such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), system-on-a-chip (SoCs), etc.
[0073] The memory may be a read-only memory (ROM), random access memory (RAM), phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), electrically erasable programmable read-only memory (EEPROM), other types of random access memory (RAM), flash drives or other forms of flash memory, cache, registers, static memory, optical disc read-only memory (CD-ROM), digital versatile optical disc (DVD) or other optical storage, magnetic tape cassette or other magnetic storage devices, or any other possible non-transitory medium used to store information or instructions that can be accessed by computer equipment.
[0074] Those skilled in the art will understand that electronic devices may include more or fewer components, for example, they may also include communication interfaces, or combine certain components, or have different component arrangements.
[0075] The electronic devices disclosed herein may include, but are not limited to, fixed terminal devices such as servers, desktop computers, and digital TVs, as well as mobile terminal devices such as in-vehicle devices (e.g., HUD devices), handheld devices (e.g., mobile phones, tablets), and wearable devices (e.g., smartwatches, smart bracelets). In specific implementations, the electronic devices are preferably network attack detection engines, network vulnerability detection engines, network traffic detection devices, etc.
[0076] This disclosure also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the event chain extraction method described above.
[0077] The computer-readable storage medium of this disclosure can be any combination of one or more computer-readable media. The computer-readable storage medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. In this disclosure, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device; for example, it can be the memory described above.
[0078] The computer programs of embodiments of this disclosure can be organized into one or more computer-executable components or modules. Various aspects of this disclosure can be implemented with any number and combination of such components or modules. For example, aspects of this disclosure are not limited to the specific computer-executable instructions or particular components or modules shown in the drawings and described herein. Other embodiments may include different computer-executable instructions or components having more or fewer functions than those shown and described herein.
[0079] The above embodiments are merely exemplary embodiments of this disclosure and are not intended to limit this disclosure. The scope of protection of this disclosure is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to this disclosure within its substance and scope, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of this disclosure.
Claims
1. A method for extracting event chains, characterized in that, include: Acquire the data to be tested; The data to be detected is input into a preset graph detection model; The graph detection model includes multiple behavioral units, which are determined according to preset event detection behavior rules. Whenever the graph detection model outputs a target event that the data to be detected has been hit, the target event is recorded in the target index node of a preset index linked list to generate the target event chain corresponding to the data to be detected; Each node in the index list corresponds to an event chain, and the target index node corresponds to the target event chain. The steps for constructing the graph detection model include: A detection graph is generated based on preset event detection behavior rules. The detection graph includes graph nodes and edges between adjacent graph nodes. The graph nodes are used to record information about the behavior units generated by the behavior rules. The edges are used to record the association relationships between adjacent behavior units. Based on the detection map, a start boundary array and an end boundary array are generated, wherein the start boundary array is used to store the start behavior unit corresponding to the start event representing the start behavior of the event, and the end boundary array is used to store the termination behavior unit corresponding to the termination event representing the termination behavior of the event. The graph detection model is obtained based on the detection graph, the start boundary array, and the end boundary array.
2. The method according to claim 1, characterized in that, The graph detection model outputs the target events that the data to be detected hits, including: Check if a target index node associated with the data to be detected exists in the current index chain; If it does not exist, then search for the target starting behavior unit that the data to be detected hits in the starting boundary array, determine the starting event corresponding to the target starting behavior unit as the target event and output it; If it exists, the target event that the data to be detected hits is found in the detection graph and output. If the target event is not found in the detection graph, the target termination behavior unit that the data to be detected hits is found in the end boundary array, and the termination event corresponding to the target termination behavior unit is determined as the target event and output.
3. The method according to claim 2, characterized in that, When the target event is the starting event, the starting event is recorded as the head node of the target event chain in the free node of the index chain, and the free node is determined as the target index node; When the target event is the termination event, the termination event is linked as the tail node of the target event chain to the tail of the event chain currently recorded by the target index node, thus obtaining the target event chain.
4. The method according to claim 2, characterized in that, The step of finding the target event that the data to be detected matches from the detection map includes: Based on the event information of the last node in the event chain currently recorded by the target index node, the target behavior unit associated with the last node is found in the detection graph; The event corresponding to the target behavior unit is identified as the target event.
5. The method according to claim 4, characterized in that, The step of finding the target behavior unit associated with the last node from the detection graph includes: Obtain a list of associated nodes that match the last node; the list of associated nodes is used to record the next associated node in the detection graph that is associated with the last node and has been hit before; Search the list of associated nodes for the data to be detected to match the associated nodes; If an associated node is found that matches the data to be detected, the behavioral unit corresponding to the highest priority associated node is determined as the target behavioral unit. If no associated node is found that matches the data to be detected, then other graph nodes that are not currently recorded in the associated node list of the detection graph are traversed, and the behavioral units that match the data to be detected are determined as the target behavioral units.
6. The method according to claim 5, characterized in that, The method further includes: If a target behavior unit is found in the list of associated nodes, the priority weight of the associated node corresponding to the target behavior unit is increased by a preset value. If a target behavior unit is found among the other graph nodes, the graph node corresponding to the target behavior unit is recorded in the associated node list.
7. An event chain extraction device, characterized in that, include: The acquisition module is configured to acquire the data to be detected. The input module is configured to input the data to be detected into a preset graph detection model; The graph detection model includes multiple behavioral units, which are determined according to preset event detection behavior rules. The recording module is configured to record the target event into the target index node of a preset index list whenever the graph detection model outputs a target event that the data to be detected hits, so as to generate a target event chain corresponding to the data to be detected. Each node in the index list corresponds to an event chain, and the target index node corresponds to the target event chain. The event chain extraction device further includes a graph detection model construction module, configured as follows: A detection graph is generated based on preset event detection behavior rules. The detection graph includes graph nodes and edges between adjacent graph nodes. The graph nodes are used to record information about the behavior units generated by the behavior rules. The edges are used to record the association relationships between adjacent behavior units. Based on the detection map, a start boundary array and an end boundary array are generated, wherein the start boundary array is used to store the start behavior unit corresponding to the start event representing the start behavior of the event, and the end boundary array is used to store the termination behavior unit corresponding to the termination event representing the termination behavior of the event. The graph detection model is obtained based on the detection graph, the start boundary array, and the end boundary array.
8. An electronic device, characterized in that, It includes at least a memory and a processor, wherein the memory stores a computer program, and the processor, when executing the computer program in the memory, implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Event data processing
CA3243907A1
Graph database analysis for network anomaly detection systems
EP3291120A1
