Methods, apparatuses, electronic devices and storage media for generating alarm filtering rules

By generating alarm filtering rules through large language models and generalization analysis, the problem of alarm filtering rules relying on manual configuration is solved, and alarm processing with strong adaptability is achieved. This reduces operation and maintenance costs and rule base redundancy, and improves the accuracy and efficiency of alarm processing.

CN123074907APending Publication Date: 2026-11-10BEIJING SHENGXIN NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611543920.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-08
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

In existing technologies, alarm filtering rules in the field of network security and operation and maintenance monitoring rely on manual configuration. Static rules have poor adaptability and cannot effectively cope with complex contexts, resulting in redundant rule bases, high maintenance costs, and low alarm processing efficiency.

Method used

By analyzing alarm data using a large language model, a first filtering rule is generated. Then, a second filtering rule is generated through feature aggregation and generalization analysis. This process cleans up the first filtering rule that has been covered, achieving automated generation and enhanced adaptability.

Benefits of technology

It significantly reduced operation and maintenance costs, improved the accuracy and efficiency of alarm processing, optimized the rule base size to adapt to changes in the IT environment, and reduced the processing time for false alarm scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123074907A_ABST
    Figure CN123074907A_ABST
Patent Text Reader

Abstract

This invention provides a method, apparatus, electronic device, and storage medium for generating alarm filtering rules, belonging to the field of computer software technology. The method introduces a large language model to intelligently analyze alarm data and automatically generate first filtering rules, achieving a shift from manual configuration to automated generation. This significantly reduces operation and maintenance costs and solves the problem of rule generation relying on manual intervention. Furthermore, by performing feature aggregation and generalization analysis of the first filtering rules and related data using a large language model, scattered rules are refined into more adaptable second filtering rules (generalized rules), and overwritten old rules are cleaned up. This endows alarm filtering rules with the ability to self-evolve and dynamically adapt to changes in the IT environment, overcoming the shortcomings of poor adaptability, lack of contextual understanding, and redundant rule bases in existing technologies. This effectively improves the accuracy of alarm processing and the efficiency of system operation and maintenance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer software technology, and in particular to a method, apparatus, electronic device, and storage medium for generating alarm filtering rules. Background Technology

[0002] In the field of network security and operations monitoring, monitoring systems continuously generate massive amounts of alarm data, including a large number of false alarms.

[0003] Existing technologies typically employ whitelist mechanisms to filter false alarms. However, this mechanism heavily relies on manual configuration and maintenance, and the rules are mostly static matches based on standard fields, lacking the ability to understand complex contexts. As the IT environment dynamically changes, static rules struggle to evolve adaptively, leading to rule base redundancy, high maintenance costs, and an inability to effectively address new false alarm scenarios, severely impacting the efficiency and accuracy of alarm processing.

[0004] In summary, traditional whitelisting methods for filtering false alarms suffer from problems such as reliance on manual maintenance of alarm filtering rules, poor adaptability of static rules, and lack of contextual understanding. Summary of the Invention

[0005] In view of this, the purpose of the present invention is to provide a method, apparatus, electronic device and storage medium for generating alarm filtering rules, so as to alleviate the problems of traditional whitelisting mechanisms for filtering false alarms, which require manual maintenance, have poor adaptability of static rules and lack context understanding capabilities.

[0006] In a first aspect, the present invention provides a method for generating alarm filtering rules, comprising: Acquire alarm data, analyze the alarm data using a large language model, and generate a first filtering rule; In response to the fulfillment of a preset triggering condition, feature aggregation is performed on the first filtering rule and the associated alarm data to obtain an alarm cluster; The alarm cluster is generalized and analyzed using the large language model to generate a second filtering rule. Clean up the first filtering rule that is covered by the second filtering rule.

[0007] Furthermore, the alarm data is analyzed using a large language model to generate a first filtering rule, including: The alarm data is aggregated based on the signature features of the alarm data to obtain alarm groups; Input representative alarm data from the alarm group into the large language model and receive the judgment results returned by the large language model; In response to the judgment result indicating a false alarm, the first filtering rule is generated based on the representative alarm data, and the judgment result is synchronized to other alarm data in the alarm group.

[0008] Further, feature aggregation is performed on the first filtering rule and the associated alarm data to obtain an alarm cluster, including: Extract non-standard fields from the alarm data associated with the first filtering rule. The non-standard fields include at least one of the following: original log text, naming pattern, or time pattern. Based on the non-standard fields, cluster analysis is performed on the alarm data associated with the first filtering rule to obtain the alarm cluster.

[0009] Furthermore, the alarm cluster is generalized using the large language model to generate a second filtering rule, including: Construct generalized request information that includes sample data of the alarm clusters and common features of the clusters; The generalization request information is sent to the large language model, and the structured rule data returned by the large language model is received. The structured rule data is parsed to generate the second filtering rule, which contains wildcards or address ranges.

[0010] Further, cleaning up the first filtering rule that is covered by the second filtering rule includes: The matching conditions of the second filtering rule are compared with the matching conditions of the first filtering rule. In response to the fact that the matching condition of the first filtering rule is completely contained by the matching condition of the second filtering rule, the first filtering rule is deleted from the rule base.

[0011] Furthermore, the method also includes: Output an audit request for either the first filtering rule or the second filtering rule; Receive a correction instruction returned based on the review request, and update the corresponding first filtering rule or second filtering rule according to the correction instruction; The updated first or second filtering rule and the reason for the correction are stored as feedback samples.

