Event detection method and system
By adopting a multi-model fusion event detection method in the situational awareness system, the majority voting method determines the prediction results and trust of security events, the problems of slow processing speed and low accuracy caused by manual intervention in the prior art are solved, and the problem of improved The efficiency and accuracy of event detection.
Patent Information
- Application Number
- CN202411057216.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-11-05
AI Technical Summary
Existing situational awareness systems rely on manual intervention when handling security events, resulting in slow processing speed and low accuracy, and being unable to effectively handle complex network security events.
Using the event detection method based on multi-model fusion, by obtaining pending security events, multiple related security logs are matched from the pre-stored log set, and each security log is input to multiple different machine learning models, and the majority voting method is determined. Predict results and trust, and improve the speed and accuracy of event detection.
It improves the speed and accuracy of security incident detection, reduces manual workload, can assist security operation personnel in conducting alarm analysis, and prioritizes the trust sequence output by the model.
Smart Images

Figure CN118900197A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network security, and in particular to an event detection method, system, device and medium based on multi-model fusion. Background Art
[0002] Existing situational awareness systems generate alarm events by analyzing log data, and continuously adjust and aggregate these logs based on predefined business rules to improve processing efficiency and reduce the workload of operators in event analysis and disposal. However, in-depth analysis and judgment of alarm events still rely on manual intervention by operators or security experts, and the means of such intervention include applying business rules and analyzing attack characteristics.
[0003] At present, after a new alarm occurs, the IP source is usually traced first. Generally, there are only three situations: external network IP attacks internal network IP, internal network IP attacks internal network IP, and internal network IP maliciously accesses external network IP: 1) If the source IP is an external network IP, it is necessary to manually check whether the IP is owned by itself. When the source IP is not an IP address owned by itself, it is usually judged that the external network IP is trying to attack the internal network, and it is necessary to consider blocking; 2) When the source IP belongs to an IP owned by itself, manual analysis is required. The usual processing method is: notify the responsible department of the source IP to confirm the operation, and select the original log on the corresponding alarm device according to the data source for manual analysis; 3) If the destination IP is an internal network IP, it is also necessary to confirm the current status and asset attributes of the IP. If necessary, it is necessary to log in to the alarm device platform to view the attack characteristics of its original data packet for analysis. However, this method requires manual inspection when handling security incidents, resulting in low processing speed and poor accuracy. Therefore, it is necessary to provide an event detection method, system, device and medium based on multi-model fusion. Summary of the invention
[0004] The present invention provides an event detection method based on multi-model fusion, which improves the problem of low efficiency in processing security events in the prior art.
[0005] The present invention provides an event detection method based on multi-model fusion, including: obtaining a security event to be processed; matching multiple security logs from a pre-stored log set according to the security event; inputting each security log into a preset number of different machine learning models to obtain a sub-prediction result corresponding to each security log in each machine learning model; wherein the preset number is an odd number greater than or equal to three, and the machine learning model is a binary classification model for processing security logs; and determining the prediction result and trustworthiness of the security event based on the majority voting method according to the sub-prediction results corresponding to each security log in each machine learning model.
[0006] In one embodiment of the present invention, the security event includes a source IP, a destination IP and an event occurrence time, and the method of matching multiple security logs from a pre-stored log set based on the security event includes: determining a screening period based on the event occurrence time in the security event and a preset screening time length; screening multiple security logs from a pre-stored log set based on the source IP, the destination IP and the screening period in the security event; and sorting data of all screened security logs to obtain multiple security logs that match the security event.
[0007] In one embodiment of the present invention, the security event has an identifier that matches the security log, and the method of matching multiple security logs from a pre-stored log set based on the security event includes: filtering out all security logs that match the identifier in the security event from the pre-stored log set; and sorting out data of all the filtered security logs to obtain multiple security logs that match the security event.
[0008] In one embodiment of the present invention, data sorting is performed on all the screened security logs to obtain multiple security logs that match the security event, including: data cleaning of all the screened security logs; feature engineering processing of all the cleaned security logs; standardization and normalization of all the security logs after feature engineering processing to obtain multiple security logs that match the security event.
[0009] In one embodiment of the present invention, the machine learning models are an XGBoost model, a Bi-LSTM model, and a TimesNet model. The security log is respectively input into a preset number of different machine learning models to obtain sub-prediction results of the security log corresponding to each machine learning model, including: inputting the security log into the XGBoost model to capture the feature information in the security log to obtain the sub-prediction results of the security log; inputting the security log into the Bi-LSTM model to capture the time series relationship in the security log based on the long and short-term memory capabilities to obtain the sub-prediction results of the security log; inputting the security log into the TimesNet model to obtain the sub-prediction results of the security log based on the time information and periodic change information in the security log.
[0010] In one embodiment of the present invention, the prediction result and the trust level of the security incident are determined based on the majority voting method according to the sub-prediction results corresponding to each security log in each machine learning model, including: for each security log: determining the prediction result of the security log based on the majority voting method from the sub-prediction results provided by each machine learning model; determining the trust level of the security log according to the proportion of the number of sub-prediction results with consistent predictions to the total number of votes of all machine learning models; determining the prediction result and the trust level of the security incident based on the prediction results and corresponding trust levels of each security log.
[0011] In one embodiment of the present invention, the prediction result and trust of the security event are determined based on the prediction result and the corresponding trust of each security log, including: counting the prediction result of each security log to obtain a prediction result set; wherein the prediction result includes real intrusions and business false alarms; judging whether the total amount of business false alarms in the prediction result set is greater than the total amount of real intrusions: if so, taking the business false alarm as the prediction result of the security event, and determining the trust of the security event based on the trust of the security logs corresponding to all the business false alarms; otherwise, taking the real intrusion as the prediction result of the security event, and determining the trust of the security event based on the trust of the security logs corresponding to all the real intrusions.
[0012] In one embodiment of the present invention, the prediction result and trust of the security incident are determined based on the majority voting method according to the sub-prediction results corresponding to each security log in each machine learning model, including: for all security logs processed by each machine learning model: counting the sub-prediction results of all security logs in the model to form a prediction result set; wherein the prediction results include real intrusions and business false alarms; judging whether the total amount of business false alarms in the prediction result set is greater than the total amount of real intrusions: if so, taking the business false alarms as the prediction results of all security logs in the machine learning model, and determining the trust of all security logs in the machine learning model based on the proportion of the total amount of business false alarms to the total amount of prediction results; otherwise, taking the real intrusion as the prediction result of all logs in the machine learning model, and determining the trust of all security logs in the machine learning model based on the proportion of the total amount of real intrusions to the total amount of prediction results; determining the trust of the security incident based on the prediction results and trust of all security logs in each machine learning model.
[0013] In one embodiment of the present invention, the trust level of the security incident is determined based on the prediction results and trust levels of all security logs in each machine learning model, including: determining the prediction result of the security incident based on the majority voting method from the prediction results of all security logs in each machine learning model; and determining the trust level of the security incident based on the trust level of the machine learning model that is consistent with the prediction result of the security incident.
[0014] In one embodiment of the present invention, an event detection system based on multi-model fusion is also provided, and the system includes: a data acquisition module, used to obtain security events to be processed; a security log matching module, used to match multiple security logs from a pre-stored log set according to the security events; a model prediction module, used to input each security log into a preset number of different machine learning models, and obtain a sub-prediction result corresponding to each security log in each machine learning model; wherein the preset number is an odd number greater than or equal to three, and the machine learning model is a binary classification model for processing security logs; a detection module, used to determine the prediction result and trust of the security event based on the majority voting method according to the sub-prediction results corresponding to each security log in each machine learning model.
[0015] In one embodiment of the present invention, an electronic device is also provided, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements any of the above-mentioned event detection methods based on multi-model fusion.
[0016] In one embodiment of the present invention, a computer-readable storage medium is also provided, on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes any of the event detection methods based on multi-model fusion described above.
[0017] The present invention proposes an event detection method, system, device and medium based on multi-model fusion. By obtaining the security event to be processed, matching multiple related security logs from the pre-stored log set, and inputting each security log into multiple different machine learning models, the prediction result and trust are determined in combination with the majority voting method. The advantages of multi-model integration are utilized to improve the speed and accuracy of security event detection, and it can be applied to various complex network security environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A schematic diagram of a flow chart of an event detection method based on multi-model fusion provided in an embodiment of the present invention;
[0019] Figure 2 Shown is a schematic diagram of a traditional event detection process;
[0020] Figure 3 Shown is a schematic diagram of the process of event detection of the present invention;
[0021] Figure 4 Shown is a schematic diagram of the process of event detection and trust calculation in one embodiment of the present invention;
[0022] Figure 5 Shown is a schematic diagram of the event detection and trust calculation process in another embodiment of the present invention;
[0023] Figure 6 Shown is a structural block diagram of an event detection system based on multi-model fusion provided by an embodiment of the present invention;
[0024] Figure 7 Shown is a structural schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0026] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0027] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0028] The inventors found that if Figure 2As shown in the figure, the security logs collected by the existing security devices are selected by the rule template engine. Here, normalization refers to selecting a set of the same field templates for matching different security device logs, filtering out fields that do not need subsequent analysis. The normalized data is compressed by the situation awareness aggregation model, and the fields of interest are extracted and displayed to the operation personnel. The rule parsing and association analysis here are mainly automated aggregation according to manually defined rules such as homologous IP attack and heterologous IP attack by analyzing the source IP, destination IP, attack category, and alarm level. Compared with the original log data volume, the event data volume is significantly reduced. The operation personnel analyze the events displayed by the situation awareness system to determine whether the events are business false alarms or real intrusions. After labeling, they are issued and handled to complete the event analysis process. However, this manual event analysis method obviously has low processing speed and accuracy when processing massive events, resulting in a slow processing process and affecting the progress of subsequent work.
[0029] The present invention provides an event detection method based on multi-model fusion, which is applied to the situational awareness system. By obtaining the security events to be processed, a plurality of related security logs are matched from the pre-stored log set, and each security log is input into a plurality of different machine learning models, and the prediction result and trust are determined in combination with the majority voting method. It takes advantage of the integration of multiple models, improves the speed and accuracy of event detection, and is suitable for various complex network security environments. It can assist security operators in alarm analysis and judgment. When there are many events, AI models can be used for analysis and judgment, and then manual verification can be performed to reduce manual workload and improve the efficiency of event analysis. In addition, the event detection results output by the model also have corresponding trust scores, so that operators can prioritize events with higher trust according to the event scores given by the model. Figure 3 As shown in the figure, the present invention has improved the original process in the following aspects: for the historical labeling operation of the operator, the original log is matched according to the source IP and destination IP of the event aggregation, and the event label of the operator is added. The model is trained and predicted based on the log data and outputs the results to assist the operator in analysis and judgment. This greatly improves the detection speed and accuracy of the event.
[0030] The following are explanations of the various names involved in this application:
[0031] Situational Awareness System: Here, the Security Operation Situational Awareness System (Situational Awareness System for short) is a comprehensive platform for monitoring, analyzing and responding to network security incidents. It integrates various security data sources and helps the security team understand the security situation of the current network environment, identify potential threats, and take timely countermeasures through real-time data collection, analysis and visualization.
[0032] Machine Learning: Machine learning is a multi-disciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, etc. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance.
[0033] Deep learning: Deep learning is a new research direction in the field of machine learning. It is introduced into machine learning to make it closer to its original goal - artificial intelligence.
[0034] Confidence: The confidence of the model in the event prediction is mapped to a numerical value, ranging from 0 to 100. In classification detection problems, confidence refers to how likely the model believes an event belongs to a certain category. A high confidence level indicates that the event is more likely to belong to a certain category.
[0035] Logs: The logs mentioned here refer to security logs, which are logs generated by security products, such as traffic probe logs, firewall logs, antivirus logs, terminal monitoring logs, etc.
[0036] Events: The events mentioned here refer to security events formed by rule-based aggregation of security logs. Compared with the numerous fields in the original logs, event security events can concisely present high-value alarm information combined with the business to operators, so as to conduct analysis, judgment and security disposal.
[0037] See also Figure 1 ,The event detection method based on multi-model fusion includes the following steps:
[0038] S1. Obtain the security events to be processed.
[0039] The security events to be processed are generated by the new security logs generated after the last detection according to the predefined event generation rules. Security events include but are not limited to malware interference, data leakage, unauthorized access, internal threats, fraud, etc. The situation awareness system can determine the acquisition method of the security log according to the current environmental requirements. Specifically, for environments that require real-time or near real-time processing responses, the situation awareness system will automatically detect and trigger the generation of security events according to the event generation rules when the log data is aggregated; for non-real-time analysis environments, the system can grab new security logs from the data storage regularly (such as once an hour or a day) at preset time intervals, and then generate corresponding security events according to the event generation rules for these security logs. Further, when obtaining the above security logs, the situation awareness system can determine the data range to be analyzed through the self-increment field (such as: self-increment primary key, storage time, etc.) to achieve accurate log information extraction. Exemplarily, the system determines which log entries are newly added by comparing the last processed primary key value and the maximum primary key value in the current database, and can also retrieve all new data that have been stored after the last data acquisition time point.
[0040] S2. According to the security event, multiple security logs are matched from a pre-stored log set.
[0041] Since the generation time of security events in the situation awareness system is relatively delayed compared to the generation time of security logs, if the security events are recorded with fields (such as alarm ID) when aggregating logs to trace the source logs, they can be directly associated; if the security events are not recorded with fields when aggregating logs to associate with upstream security product logs, the source IP, destination IP and security event generation time plus the forward time (such as the time difference between the maximum generated event and the original log, the fixed time difference, etc.) are used for association. Specifically, after obtaining the security event, the situation awareness system will extract the key features of the time for the subsequent log matching process. Key features include but are not limited to source IP, target IP, event occurrence time or related identifiers, etc. Using one or more of the above key features as search conditions, the corresponding security log is retrieved from the pre-stored log set. Among them, the log set stores log data from various systems and devices.
[0042] It should be noted that when obtaining security logs before aggregation based on associated fields, if security events are analyzed one by one, only the security logs associated with the security event are obtained here; if security events are obtained in batches, all security logs corresponding to the batch of security events are obtained.
[0043] Furthermore, since the amount of raw log data may be large, for example, security products may generate 20 million logs every day, the process of adding tag fields to security logs is mainly automated through the association rules between logs and events. When generating events, the situation awareness system will also filter out logs of low concern, such as logs with low risk levels and small number of attacks. Therefore, not all logs can be matched according to events to increase the results of attack analysis. Logs that are not matched will not undergo subsequent data processing and feature engineering.
[0044] In one embodiment of the present invention, the security event includes a source IP, a destination IP, and an event occurrence time, and the matching of multiple security logs from a pre-stored log set according to the security event includes:
[0045] Determine the screening period based on the time of occurrence of the security incident and the preset screening time;
[0046] Based on the source IP, the destination IP and the screening period in the security event, a plurality of security logs are screened out from a pre-stored log set;
[0047] All the screened security logs are sorted to obtain multiple security logs matching the security event.
[0048] According to the time of occurrence of the event in the security event and the preset screening time, the time period for screening security logs can be determined. Exemplarily, the time of occurrence of the event is 11:30PM, and the screening time is 20 minutes, then the corresponding screening period is 11:30PM to 11:50PM. According to the source IP and destination IP recorded in the security event, all security log records that are within this screening period and meet the source IP and destination IP are searched from the pre-stored log set. These security logs that are found are sorted, irrelevant information is filtered out, and only the log content directly related to the security event is retained to obtain multiple security logs that match the security event. Through this time and IP-based matching method, security logs related to specific security events can be screened out.
[0049] In another embodiment of the present invention, the security event has an identifier that matches the security log, and the matching of multiple security logs from a pre-stored log set according to the security event includes:
[0050] Filtering out all security logs matching the identifier in the security event from a pre-stored log set;
[0051] All the screened security logs are sorted to obtain multiple security logs matching the security event.
[0052] In the present embodiment, an identifier is used as a screening basis to accurately extract the corresponding security log from the log set, wherein the identifier includes but is not limited to a transaction ID, a session ID or a specific error code, etc., as long as it can clearly point to a specific event. All security logs with the same identifier are searched in the log set, and the searched security logs are sorted, irrelevant information is filtered out, and only the log content directly related to the security event is retained, so as to obtain a plurality of security logs that match the security event. Through this matching method based on the identifier, multiple log sources and time ranges can be spanned, which can be used for the analysis of complex events.
[0053] In one embodiment of the present invention, data of all the screened security logs are sorted to obtain multiple security logs matching the security event, including:
[0054] Perform data cleaning on all screened security logs;
[0055] Perform feature engineering on all cleaned security logs;
[0056] All security logs processed by feature engineering are standardized and normalized to obtain multiple security logs matching the security events.
[0057] Data cleaning is to eliminate noise and outliers in the original data, and fill in missing values. There are often various problems with the original data, such as errors, duplications, missing values, etc. If these problems are not dealt with, they will have a negative impact on subsequent modeling and analysis. The data preprocessing operations here include deleting useless values, filling missing values, replacing outliers, and converting data formats.
[0058] Feature engineering is to extract and construct more meaningful features to better represent the nature and characteristics of data. In practical applications, raw data often contains a lot of redundant and irrelevant information. Through feature engineering, these redundant and irrelevant information can be removed to extract more useful and effective features. Feature engineering processing includes 5 cases:
[0059] 1. Numerical features: This type of feature can be directly applied to the model. Numerical features include but are not limited to the number of alarms and the number of attacks.
[0060] 2. Features of ordered categories: If the categories have an ordered relationship, label encoding is performed, where the features of the ordered categories include but are not limited to threat level, alarm level, etc.
[0061] 3. Features of unordered categories: If the categories have no obvious order relationship and the number of categories is small (dozens to hundreds), one-hot encoding can be performed. Features of unordered categories include but are not limited to attack categories, request methods, etc.
[0062] 4. Features of text types: Natural language processing technology can be used for feature extraction. Natural language processing technology includes but is not limited to using word frequency statistics (TF-IDF, etc.), word embedding (Word2Vec, etc.), and topic models (LDA, etc.) to extract features from URL information and request body information.
[0063] 5. Business-related features: Special feature processing is required in combination with the business, such as extracting time fields to determine whether it is daytime working hours, nighttime off-get off work hours, working day time, non-working day time, etc.; such as combining blacklist and whitelist, threat intelligence and other information to determine whether the source IP or attack IP is on the list, etc.
[0064] After data processing and feature engineering, the raw data is converted into a high-dimensional vector. These high-dimensional vectors are then standardized and normalized. Standardization is an operation on high-dimensional vectors to convert the data into a distribution with a mean of 0 and a standard deviation of 1. Normalization refers to scaling the data to a fixed range, here between 0 and 1.
[0065] It should be noted that both standardization and normalization are performed on features, and here standardization and normalization are performed according to high-dimensional vector columns. The benefits of this step are: 1) Improve model performance: making the data on the same scale helps the algorithm converge and optimize better, thereby improving the performance of the model; 2) Accelerate the training process: Gradient descent algorithms converge faster on standardized and normalized data because these algorithms are very sensitive to the scale of features; 3) Improve the generalization ability of the model: reduce the model's excessive reliance on a few features with a large value range, and prevent overfitting of the model training. Through the above process, the standardized and normalized features of multiple security logs that match security events can be obtained.
[0066] S3. Input each security log into a preset number of different machine learning models to obtain a sub-prediction result corresponding to each security log in each machine learning model; wherein the preset number is an odd number greater than or equal to three, and the machine learning model is a binary classification model for processing security logs.
[0067] For each security log: the above-mentioned standardized and normalized features are input into different machine learning models, and each machine learning model will generate a sub-prediction result of the security log. Among them, the sub-prediction result is that the machine learning model predicts that the security log is a real intrusion or a business false alarm based on the standard and normalized features of the input security log. Since the present invention adopts a majority voting mechanism to determine the prediction results of security events based on the prediction results of all machine learning models, an odd number of binary classification models greater than or equal to three are required.
[0068] In one embodiment of the present invention, the machine learning models are XGBoost model, Bi-LSTM model and TimesNet model, and the security log is input into a preset number of different machine learning models respectively to obtain the sub-prediction results of the security log corresponding to each machine learning model, including:
[0069] Input the security log into the XGBoost model to capture the feature information in the security log and obtain the sub-prediction results of the security log;
[0070] The security log is input into the Bi-LSTM model, and the time series relationship in the security log is captured based on the long and short-term memory capabilities to obtain the sub-prediction results of the security log;
[0071] The security log is input into the TimesNet model, and the sub-prediction results of the security log are obtained based on the time information and periodic change information in the security log.
[0072] In the present invention, XGBoost model, Bi-LSTM model and TimesNet model are selected. These three trained models are used as machine learning models to capture and analyze log data according to their unique characteristics, thereby generating accurate sub-prediction results. For each security log, the standardized and normalized features of the security log are respectively input into the XGBoost model, the Bi-LSTM model and the TimesNet model to obtain three sub-prediction results. Specifically, the XGBoost model is a machine learning model that uses its powerful integrated learning ability to process classification and regression problems based on the gradient boosting method of the decision tree. By iteratively training multiple decision trees and combining the prediction results of these trees, XGBoost can capture the complex interactions and nonlinear relationships in the security log. Exemplarily, XGBoost extracts key features (such as IP address and access time) from the log, and analyzes the relationship between these features through multiple decision trees, predicting whether the security log belongs to a real intrusion or a business false alarm, as the sub-prediction result of the security log in the XGBoost model. When training the XGBoost model, the loss function uses logarithmic loss (Logtistic Loss), and the regularization uses L1 regularization for automatic selection of sparse features. It can be understood that for the classification detection task of the present invention, the decision tree of XGBoost is a classification tree.
[0073] Furthermore, the Bi-LSTM model uses its bidirectional long short-term memory network structure to capture the dependencies of time series data from two directions, thus providing a more comprehensive analysis perspective for sequence data. When processing security logs, the Bi-LSTM model uses two types of LSTM units, forward and reverse, to learn the time characteristics of log data from the beginning to the end of the sequence and from the end to the beginning, respectively, so as to predict whether the security log is a real intrusion or a business false alarm, as the sub-prediction result of the security log in the Bi-LSTM model. It should be noted that when constructing the Bi-LSTM model, the model can be better trained by stacking multiple layers of Bi-LSTM, setting the dropout ratio, and using the Adam optimizer. At the same time, for the classification detection task, the activation function is set to sigmoid in the last Dense layer (fully connected layer) of the neural network to output the binary classification detection results.
[0074] In addition, the TimesNet model uses deep learning and is designed to analyze data with obvious time changes and periodicity. It converts the one-dimensional time series into a two-dimensional tensor and maps the changes within and between cycles to the columns and rows of the 2D tensor respectively, so as to effectively model the time changes through the 2D convolution kernel. In this way, the periodic patterns and abnormal changes in the security log can be more accurately identified. By using the projection layer at the end of the neural network, the obtained feature vectors are mapped to different categories, so as to predict whether the security log is a real intrusion or a business false alarm, which is used as the sub-prediction result of the security log in the TimesNet model.
[0075] It is understandable that in addition to the above three models, other machine learning models (such as random forest, Informer, etc.) can also be selected. Technical personnel in this field can make adaptive choices based on actual needs, and no limitation is made here.
[0076] It should be noted that manual analysis and judgment of security incidents is actually the analysis of high-value security logs of concern. The fields used in manual analysis are basically the same as the fields used in model training. Therefore, using multiple models to identify and detect business false alarms is a reasonable and efficient way to handle incidents.
[0077] S4. According to the sub-prediction results corresponding to each security log in each machine learning model, the prediction result and trust level of the security event are determined based on the majority voting method.
[0078] Each machine learning model independently analyzes each security log to obtain the sub-prediction result corresponding to the security log. For each security log, based on the majority voting method, the sub-prediction results of the security log in each model are voted to determine the prediction result of the security log. After all security logs are processed, the prediction result and confidence of the security event can be determined based on the prediction results of all security logs. In addition, for each model, the prediction results of all security logs in the model can be determined based on the majority voting method, and the prediction result and confidence of the security event can be determined accordingly.
[0079] Specifically, in one embodiment of the present invention, the prediction result and the degree of confidence of the security event are determined based on the majority voting method according to the sub-prediction results corresponding to each security log in each machine learning model, including:
[0080] For each security log:
[0081] Determine the prediction result of the security log based on the majority voting method from the sub-prediction results provided by each machine learning model;
[0082] The trust level of the security log is determined based on the ratio of the number of sub-prediction results with consistent predictions to the total number of votes of all machine learning models.
[0083] Based on the prediction results and corresponding trust levels of each security log, the prediction results and trust levels of the security event are determined.
[0084] like Figure 4 As shown, each machine learning model independently analyzes each security log to obtain the sub-prediction result corresponding to the security log. For each security log: summarize the sub-prediction results from all machine learning models, and use the majority voting method to select the most frequently predicted category as the prediction result of the security log. Exemplarily, the sub-prediction results of a security log in the three machine learning models are real intrusion, business false alarm, and real intrusion. At this time, the real intrusion accounts for the largest proportion, so the real intrusion is used as the prediction result of the security log. The trust is determined based on the ratio of the number of models with the same sub-prediction result to the total number of models. Exemplarily, for the first security log, two models predict it as a real intrusion, then the trust of the security log is 100*2 / 3=66.67 points. After determining the prediction result and trust of each security log in the above manner, the prediction result and trust of the security event are determined based on the prediction results and trust of these logs.
[0085] In one embodiment of the present invention, the step of determining the prediction result and the confidence level of the security event based on the prediction result and the corresponding confidence level of each security log includes:
[0086] The prediction results of each security log are counted to obtain a set of prediction results; wherein the prediction results include real intrusions and business false alarms;
[0087] Determine whether the total amount of business false positives in the prediction result set is greater than the total amount of real intrusions:
[0088] If so, the business false alarm is used as the prediction result of the security event, and the trustworthiness of the security event is determined based on the trustworthiness of the security logs corresponding to all business false alarms;
[0089] Otherwise, the real intrusion is taken as the prediction result of the security event, and the trustworthiness of the security event is determined according to the trustworthiness of the security logs corresponding to all the real intrusions.
[0090] For each security log, the prediction result is a real intrusion or a business false alarm. The prediction results of all security logs are summarized to obtain a set of prediction results. From the set of prediction results, the total amount of business false alarms and the total amount of real intrusions are counted, and the two are compared to select the category with a larger number as the prediction result of the security event. Specifically, if the total amount of business false alarms is greater than the total amount of real intrusions, the business false alarms are used as the prediction result of the corresponding security event. Otherwise, the real intrusion is used as the prediction result of the corresponding security event. It should be noted that if the total amount of business false alarms is the same as the total amount of real intrusions, it indicates that the model has poor classification and detection capabilities for the event. Combined with the actual business analysis scenario, the cost of letting go of the real intrusion event is greater for the business. At this time, the prediction result of the security event is considered to be a real intrusion. If the prediction result of the security event is a real intrusion, the average trust of all logs classified as real intrusions is used as the trust of the security event. Otherwise, if the prediction result of the security event is a business false alarm, the average trust of all logs classified as business false alarms is used as the trust of the security event.
[0091] For example, Figure 4 As shown in the figure, if there are N logs in total, and the prediction results of M logs are business false alarms, since M>NM, the prediction result of the security event is a business false alarm. The average of the trust degrees of the M logs predicted as business false alarms is the trust degree of the security event.
[0092] In another embodiment of the present invention, the prediction result and the confidence level of the security event are determined based on the majority voting method according to the sub-prediction results corresponding to each security log in each machine learning model, including:
[0093] All security logs processed for each machine learning model:
[0094] The sub-prediction results of all security logs in the model are counted to form a prediction result set; among them,
[0095] Prediction results include real intrusions and business false alarms;
[0096] Determine whether the total amount of business false positives in the prediction result set is greater than the total amount of real intrusions:
[0097] If yes, then the business false positives are used as the prediction results of all security logs in the machine learning model, and the trust level of all security logs in the machine learning model is determined based on the ratio of the total amount of business false positives to the total amount of prediction results;
[0098] Otherwise, the real intrusion is used as the prediction result of all logs in the machine learning model, and the trust degree of all security logs in the machine learning model is determined according to the ratio of the total amount of real intrusion to the total amount of prediction results;
[0099] The trust level of the security incident is determined based on the prediction results and trust levels of all security logs in each machine learning model.
[0100] Each machine learning model analyzes all processed security logs. For each security log, the machine learning model will obtain the sub-prediction result of the security log, and count the sub-prediction results of all security logs in the machine learning model to form a prediction result set. For each machine learning model, the total amount of real intrusions and the total amount of business false alarms are counted from the corresponding prediction result set, and the two are compared, and the larger one is selected as the prediction result of all security logs in the machine learning model. Specifically, if the total amount of business false alarms is greater than the total amount of real intrusions, the business false alarms are used as the prediction results of all security logs in the machine learning model, and the trust is determined according to the ratio of the total amount of business false alarms to the total amount of security logs. On the contrary, the real intrusion is used as the prediction result of all security logs in the machine learning model, and the trust is determined according to the ratio of the total amount of real intrusions to the total amount of security logs. Similarly, for each machine learning model, if the total amount of business false alarms is the same as the total amount of real intrusions, it indicates that the model has poor ability to classify and detect the event. Combined with the actual business analysis scenario, letting go of the real intrusion event has a greater impact on the business. At this time, it is considered that the prediction results of all security logs in the model are real intrusions. After all machine learning models have been analyzed, the prediction results and trust levels of security incidents can be determined based on the prediction results and corresponding trust levels of all security logs in each machine learning model.
[0101] In one embodiment of the present invention, determining the trustworthiness of the security event according to the prediction results and trustworthiness of all security logs in each machine learning model includes:
[0102] Determine the prediction result of the security incident based on the majority voting method from the prediction results of each machine learning model from all security logs;
[0103] The trust level of the security event is determined based on the trust level of the machine learning model that is consistent with the prediction result of the security event.
[0104] Count the prediction results of all security logs in different machine learning models, determine which category of prediction results appears the most times in all models, and use it as the prediction result of the security incident. Since the number of models is an odd number, there is no possibility that the prediction votes are evenly divided, and there must be one prediction result that accounts for the majority of votes. Exemplarily, if the prediction result of most models is a business false alarm, the prediction result of the security incident is a business false alarm. When calculating the trust of a security incident, the average of the corresponding trust of the model that is consistent with the prediction result of the security incident is used as the trust of the security incident.
[0105] For example, Figure 5 As shown in the figure, the prediction results of all security logs in the XGBoost model are real intrusions, and the corresponding trust S1 is 100*M1 / N, where M1 is the number of security logs whose sub-prediction results are real intrusions, and N is the total number of security logs. For the trust of security events, it is the mean trust of the machine learning model whose prediction results are business false positives.
[0106] Furthermore, after determining the predicted result and trust of the security incident, it also includes: judging whether the trust of the security incident is greater than a preset trust threshold: if so, the predicted result of the security incident is used as the final predicted result, otherwise, the security incident is manually checked. When the trust is greater than the trust threshold, it means that the obtained detection result has a high credibility, and it can be regarded as the final prediction result of the corresponding security incident for subsequent analysis. On the contrary, when the trust is less than or equal to the trust threshold, it means that the obtained detection result has a low credibility. At this time, the final detection result of the security incident can be determined by manual inspection to ensure the correctness of the detection.
[0107] In one embodiment of the present invention, the machine learning model is obtained by training, and the training data is a historical security log. The historical security log data records a single source IP to destination IP attack log, which contains source IP, destination IP, occurrence time, source port, destination port, attack type, attack result, number of alarms, status response code and other information. Because the security logs are aggregated, the historically handled security events may contain multiple source IPs and multiple destination IPs, as well as event sources, alarm content, attack analysis (manually filled labels) and other information. The time range for obtaining events and logs generally takes continuous periodic data, such as continuous data for one week, one month or longer. According to the aforementioned log and event matching method, the security event is matched with the corresponding log. When matching, the low-concern log data can also be filtered out by the aforementioned filtering method, and the filtered logs are not subjected to subsequent data processing and feature engineering. The filtered logs are subjected to data processing and feature engineering, so as to extract relevant features in the logs. It can be understood that the data processing and feature engineering methods used in the model training phase must be the same as those used in the aforementioned model reasoning phase, otherwise the trained model cannot be used for the detection of incremental events.
[0108] Use the above processed data features to train the required machine learning models (taking XGBoost, Bi-LSTM and TimesNet as examples) at the same time. After the training is completed, the tree information, model parameter information and objective function information can be saved after the XGBoost training is completed; the model structure, model parameter information, etc. can be saved after the Bi-LSTM training is completed; the model structure, model parameter information, etc. can be saved after the TimesNet training is completed. At this point, the offline training of the model is completed. It can be used for subsequent online detection.
[0109] Considering that supervised machine learning models can perform classification detection, that is, binary classification detection, multi-classification detection, multi-label multi-classification detection and other tasks. This application uses three models, XGBoost, Bi-LSTM and TimesNet, to perform binary classification detection at the same time. After the operation personnel analyze and judge the security incident, they can label the incident with a business false alarm label or a real intrusion label, and the incident is obtained by log aggregation, but the log data retains more data features, so the log label can also be obtained based on the event label. During training, the model can learn based on security log data containing artificial labels, and finally output the model to predict whether the event is a business false alarm or a real intrusion. Therefore, this application uses the data characteristics of the security log to distinguish between business false alarms and real intrusions, and finally reflects the prediction results and model trust in the security incident.
[0110] See also Figure 6 , the event detection system 100 based on multi-model fusion includes: a data acquisition module 110, a security log matching module 120, a model prediction module 130 and a detection module 140. Among them, the above-mentioned data acquisition module 110 is used to obtain the security events to be processed. The security log matching module 120 is used to match multiple security logs from the pre-stored log set according to the security events. The model prediction module 130 is used to input each security log into a preset number of different machine learning models respectively, and obtain the sub-prediction results corresponding to each security log in each machine learning model; wherein, the preset number is an odd number greater than or equal to three, and the machine learning model is a binary classification model for processing security logs. The detection module 140 is used to determine the prediction result and trust of the security event based on the majority voting method according to the sub-prediction results corresponding to each security log in each machine learning model.
[0111] For the specific limitations of the event detection system based on multi-model fusion, please refer to the limitations of the event detection method based on multi-model fusion mentioned above, which will not be repeated here. Each module in the above-mentioned event detection system based on multi-model fusion can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in hardware format, or can be stored in the memory in the computer device in software format, so that the processor can call the operations corresponding to the above modules.
[0112] It should be noted that, in order to highlight the innovative part of the present invention, the present embodiment does not introduce modules that are not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other modules in the present embodiment.
[0113] See also Figure 7 The electronic device 1 may include a memory 12, a processor 13 and a bus, and may also include a computer program stored in the memory 12 and executable on the processor 13, such as an event detection program based on multi-model fusion.
[0114] Among them, the memory 12 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 12 can be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 12 can also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 12 can also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 12 can not only be used to store application software and various types of data installed in the electronic device 1, such as code for event detection based on multi-model fusion, etc., but also can be used to temporarily store data that has been output or is to be output.
[0115] In some embodiments, the processor 13 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 13 is the control core (Control Unit) of the electronic device 1, and uses various interfaces and lines to connect the various components of the entire electronic device 1, and executes or executes programs or modules stored in the memory 12 (such as event detection programs based on multi-model fusion, etc.), and calls data stored in the memory 12 to execute various functions of the electronic device 1 and process data.
[0116] The processor 13 executes the operating system and various installed applications of the electronic device 1. The processor 13 executes the applications to implement the steps in the above-mentioned event detection method based on multi-model fusion.
[0117] Exemplarily, the computer program may be divided into one or more modules, which are stored in the memory 12 and executed by the processor 13 to complete the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the electronic device 1. For example, the computer program may be divided into a data acquisition module 110, a security log matching module 120, a model prediction module 130, and a detection module 140.
[0118] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium, and the computer-readable storage medium can be non-volatile or volatile. The above-mentioned software function module is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to perform part of the functions of the event detection method based on multi-model fusion described in each embodiment of the present application.
[0119] In summary, the present invention discloses an event detection method, system, device and medium based on multi-model fusion, which is applied to the situation awareness system. By combining the log data features and the manual labels of the alarm events, multiple models are used for automatic identification and detection, and the event results and trust levels considered by the model are given to assist operators in making decisions. Offline training and online detection automation, incremental prediction process automation, operators only need to verify according to the model trust level and prediction results, ensuring the automatic operation of the process. The coupling of the AI model and the situation awareness system is good, and the intervention on the situation awareness system itself is small. The implementation of this technology interacts with the interface and the system. The idea of integrated learning is adopted, and multiple machine learning and deep learning models are used to independently train joint decision-making, and voting is carried out according to the majority rule. The accuracy of the decision is improved through multi-model joint decision-making. Therefore, the present invention effectively overcomes the various shortcomings of the prior art and has a high industrial utilization value.
[0120] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. An event detection method, characterized in that: The method comprises: Get pending security events; According to the security event, multiple security logs are matched from a pre-stored log set; Input each security log into a preset number of different machine learning models to obtain a sub-prediction result corresponding to each security log in each machine learning model; wherein the preset number is an odd number greater than or equal to three, and the machine learning model is a binary classification model for processing security logs; According to the sub-prediction results corresponding to each security log in each machine learning model, the prediction result and confidence level of the security incident are determined based on the majority voting method.
2. The event detection method according to claim 1, characterized in that: The security event includes a source IP, a destination IP and an event occurrence time. According to the security event, a plurality of security logs are matched from a pre-stored log set, including: Determine the screening period based on the time of occurrence of the security incident and the preset screening time; Based on the source IP, the destination IP and the screening period in the security event, a plurality of security logs are screened out from a pre-stored log set; All the screened security logs are sorted to obtain multiple security logs matching the security event.
3. The event detection method according to claim 1, characterized in that: The security event has an identifier that matches the security log, and the matching of multiple security logs from a pre-stored log set according to the security event includes: Filtering out all security logs matching the identifier in the security event from a pre-stored log set; All the screened security logs are sorted to obtain multiple security logs matching the security event.
4. The event detection method according to claim 2 or 3, characterized in that: The data of all the screened security logs are sorted to obtain multiple security logs matching the security event, including: Perform data cleaning on all screened security logs; Perform feature engineering on all cleaned security logs; All security logs processed by feature engineering are standardized and normalized to obtain multiple security logs matching the security events.
5. The event detection method according to claim 1, characterized in that: The machine learning models are XGBoost model, Bi-LSTM model and TimesNet model. The security logs are input into a preset number of different machine learning models to obtain the sub-prediction results of the security logs corresponding to each machine learning model, including: Input the security log into the XGBoost model to capture the feature information in the security log and obtain the sub-prediction results of the security log; The security log is input into the Bi-LSTM model, and the time series relationship in the security log is captured based on the long and short-term memory capabilities to obtain the sub-prediction results of the security log; The security log is input into the TimesNet model, and the sub-prediction results of the security log are obtained based on the time information and periodic change information in the security log.
6. The event detection method according to claim 1, characterized in that: Determining the prediction result and the degree of confidence of the security event based on the sub-prediction result corresponding to each machine learning model of each security log and based on the majority voting method includes: For each security log: Determine the prediction result of the security log based on the majority voting method from the sub-prediction results provided by each machine learning model; The trust level of the security log is determined based on the ratio of the number of sub-prediction results with consistent predictions to the total number of votes of all machine learning models. Based on the prediction results and corresponding trust levels of each security log, the prediction results and trust levels of the security event are determined.
7. The event detection method according to claim 6, characterized in that: The step of determining the prediction result and the trust level of the security event based on the prediction result and the corresponding trust level of each security log includes: The prediction results of each security log are counted to obtain a set of prediction results; wherein the prediction results include real intrusions and business false alarms; Determine whether the total amount of business false positives in the prediction result set is greater than the total amount of real intrusions: If so, the business false alarm is used as the prediction result of the security event, and the trustworthiness of the security event is determined based on the trustworthiness of the security logs corresponding to all business false alarms; Otherwise, the real intrusion is taken as the prediction result of the security event, and the trustworthiness of the security event is determined according to the trustworthiness of the security logs corresponding to all the real intrusions.
8. The event detection method according to claim 1, characterized in that: Determining the prediction result and the degree of confidence of the security event based on the sub-prediction result corresponding to each machine learning model of each security log and based on the majority voting method includes: All security logs processed for each machine learning model: Count the sub-prediction results of all security logs in the model to form a set of prediction results; the prediction results include real intrusions and business false alarms; Determine whether the total amount of business false positives in the prediction result set is greater than the total amount of real intrusions: If yes, then the business false positives are used as the prediction results of all security logs in the machine learning model, and the trust level of all security logs in the machine learning model is determined based on the ratio of the total amount of business false positives to the total amount of prediction results; Otherwise, the real intrusion is used as the prediction result of all logs in the machine learning model, and the trust degree of all security logs in the machine learning model is determined according to the ratio of the total amount of real intrusion to the total amount of prediction results; The trust level of the security incident is determined based on the prediction results and trust levels of all security logs in each machine learning model.
9. The event detection method according to claim 8, characterized in that: Determining the trustworthiness of the security incident based on the prediction results and trustworthiness of all security logs in each machine learning model includes: Determine the prediction result of the security incident based on the majority voting method from the prediction results of each machine learning model from all security logs; The trust level of the security event is determined based on the trust level of the machine learning model that is consistent with the prediction result of the security event.
10. An event detection system, characterized in that: The system comprises: A data acquisition module, used to acquire security events to be processed; A security log matching module, used to match multiple security logs from a pre-stored log set according to the security event; A model prediction module, used to input each security log into a preset number of different machine learning models, and obtain a sub-prediction result corresponding to each security log in each machine learning model; wherein the preset number is an odd number greater than or equal to three, and the machine learning model is a binary classification model for processing security logs; The detection module is used to determine the prediction result and trustworthiness of the security event based on the sub-prediction results corresponding to each security log in each machine learning model and based on the majority voting method.
Citation Information
Cited By
A method to improve event detection accuracy based on multi-model fusion
CN119785162A
Intelligent judgment method, system and equipment for security event, and medium
CN119885165A
A method, system, device, and medium for intelligently determining security events
CN119885165B