[0012] Furthermore, the method also includes: In response to receiving target alarm data, the target alarm data is matched sequentially using the second filtering rule and the first filtering rule; In response to a successful match, the target alarm data is filtered or downgraded. If no match is found, the target alarm data is used as the alarm data, and the process returns to the step of analyzing the alarm data using a large language model.

[0013] Secondly, the present invention also provides an apparatus for generating alarm filtering rules, comprising: The acquisition and analysis unit is used to acquire alarm data, analyze the alarm data through a large language model, and generate a first filtering rule; The feature aggregation unit is used to perform feature aggregation on the first filtering rule and the associated alarm data in response to the satisfaction of a preset triggering condition, so as to obtain an alarm cluster; The generalization analysis unit is used to perform generalization analysis on the alarm cluster using the large language model to generate a second filtering rule; The cleaning unit is used to clean up the first filtering rule that is covered by the second filtering rule.

[0014] Thirdly, the present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the method described in the first aspect.

[0015] Fourthly, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the method described in the first aspect.

[0016] The present invention provides a method for generating alarm filtering rules, comprising: acquiring alarm data, analyzing the alarm data using a large language model, and generating a first filtering rule; in response to satisfying a preset trigger condition, performing feature aggregation on the first filtering rule and associated alarm data to obtain an alarm cluster; performing generalization analysis on the alarm cluster using a large language model to generate a second filtering rule; and cleaning up the first filtering rule covered by the second filtering rule. As described above, the alarm filtering rule generation method of the present invention introduces a large language model to intelligently analyze alarm data and automatically generate the first filtering rule, realizing the transformation from manual configuration to automated generation, significantly reducing operation and maintenance costs and solving the problem of rule generation relying on manual intervention. Furthermore, by performing feature aggregation and generalization analysis of the first filtering rule and related data using the large language model, the scattered rules are refined into a more adaptable second filtering rule (generalized rule), and the overwritten old rules are cleaned up. This endows the alarm filtering rule with the ability to self-evolve and dynamically adapt to changes in the IT environment, overcoming the shortcomings of poor adaptability of static rules, lack of contextual understanding ability, and redundancy of the rule base in the prior art, and effectively improving the accuracy of alarm processing and system operation and maintenance efficiency. Attached Figure Description

[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0018] Figure 1 This is a schematic diagram illustrating a method for generating alarm filtering rules according to an embodiment of the present invention; Figure 2 A schematic diagram of an alarm filtering rule generation device provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0019] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] To facilitate understanding of this embodiment, a method for generating alarm filtering rules disclosed in this embodiment of the invention will first be described in detail.

[0021] Example 1: like Figure 1 As shown, this embodiment of the invention provides a method for generating alarm filtering rules. This method solves the problem of static rules and high maintenance costs in existing alarm filtering mechanisms by constructing an automated evolution closed loop from instance-level rules to general-level rules. The method mainly includes the following steps.

[0022] Step S100: Obtain alarm data, analyze the alarm data using a large language model, and generate the first filtering rule.

[0023] Specifically, alarm data can originate from network security monitoring systems, operation and maintenance monitoring systems, or cloud security platforms, and includes raw logs, traffic metadata, or event summaries reflecting the system's operational status or potential threats. In this embodiment, the large language model is not merely a text generation tool, but is configured as an analysis engine to perform specific data processing tasks. The system can encapsulate key fields in the alarm data (such as source IP, destination port, process name, log payload, etc.) into structured request information and input it into the large language model. The large language model then outputs a judgment result based on pre-set security knowledge or contextual understanding capabilities. When the judgment result indicates that the alarm data is a false alarm or benign behavior, the system automatically extracts key feature values ​​to generate a first filtering rule. This first filtering rule is typically a precise matching condition for a single entity or specific event, such as "source IP=192.168.1.10 and destination port=22" or "hostname=scanner-01 and alarm type=port scan". This instance-level first filtering rule can quickly respond to new false alarm scenarios and achieve instant filtering of known benign behaviors, but it also means that a large number of rule entries will be generated when facing a large number of similar false alarms.

[0024] Step S200: In response to the satisfaction of the preset triggering conditions, feature aggregation is performed on the first filtering rule and the associated alarm data to obtain an alarm cluster.

[0025] The preset trigger conditions can be time-based periodic triggers (e.g., executed every 24 hours), quantity-based threshold triggers (e.g., triggered when the cumulative number of newly added first filtering rules reaches 50), or dynamic triggers based on system load. The feature aggregation process aims to discover the inherent relationships between discrete first filtering rules. The system backtracks and queries historical alarm data associated with these first filtering rules, extracts multi-dimensional feature information for cluster analysis, and thus groups multiple first filtering rules with similar business backgrounds or attack patterns into one alarm cluster. For example, if multiple first filtering rules target port scanning behavior from different IPs such as 192.168.1.10 and 192.168.1.11, and these IPs belong to the same network segment or have similar naming patterns, they may be aggregated into the same alarm cluster. This step achieves the abstraction from isolated data points to group characteristics, providing a data foundation for subsequent generalization processing.

[0026] Step S300: Perform generalization analysis on the alarm cluster using a large language model to generate a second filtering rule.

[0027] In this step, the system constructs generalized request information from the sample data and common features within the alarm cluster, guiding the large language model to identify a common pattern that covers all individuals within the cluster. The analysis results returned by the large language model are parsed to generate a second filtering rule. Unlike the first filtering rule, the second filtering rule is general-level, and its matching conditions include fuzzy matching logic such as wildcards, regular expressions, or CIDR address ranges. For example, for the aforementioned port scan alarm cluster, the generated second filtering rule might be "Source IP ∈ 192.168.1.0 / 24 and Alarm Type = Port Scan". This evolution from specific instances to general patterns allows a single second filtering rule to replace the function of dozens or even hundreds of first filtering rules, greatly enhancing the rule's adaptability to dynamic IT environments and avoiding the problem of rules becoming invalid due to individual IP changes.

[0028] Step S400: Clean up the first filtering rule that is covered by the second filtering rule.

[0029] Specifically, after generating the second filtering rule, the system automatically traverses the existing first filtering rule library, logically comparing the matching conditions of each first filtering rule with the newly generated second filtering rule. If it is determined that the matching range of a certain first filtering rule completely falls within the matching range of the second filtering rule, then the first filtering rule is deleted from the rule library. For example, when a second filtering rule covering the entire subnet is generated, the dozens of first filtering rules originally generated for a single IP within that subnet are considered redundant and are cleared. This cleanup mechanism is crucial for maintaining the long-term efficient operation of the system. On the one hand, it significantly reduces the storage overhead of the rule library, preventing the number of rules from expanding indefinitely over time; on the other hand, it reduces the retrieval depth and computational load during subsequent alarm matching, improving the alarm processing throughput in high-concurrency scenarios. It should be understood that although this embodiment describes the order of generating the second rule first and then cleaning up the first rule, in other embodiments, the generation and cleanup operations can also be performed synchronously using atomic transactions, as long as the consistency of the rule library state is guaranteed.

[0030] Through steps S100 to S400, this embodiment constructs an adaptive rule evolution system. The large language model undertakes dual data processing functions, from semantic understanding to logical abstraction. It not only automates the generation of false positive rules but also solves the technical challenges of rule fragmentation and static nature in traditional solutions through aggregation and generalization mechanisms. Furthermore, an automatic cleanup mechanism ensures optimized allocation of system resources.

[0031] Building upon the above, this paper further details the specific implementation mechanism of the two-stage evolution of filtering rules. Through the synergy of four stages—real-time aggregation, deep clustering, structured generalization, and precise cleaning—a complete technical causal chain is constructed.

[0032] As one implementation method, the alarm data is analyzed using a large language model to generate a first filtering rule, including: aggregating the alarm data based on the signature features of the alarm data to obtain an alarm group; inputting representative alarm data from the alarm group into the large language model and receiving the analysis results returned by the large language model; in response to the analysis results indicating false alarms, generating a first filtering rule based on the representative alarm data, and synchronizing the analysis results to other alarm data in the alarm group.

[0033] Specifically, a signature feature refers to a summary of information that uniquely identifies a class of identical or highly similar alarm data. It is typically obtained by hashing key fields in the alarm data. For example, "alarm name + source IP address + destination port + hostname" can be concatenated and then subjected to MD5 or SHA-256 operations, with the resulting hash value serving as the signature. In real-time monitoring scenarios, a single scanner often generates tens of thousands of port scan alarms with identical features within a short period. Sending each alarm to a large language model for analysis would not only incur significant API call costs but also waste valuable computing resources due to repetitive reasoning. This embodiment uses a signature aggregation mechanism to cache alarm data with the same signature within a preset time window (e.g., 1 minute), selecting only one as representative alarm data (such as the first alarm data with the signature feature) and inputting it into the large language model. When the large language model returns an analysis result indicating a false alarm, the system not only generates a first filtering rule based on this representative data but also immediately marks the analysis result and synchronously applies it to all other alarm data belonging to the same alarm group in the cache. This strategy of one-time analysis and batch reuse not only ensures the accuracy of false alarm identification, but also reduces the frequency of calling large language models by several orders of magnitude, significantly improving the system's real-time processing capability and economy.

[0034] As one implementation method, feature aggregation is performed on the first filtering rule and the associated alarm data to obtain alarm clusters, including: extracting non-standard fields from the alarm data associated with the first filtering rule, wherein the non-standard fields include at least one of the original log text, naming rules, or time rules; and performing cluster analysis on the alarm data associated with the first filtering rule based on the non-standard fields to obtain alarm clusters.

[0035] Traditional whitelist generation methods often rely solely on standard fields such as IP addresses and ports for simple merging, which is insufficient to distinguish identical behaviors across different business contexts. For example, the same IP address might perform legitimate maintenance scans and malicious attack probes at different times, and IP alone cannot effectively differentiate between them. This embodiment introduces non-standard fields as clustering criteria to uncover the business semantics behind the data. The original log text contains the richest contextual information, such as command-line parameters, HTTP request headers, and user agent strings, directly reflecting the true intent of the operation. Naming patterns reflect asset ownership and purpose; for example, hostnames conforming to the "dev-test-*" pattern usually point to development and testing environments, and their abnormal behavior is more likely debugging than attack. Time patterns reveal the periodic characteristics of the behavior; for example, access behavior occurring only during weekday working hours is more consistent with internal office scenarios. In practical implementation, the system can perform vectorized embedding on the original log text to calculate semantic similarity between texts; or use regular expressions to extract keywords from hostnames as classification labels; or perform periodic detection based on timestamps. Through comprehensive analysis of these non-standard fields, the clustering algorithm can group multiple first-level filtering rules that, while differing in their standard fields, share the same core business logic into a single alarm cluster. This deep context-based aggregation method lays a solid foundation for generating highly accurate generalization rules, effectively avoiding the misgeneralization or missed generalization problems caused by the single-dimensionality of traditional methods. Furthermore, the aforementioned non-standard fields can also be alarm names.

[0036] As one implementation method, a second filtering rule is generated by performing generalization analysis on alarm clusters through a large language model. This includes: constructing generalization request information containing sample data of alarm clusters and common features of the clusters; sending the generalization request information to the large language model and receiving structured rule data returned by the large language model; parsing the structured rule data and generating a second filtering rule containing wildcards or address ranges.

[0037] To enable the large language model to output computer-executable filtering rules, rather than vague natural language suggestions, this embodiment employs a structured interaction protocol. When constructing generalized request information, the system not only provides several typical sample data points within the alarm cluster but also pre-compiles and injects a summary of common features for that cluster, such as "all sample hostnames match the scanner-pattern," "source IPs are all located in the 192.168.1.0 / 24 network segment," and "alarm types are all port scans." This dual input structure of "samples + statistical features" guides the large language model to focus on extracting common patterns, rather than getting bogged down in the detailed noise of individual samples. The large language model is configured to return structured rule data that strictly adheres to a predefined schema, such as a JSON object containing the rule name, matching condition fields, and their corresponding wildcard expressions or CIDR address ranges. Upon receiving the returned data, the system uses a parser to convert it into a second filtering rule object recognizable by its internal rule engine. For example, "source_ip_cidr: 192.168.1.0 / 24" in the JSON is parsed as a network layer matching condition, and "hostname_pattern: scanner-.local" is parsed as a string regular expression matching condition. This structured generation mechanism ensures the determinism and executability of the second filtering rule, enabling it to be seamlessly integrated into existing automated alarm processing pipelines, achieving a key leap from AI cognition to engineering implementation.

[0038] As one implementation, cleaning up a first filtering rule that is covered by a second filtering rule includes: comparing the matching conditions of the second filtering rule with the matching conditions of the first filtering rule; and deleting the first filtering rule from the rule base in response to the fact that the matching conditions of the first filtering rule are completely contained by the matching conditions of the second filtering rule.

[0039] Rule cleanup is a crucial step in maintaining the long-term healthy operation of a system, but its security is paramount. This embodiment employs strict full inclusion logic as the deletion trigger condition; that is, deletion is only performed when all data sets matched by the first filtering rule are subsets of the sets matched by the second filtering rule. In the specific algorithm implementation, for IP address fields, the system performs numerical comparisons of CIDR mask bits and bitwise verification of network addresses, for example, confirming that 192.168.1.50 / 32 is indeed covered by 192.168.1.0 / 24; for string fields, it performs subset determination of regular expressions or hierarchical matching checks of wildcard patterns. The reason for not using partial coverage or similarity thresholds as cleanup criteria is to fundamentally eliminate the risk of accidental deletion. In security operation scenarios, it is better to retain a small number of redundant rules than to allow excessive cleanup to unprotect benign traffic that should be filtered, thereby triggering a new storm of alerts or missing real threats. Through this conservative and precise cleaning strategy, the system can continuously remove atomic-level first-level filtering rules that have been absorbed by generalized rules while ensuring zero false deletions. This effectively controls the expansion of the rule base and ensures matching performance and storage efficiency under high-concurrency alarm impacts.

[0040] As one implementation method, the present invention also provides a human-machine collaborative feedback correction mechanism, specifically including: outputting an audit request for a first filtering rule or a second filtering rule; receiving a correction instruction returned based on the audit request, and updating the corresponding first filtering rule or second filtering rule according to the correction instruction; and storing the updated first filtering rule or second filtering rule and the correction reason as a feedback sample.

[0041] Specifically, while large language models possess powerful semantic understanding and reasoning capabilities, they may still exhibit judgment biases when faced with extremely complex business contexts or novel attack patterns never before encountered. To compensate for the potential shortcomings of purely automated processes and continuously improve the system's intelligence level, this embodiment introduces a manual review loop. The timing of review requests can be varied. For example, when the confidence level of the judgment result output by the large language model falls below a preset threshold, or when the generated second filtering rule covers more than a predetermined number of first filtering rules, thus triggering a high-risk change warning, the system will automatically push a review request to security operations personnel. This review request not only includes the rule content to be reviewed but also the original alarm data that generated the rule, a summary of clustering features, and the model's reasoning basis, enabling reviewers to make quick decisions. The data structure of the correction instruction is designed to support multi-dimensional adjustments, which can be modifications to specific field values ​​in the rule matching conditions (such as narrowing the IP range) or changes to the matching logic itself (such as adding a time window constraint that must be met simultaneously). More importantly, the system structurally stores each manual correction operation and its corresponding correction reason as feedback samples. These feedback samples contain a complete four-tuple of information: original input, model output, human correction, and reason for correction, forming a high-quality aligned training dataset. In subsequent system iterations, this data can be used for supervised fine-tuning (SFT) of the large language model or as a reward signal source for human feedback (RLHF) in reinforcement learning, enabling the model to gradually learn expert judgment preferences in specific enterprise environments and achieve continuous evolution from general intelligence to domain expert intelligence. This mechanism not only solves the problem of single misjudgments but also establishes a technical channel to make implicit human experience explicit and feed it back into the system.

[0042] As one implementation method, when using the rules generated above for actual alarm processing, in response to receiving target alarm data, the target alarm data is matched sequentially using the second filtering rule and the first filtering rule; in response to successful matching, the target alarm data is subjected to filtering or downgrading processing; in response to unsuccessful matching, the target alarm data is used as the alarm data, and the process returns to the step of judging the alarm data through the large language model.

[0043] This embodiment specifically defines the rule matching order as second rule first, which is not a simple logical choice, but a necessary technical means based on system performance optimization and data structure characteristics. Specifically, the second filtering rule is a generalized, universal rule, relatively few in number and stable in size. It is typically expressed using CIDR address ranges, regular expressions, or wildcards, making it suitable for fast retrieval in efficient in-memory index structures (such as Trie trees, deterministic finite automata (DFA), or Bloom filters), resulting in extremely low time complexity for a single match. In contrast, the first filtering rule is a precise matching rule for a specific instance. Over time, its number may accumulate to tens or even hundreds of thousands, with each rule corresponding to a discrete, precise value. If the first-then-second matching order is adopted, each newly arriving target alarm data needs to undergo a full or deep search of the massive first filtering rule base. This will lead to extremely high database I / O overhead and CPU computational load, easily causing processing delays or even service blockages in high-concurrency alarm scenarios. Conversely, prioritizing the use of the second filtering rule for matching leverages its high coverage to intercept the vast majority of known benign traffic. Only when the target alarm data fails to match any of the second filtering rules does it fall back to the first filtering rule for a more refined search. This hierarchical matching strategy essentially constructs a multi-level caching system of coarse-grained fast filtering plus fine-grained precise fallback, significantly reducing average query depth and system resource consumption. It should be understood that although adjusting the order may bring minor local benefits in some extreme cases (such as the rare scenario where the hit rate of the first filtering rule is much higher than that of the second filtering rule), considering the robustness of the overall architecture and the general performance in handling massive amounts of data, the matching order determined in this embodiment is the preferred solution to ensure the system's real-time processing capabilities. In addition, for alarm data that matches successfully, besides the filtering process of direct discarding, a degradation process can also be performed, such as marking it as low priority and archiving it, rather than completely deleting it, so that complete audit clues can still be retained when tracing security incidents in the future, balancing operational efficiency and security compliance requirements.

[0044] To more clearly illustrate the application value of the technical solution of this invention in a real business environment, the following detailed explanation uses the scenario of automatic management of false alarms in an enterprise security operations center as an example. It should be understood that this scenario is merely an illustrative example and not a limitation on the scope of application of this invention. The alarm filtering rule generation method provided by this invention is also applicable to various network security and operations fields that require processing massive amounts of alarm data, such as distributed denial-of-service attack mitigation, web application firewall policy optimization, and cloud-native container security monitoring.

[0045] In this example scenario, a company's intranet deploys multiple automated asset scanners for routine security inspections. These scanners trigger numerous port scanning alerts in the monitoring system during task execution. Since scanning is a legitimate maintenance operation, these alerts are essentially false positives. Under traditional manual maintenance, security analysts would need to manually review hundreds of such alerts daily and add newly appearing scanner IP addresses to a whitelist. This is not only time-consuming and labor-intensive, but also prone to invalidating old rules when scanner IPs change or are added, leading to recurring false positives and severely exacerbating analyst fatigue.

[0046] After adopting the method provided in this embodiment of the invention, the system first performs the step of acquiring alarm data and analyzing it through a large language model. When a scanner with an IP address of 192.168.1.50 triggers a port scan alarm for the first time, the system automatically inputs the alarm data into the large language model. The large language model combines the Nmap scan characteristics in the original log text with contextual information such as the hostname asset-scanner-01 to accurately determine that the behavior belongs to internal compliance scanning rather than external attack, and then automatically generates a first filtering rule with matching conditions of source IP equal to 192.168.1.50 and alarm type equal to port scan. This first filtering rule, as an instance-level exact matching entry, can immediately filter out similar alarms subsequently generated by this specific IP, realizing an immediate response to false alarms.

[0047] As time progresses, for example, after a week, the system accumulates dozens of first-level filtering rules targeting different scanner IPs. At this point, the system automatically initiates a feature aggregation and generalization process in response to preset periodic triggering conditions. The system extracts non-standard fields from the historical alarm data associated with these first-level filtering rules, finding that their hostnames all conform to the naming pattern of scanner-.company.local, and that the original logs all contain the same scan task identifier. Based on these deep semantic features, the system clusters the scattered first-level filtering rules into an alarm cluster, identifying the unified business essence behind this group of alarms as routine scanning tasks by the IT asset department. Subsequently, a large language model performs generalization analysis on this alarm cluster, generating a second-level filtering rule with the matching condition that the source IP belongs to the 192.168.1.0 / 24 network segment and the hostname matches the scanner-wildcard pattern. This second-level filtering rule is no longer limited to a specific single IP, but covers the behavioral patterns of the entire scanner cluster from a business perspective.

[0048] While generating the second filtering rule, the system automatically performs a cleanup operation, deleting dozens of the original first filtering rules from the rule base whose matching conditions are now fully encompassed by the new network segment and wildcard rules. This process requires no manual intervention, ensuring both a streamlined and efficient rule base and the automatic identification and filtering of alerts generated by scanners that add or change IPs within the network segment in the future. This completely solves the problem of static rules being unable to adapt to dynamic environments.

[0049] In terms of actual operational results, within one month of deploying this invention, the efficiency of handling false alarms related to port scanning was significantly improved. Specifically, the second filtering rule automatically generated by the system successfully intercepted over 98% of the relevant false alarms, and the number of effective rules for this scenario in the rule base decreased from an average of 120 during manual maintenance to a stable 3 generalized rules. More importantly, the average working hours spent by security analysts on handling such false alarms decreased from approximately 15 hours per week to less than 0.5 hours, requiring only confirmation of a very small number of edge cases when the system pushes an audit request. This quantifiable benefit fully demonstrates that this invention, through a two-stage evolution mechanism, not only technically achieves adaptive growth and redundancy elimination of filtering rules, but also substantially alleviates the alarm fatigue problem at the business level, significantly reducing the manpower costs and maintenance complexity of security operations, allowing security teams to concentrate their valuable energy on the assessment of truly high-risk threats.

[0050] The above method will be described again below: Alarm data is received in real time from one or more alarm sources (such as SIEM, NIDS, HIDS, APM systems) via API, Kafka message queues, or log file listening. The standardization engine parses and converts alarm data from different sources and in different formats into a unified JSON data structure. This structure not only includes standard fields (such as source_ip, destination_ip, hostname, process_name, alarm_name) but must also include non-standard fields for in-depth analysis (such as raw_log, command_line, user_agent, etc.). After obtaining standardized alarm data, the whitelist storage module is queried first. It checks the fixed whitelist (i.e., the second filtering rule) and the atomic whitelist (i.e., the first filtering rule) in turn. If the alarm data matches any existing whitelist rule, the alarm data is marked as benign (whitelist match) and directly filtered, without proceeding to further analysis, in order to save computing resources.

[0051] For alarm data that does not hit the whitelist, start an alarm aggregation task. This alarm aggregation task uses Redis cache to count completely identical alarm data within a short period of time (e.g., within 1 minute) based on the signature feature of the alarm (for example, the hash value of alarm_name + source_ip + hostname). Only the first alarm data of this signature feature (i.e., the representative alarm data) is sent to the large language model for analysis and judgment, and subsequent duplicate alarm data is temporarily stored to wait for the analysis and judgment result.

[0052] For the first alarm data that needs to be analyzed and judged, dynamically construct a prompt for analysis and judgment. An example of the structure of this prompt P1 is as follows: Plaintext You are a senior security analysis expert. Please determine whether this is a false positive based on the following alarm information.

[0053] [Alarm Details]: { "alarm_name": "Suspicious Port Scan", "source_ip": "192.168.1.50", "destination_ip": "10.0.0.10", "hostname": "asset-scanner-01.company.local", "raw_log": "Nmap scan detected from..."} [Question]: 1. Is this a false positive (Yes / No)? 2. Briefly describe your analysis and judgment reason.

[0054] 3. If this is a false positive, extract the key fields and values for generating an accurate whitelist.

[0055] Please return strictly in the following JSON format: { "is_false_positive": <true or false>, "reason": "<your analysis reason>", "whitelist_fields": { "field": "source_ip", "value": "192.168.1.50"}, { "field": "hostname", "value": "asset-scanner-01.company.local"} ​} Send P1 to the large language model module and wait for the returned JSON response (i.e., the judgment result).

[0056] Scenario 1: If is_false_positive is true. Parse the whitelist_fields field and store the key-value pairs (such as IP and hostname) as an atomic whitelist (i.e., the first filtering rule) in the whitelist storage module. At the same time, mark all duplicate alarm data under this signature feature as benign (LLM judgment) and filter them.

[0057] Scenario 2: If is_false_positive is false, determine that this is a real alarm (or cannot be determined), and push it and the temporarily stored duplicate alarms to the downstream processing system (such as the SOAR platform or manual analysis queue).

[0058] The whitelist is automatically fixed by a timed scheduler (such as a Cron Job, for example, set to "2 AM every day").

[0059] After the task starts, it queries all atomic whitelist entries from the whitelist storage module and then backtracks to retrieve the alarm data (including standard and non-standard fields) associated with these atomic whitelist entries. It then uses clustering algorithms from machine learning (such as DBSCAN or K-Means) to aggregate this alarm data. The clustering criteria (features) primarily use non-standard or combined fields, for example: Alarm name (alarm_name); TF-IDF vector or BERT embedding of raw log text (raw_log); Hostname naming conventions (e.g., scanner-xx, dev-vm-yyy); The timing pattern of alarms (e.g., "only at 3 PM on weekdays").

[0060] Clustering output: generates multiple "alarm clusters". For example, a cluster may contain 50 different atomic whitelists, but they all point to alarm_name: 'internal network host scan', and the hostnames all conform to the pattern scanner-*.company.local.

[0061] For each identified "alarm cluster," a prompt word P2 (i.e., a generalized request message) is dynamically constructed for solidified analysis. Example of P2 structure: Plaintext You are a senior security rule engineer. The system has found the following {N} alerts that have been confirmed as false positives, which are highly similar in characteristics and appear to belong to the same business scenario.

[0062] [Alarm Cluster Sample Data]: { "alarm": "...", "whitelist_added": "ip=192.168.1.50, host=scanner-01"}, { "alarm": "...", "whitelist_added": "ip=192.168.1.51, host=scanner-02"}, ... (5-10 samples are displayed) [Cluster Common Features]: { "alarm_name": "Intranet Host Scan", "hostname_pattern": "scanner-xx.company.local", "source_ip_range": "192.168.1.0 / 24", "time_of_day": "work_hours"} [Questions]: 1. Do these alerts confirm that they represent a unified, benign business scenario (e.g., routine asset scanning by the IT department)? (Yes / No) 2. Can these scattered whitelist entries be "solidified" into one or more more general whitelist rules? (Yes / No) 3. If yes, provide this solidified rule using wildcard (*) or CIDR notation.

[0063] Please return strictly in the following JSON format: { "can_solidify":<true or false>, "reason": "<Your analysis reason, for example: This is the daily scanning behavior of the IT asset department>", "solidified_rules": { "rule_name": "IT Asset Scan Whitelist", "conditions": { "alarm_name": "Intranet Host Scan", ​​"source_ip_cidr": "192.168.1.0 / 24", "hostname_pattern": "scanner-*.company.local" } } ] } Rule writing and cleanup: Scenario 1: If `can_solidify` is true. Parse the `solidified_rules` field and write the solidified whitelist containing wildcards or CIDRs to the whitelist storage module. Key step: After successful writing, delete the atomic whitelist entries that were overridden by this new solidified rule to keep the whitelist database clean and efficient.

[0064] Scenario 2: If can_solidify is false, the cluster is determined to be unsuitable for safe generalization, no operation is performed, and processing of the cluster ends.

[0065] The whitelist storage module is a database (such as Elasticsearch, PostgreSQL, or MongoDB). It contains at least two core data tables / collections: atomic_whitelist_table: Stores the generated precise whitelist. Fields include: id, field_name (e.g., 'ip'), field_value (e.g., '192.168.1.50'), alarm_type_context, create_time, and related_alarm_uuid (used to associate with the original alarm).

[0066] solidified_whitelist_table: Stores the generated generalization rules. Fields include: id, rule_name, rule_logic (stored in JSON or DSL format, such as: {"alarm_name": "...", "hostname_pattern": "..."}), description (reason from LLM), and create_time.

[0067] alarm_archive_table: Stores all raw alarm data, especially those alarms associated with whitelists, for retrospective analysis.

[0068] The Large Language Model module is an API service interface. The system interacts with this module via HTTPS calls. This module can be a large model API on a public cloud (such as Google's Gemini API) or a privately deployed model (such as Qwen-32B or Gemma 8B, which have been fine-tuned with security domain data).

[0069] The solution of the present invention has the following effects: This invention achieves a high degree of automation in whitelist generation, significantly improving operational efficiency: It utilizes a large language model to replace traditional manual analysis, enabling 24 / 7 automatic analysis and false alarm identification of massive alarms. This completely changes the inefficient model that previously relied on analysts manually adding whitelists, freeing operations and maintenance personnel from heavy and repetitive alarm handling work, and greatly reducing labor costs and alarm fatigue.

[0070] This invention improves the accuracy of false alarm analysis and enhances the system's contextual understanding capabilities: Leveraging the powerful natural language understanding and complex reasoning capabilities of large language models, it can perform deep contextual analysis on non-standard fields (such as log text descriptions) and multi-dimensional field combinations (such as "specific IP" + "specific hostname" + "specific alarm type") in alarms. This overcomes the limitations of existing technologies that rely solely on standard fields for simple rule matching, making the whitelist analysis logic closer to expert experience, thereby more accurately distinguishing between benign behavior and real threats.

[0071] This invention achieves self-learning and generalization of whitelist rules, greatly enhancing the system's adaptability. Through a unique timed fixing mechanism, the system is no longer limited to generating static one-to-one whitelist entries like "IP=A" or "host=B". The system can aggregate and analyze historical whitelist data using a large language model, automatically learning and refining higher-level generalized rules such as "the scanning behavior of a certain type of IP address range is benign during a specific time period." This self-learning capability allows the whitelist to dynamically adapt to the ever-changing IT environment, achieving self-evolution and maintenance of rules, fundamentally solving the problem of poor adaptability of static rules.

[0072] Example 2: like Figure 2 As shown, this embodiment provides an alarm filtering rule generation apparatus, which is used to implement the alarm filtering rule generation method described in any of the foregoing descriptions. Specifically, the apparatus includes: an acquisition and analysis unit 10, a feature aggregation unit 20, a generalization analysis unit 30, and a cleanup unit 40, wherein: The acquisition and analysis unit 10 is used to acquire alarm data, analyze the alarm data through a large language model, and generate the first filtering rule; The feature aggregation unit 20 is used to perform feature aggregation on the first filtering rule and the associated alarm data in response to the satisfaction of the preset triggering conditions, so as to obtain an alarm cluster; The generalization analysis unit 30 is used to perform generalization analysis on alarm clusters through a large language model to generate a second filtering rule; Cleaning unit 40 is used to clean up the first filtering rule that is covered by the second filtering rule.

[0073] Optionally, the acquisition and analysis unit is also used to: aggregate alarm data based on the signature features of alarm data to obtain alarm groups; input representative alarm data in the alarm groups into a large language model and receive the analysis results returned by the large language model; in response to the analysis results indicating false alarms, generate a first filtering rule based on the representative alarm data and synchronize the analysis results to other alarm data in the alarm group.

[0074] Optionally, the feature aggregation unit is also used to: extract non-standard fields from the alarm data associated with the first filtering rule, wherein the non-standard fields include at least one of the original log text, naming patterns, or time patterns; and perform cluster analysis on the alarm data associated with the first filtering rule based on the non-standard fields to obtain alarm clusters.

[0075] Optionally, the generalization analysis unit is also used to: construct generalization request information containing sample data of alarm clusters and common features of the clusters; send the generalization request information to the large language model and receive the structured rule data returned by the large language model; parse the structured rule data and generate a second filtering rule containing wildcards or address ranges.

[0076] Optionally, the cleaning unit is further configured to: compare the matching conditions of the second filtering rule with the matching conditions of the first filtering rule; and delete the first filtering rule from the rule base in response to the fact that the matching conditions of the first filtering rule are completely contained by the matching conditions of the second filtering rule.

[0077] Optionally, the device is further configured to: output an audit request for a first filtering rule or a second filtering rule; receive a correction instruction returned based on the audit request, and update the corresponding first filtering rule or second filtering rule according to the correction instruction; and store the updated first filtering rule or second filtering rule and the reason for correction as a feedback sample.

[0078] Optionally, the device is further configured to: in response to receiving target alarm data, sequentially match the target alarm data using a second filtering rule and a first filtering rule; in response to a successful match, perform filtering or downgrading processing on the target alarm data; in response to no successful match, treat the target alarm data as alarm data and return to the step of analyzing the alarm data using a large language model.

[0079] The device provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.

[0080] like Figure 3 As shown in the embodiment of this application, an electronic device 600 includes a processor 601, a memory 602, and a bus. The memory 602 stores machine-readable instructions executable by the processor 601. When the electronic device is running, the processor 601 communicates with the memory 602 via the bus. The processor 601 executes the machine-readable instructions to perform the steps of the alarm filtering rule generation method described above.

[0081] Specifically, the memory 602 and processor 601 mentioned above can be general-purpose memory and processor, without any specific limitations. When the processor 601 runs the computer program stored in the memory 602, it can execute the alarm filtering rule generation method mentioned above.

[0082] The processor 601 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 601 or by instructions in software form. The processor 601 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 602, and processor 601 reads the information from memory 602 and, in conjunction with its hardware, completes the steps of the above method.

[0083] Corresponding to the above-described method for generating alarm filtering rules, this application embodiment also provides a computer-readable storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to perform the steps of the above-described method for generating alarm filtering rules.

[0084] The alarm filtering rule generation device provided in this application embodiment can be specific hardware on the device or software or firmware installed on the device. The device provided in this application embodiment has the same implementation principle and technical effects as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can all be referred to the corresponding processes in the above method embodiments, and will not be repeated here.

[0085] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0086] For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0087] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0088] In addition, the functional units in the embodiments provided in this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0089] If the aforementioned function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the alarm filtering rule generation method described in the various embodiments of this application. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.

[0090] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0091] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.

Claims

1. A method for generating alarm filtering rules, characterized in that, include: Acquire alarm data, analyze the alarm data using a large language model, and generate a first filtering rule; In response to the fulfillment of a preset triggering condition, feature aggregation is performed on the first filtering rule and the associated alarm data to obtain an alarm cluster; The alarm cluster is generalized and analyzed using the large language model to generate a second filtering rule. Clean up the first filtering rule that is covered by the second filtering rule.

2. The method according to claim 1, characterized in that, The alarm data is analyzed using a large language model to generate a first filtering rule, including: The alarm data is aggregated based on the signature features of the alarm data to obtain alarm groups; Input representative alarm data from the alarm group into the large language model and receive the judgment results returned by the large language model; In response to the judgment result indicating a false alarm, the first filtering rule is generated based on the representative alarm data, and the judgment result is synchronized to other alarm data in the alarm group.

3. The method according to claim 2, characterized in that, Feature aggregation is performed on the first filtering rule and the associated alarm data to obtain an alarm cluster, including: Extract non-standard fields from the alarm data associated with the first filtering rule. The non-standard fields include at least one of the following: original log text, naming pattern, or time pattern. Based on the non-standard fields, cluster analysis is performed on the alarm data associated with the first filtering rule to obtain the alarm cluster.

4. The method according to claim 3, characterized in that, The alarm cluster is generalized using the large language model to generate a second filtering rule, including: Construct generalized request information that includes sample data of the alarm clusters and common features of the clusters; The generalization request information is sent to the large language model, and the structured rule data returned by the large language model is received. The structured rule data is parsed to generate the second filtering rule, which contains wildcards or address ranges.

5. The method according to claim 4, characterized in that, Cleaning up the first filtering rule that is covered by the second filtering rule includes: The matching conditions of the second filtering rule are compared with the matching conditions of the first filtering rule. In response to the fact that the matching condition of the first filtering rule is completely contained by the matching condition of the second filtering rule, the first filtering rule is deleted from the rule base.

6. The method according to claim 1, characterized in that, The method further includes: Output an audit request for either the first filtering rule or the second filtering rule; Receive a correction instruction returned based on the review request, and update the corresponding first filtering rule or second filtering rule according to the correction instruction; The updated first or second filtering rule and the reason for the correction are stored as feedback samples.

7. The method according to claim 6, characterized in that, The method further includes: In response to receiving target alarm data, the target alarm data is matched sequentially using the second filtering rule and the first filtering rule; In response to a successful match, the target alarm data is filtered or downgraded. If no match is found, the target alarm data is used as the alarm data, and the process returns to the step of analyzing the alarm data using a large language model.

8. An alarm filtering rule generation device, characterized in that, include: The acquisition and analysis unit is used to acquire alarm data, analyze the alarm data through a large language model, and generate a first filtering rule; The feature aggregation unit is used to perform feature aggregation on the first filtering rule and the associated alarm data in response to the satisfaction of a preset triggering condition, so as to obtain an alarm cluster; The generalization analysis unit is used to perform generalization analysis on the alarm cluster using the large language model to generate a second filtering rule; The cleaning unit is used to clean up the first filtering rule that is covered by the second filtering rule.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program thereon, characterized in that, The computer program is executed by the processor to perform the method of any one of claims 1 to 7.