Security event processing method and device and electronic equipment
By generating and analyzing prompt text, and using large models and knowledge bases, the problem of low efficiency in manual processing of network security events is solved, and more efficient security event processing and disposal are achieved.
Patent Information
- Application Number
- CN202410796372.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-10-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing technology, manual processing of network security events is inefficient and cannot effectively deal with potential harmful situations in computer networks.
By obtaining the logs to be processed, generating prompt text, and inputting it into a large model that has been fine-tuned and trained for analysis, security event processing recommendations are generated, and the threat intelligence knowledge base and disposal strategy knowledge base are used for prior knowledge mining to improve processing efficiency.
It improves the efficiency of security incident processing, outputs more reliable and targeted disposal suggestions, and reduces the need for manual analysis.
Smart Images

Figure CN118734296A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security technology, and in particular to a security incident processing method, device and electronic device. Background Art
[0002] A network security incident refers to a situation that occurs in a computer network or information system and may pose a potential threat to the system, data, users or organizations. These incidents can be caused by a variety of reasons, including malicious behavior, system failures, vulnerability exploits, unauthorized access, and other abnormal network activities. In the prior art, manual processing is often used to handle network security incidents for alarms reported by devices to prevent the occurrence of network security incidents, but manual processing is inefficient. Summary of the invention
[0003] The present application provides a security incident processing method, device and electronic device to improve the efficiency of security incident processing.
[0004] In a first aspect, an embodiment of the present application provides a method for handling a security incident, the method comprising:
[0005] Get the logs to be processed;
[0006] Generate a prompt text according to the log to be processed;
[0007] The prompt text is input into a security handling model, and a handling suggestion analysis is performed on the prompt text based on the security handling model to determine a security event handling suggestion corresponding to the log to be processed; the security handling model is a large model that has been fine-tuned and trained.
[0008] Since the embodiment of the present application processes the log to be processed after obtaining the log to be processed, and obtains a prompt text that can be input into the security handling model, so that the security handling model analyzes the prompt file and outputs the security incident handling suggestions corresponding to the log to be processed, there is no need to manually analyze the log to be processed to determine the security incident handling suggestions corresponding to the log to be processed, thereby improving the processing efficiency of security incidents.
[0009] An optional implementation manner is that generating a prompt text according to the log to be processed includes:
[0010] Extract key fields from the log to be processed to obtain key fields in the log to be processed; the key fields include source IP information and attack type;
[0011] Matching the key fields with data in a knowledge base to obtain a matching result; the knowledge base includes a threat intelligence knowledge base and a disposal strategy knowledge base;
[0012] The prompt text is generated according to the matching result.
[0013] Since the embodiments of the present application can mine prior knowledge in an external knowledge base based on key fields in the log to be processed and enrich the prompt text, it is possible to increase prompts for the security disposal model, which helps the security disposal model output more reliable and targeted disposal suggestions.
[0014] An optional implementation manner is that matching the key field with data in a knowledge base includes:
[0015] Matching the source IP information with the threat intelligence in the threat intelligence knowledge base to determine the threat information corresponding to the source IP information;
[0016] The attack type is matched with the rules in the handling strategy knowledge base to determine a handling suggestion corresponding to the attack type.
[0017] Because the embodiments of the present application can mine prior knowledge of known information in the log to be processed through the threat intelligence knowledge base and the disposal strategy knowledge base, so as to enhance the security disposal model's awareness of attacks.
[0018] An optional implementation manner is that generating the prompt text according to the matching result includes:
[0019] If the matching result is a matching failure, the prompt text is generated according to the log to be processed and the prompt word; or,
[0020] If the matching result is a successful match, the prompt word is updated according to the threat information corresponding to the source IP information and / or the handling suggestion corresponding to the attack type, and the prompt text is generated according to the updated prompt word.
[0021] An optional implementation manner is that updating the prompt word according to the threat information corresponding to the source IP information and / or the handling suggestion corresponding to the attack type includes:
[0022] The prompt word is updated according to the threat information corresponding to the source IP information to obtain a first prompt word; and / or,
[0023] The prompt word is updated according to the handling suggestion corresponding to the attack type to obtain a second prompt word.
[0024] An optional implementation manner is that generating the prompt text according to the updated prompt word includes:
[0025] The prompt text is generated according to the updated prompt word and the log to be processed.
[0026] An optional implementation is to train the security handling model in the following manner:
[0027] Acquire a sample data set, wherein any sample data in the sample data set includes the prompt word, the marked log, and the security incident handling suggestion corresponding to the marked log;
[0028] The large-scale model is trained according to the fine-tuning algorithm and the sample data set to obtain the safety disposal model.
[0029] In an optional implementation manner, obtaining the sample data set includes:
[0030] Determining a prompt word corresponding to the safety disposal model;
[0031] Obtaining the marked log, where the marked log is a normal protection log, a missed alarm log, or a false alarm log;
[0032] Obtain security incident handling suggestions for the marked log settings;
[0033] The sample data set is generated according to the prompt word, the marked log, and the security incident handling suggestion corresponding to the marked log.
[0034] In a second aspect, an embodiment of the present application provides a security event processing device, including:
[0035] An acquisition unit, used to acquire logs to be processed;
[0036] A generating unit, used for generating a prompt text according to the log to be processed;
[0037] The analysis unit is used to input the prompt text into a security handling model, perform handling suggestion analysis on the prompt text based on the security handling model, and determine the security event handling suggestion for the log to be processed; the security handling model is a large model that has been fine-tuned and trained.
[0038] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the computer program is executed by the processor, the security incident handling method described in the first aspect is implemented.
[0039] In a fourth aspect, an embodiment of the present application further provides a computer storage medium, wherein the computer storage medium stores computer program instructions, and when the instructions are executed on a computer, the computer executes the security incident handling method as described in the first aspect.
[0040] The technical effects brought about by any one of the implementation methods in the second to fourth aspects can refer to the technical effects brought about by the corresponding implementation method in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0042] Figure 1 A schematic diagram of a security incident handling scenario provided in an embodiment of the present application;
[0043] Figure 2 A flowchart of a security incident handling method provided in an embodiment of the present application;
[0044] Figure 3 A schematic diagram of a process for model training of a security disposal model provided in an embodiment of the present application;
[0045] Figure 4 A complete flowchart of a security incident handling method provided in an embodiment of the present application;
[0046] Figure 5 A schematic diagram of the structure of a security incident processing device provided in an embodiment of the present application;
[0047] Figure 6 A structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solutions and advantages of this application clearer, this application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0049] The following are explanations of some of the terms that appear in this article:
[0050] Prompt: Often used in the large model training process as input to the large model. In the embodiment of the present application, a prompt text composed of prompt words is used as the input of the large model.
[0051] The word “exemplary” is used hereinafter to mean “serving as an example, example, or illustration.” Any embodiment described as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0052] The terms "first" and "second" in this document are used for descriptive purposes only and should not be understood as explicitly or implicitly indicating relative importance or implicitly indicating the number of technical features indicated. Therefore, features defined as "first" and "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.
[0053] Figure 1 A security incident handling scenario provided by an embodiment of the present application is shown. Figure 1 As shown, the scenario includes a security device console and security devices.
[0054] The security device is used to provide protection for Web applications and can be a Web Application Firewall (WAF) security device.
[0055] The security device console is used to control the security device and adjust the hit rules in the security device.
[0056] In some embodiments, the security device can classify and detect traffic logs by sampling rule matching or machine learning. When the security device detects vulnerabilities and attack behaviors, it can report the detected vulnerabilities and attack behaviors to the security device console. In order to block the occurrence of network security incidents, operators can handle network security incidents for the alarms reported by the security device through the security device console. However, manual processing requires analyzing the alarms reported by the security device, determining the corresponding disposal method, and then handling the network security incident based on the determined disposal method, and the efficiency of security incident processing is low.
[0057] Based on the above problems, the embodiments of the present application provide a method, device and electronic device for handling security incidents, the method comprising: obtaining a log to be processed; generating a prompt text according to the log to be processed; inputting the prompt text into a security disposal model, performing disposal suggestion analysis on the prompt text based on the security disposal model, and determining the security incident handling suggestion for the log to be processed; wherein the security disposal model is a large model that has been fine-tuned and trained. When handling security incidents for logs to be processed, the embodiments of the present application can directly output the security incident handling suggestion corresponding to the log to be processed through the large model, allowing the user to directly handle the security incident according to the security incident handling suggestion, thereby improving the efficiency of security incident handling.
[0058] In one embodiment, the security incident handling method provided in the embodiment of the present application can be executed by a server, or by other electronic devices (such as computers, etc.) with certain computing capabilities for performing security incident handling, or by a client installed on a terminal device in collaboration with a server. The following embodiment is described by taking the server executing the security incident handling method as an example. Figure 2 As shown, the security incident processing method provided in the embodiment of the present application includes the following steps:
[0059] S201: Obtain logs to be processed.
[0060] The embodiment of the present application can obtain the protection log in the security device as the log to be processed. Among them, the security device can be a WAF security device, and the log to be processed can be a WAF daily protection log. Exemplarily, the log to be processed includes but is not limited to: request uniform resource locator (Uniform Resource Locator, URL), identifier, source IP information, HTTP request method, request header, user agent, WAF rule triggering information, attack type, and whether to intercept information.
[0061] For example, the log to be processed obtained by the embodiment of the present application may be an alarm log of a WAF, which records an HTTP request blocked by a firewall. The alarm log is as follows:
[0062] GET / css / custom / milk.css? v=2018.11.26 HTTP / 1.1 / / This is the request line, indicating that this is an HTTP GET request, the requested resource is / css / custom / milk.css, with a version query parameter v=2018.11.26. HTTP / 1.1 refers to the HTTP protocol version used
[0063] trace_id:d1ecacfb-b2b8-41fd-b781-176f187794cf / / This is a trace identifier used to uniquely identify this request in the system, making it easier to track or debug problems in multiple systems or log files
[0064] lua_sigids:200003279 / / Indicates the ID number of the triggered WAF rule. WAF may use Lua scripts to define and execute security rules.
[0065] lua_req_status:blocked / / indicates that the request has been blocked by WAF, usually because the request is considered malicious or violates security policies
[0066] User-Agent: Mozilla / 5.0 (Windows NT 6.2; rv: 30.0) Gecko / 20150101 Firefox / 32.0 360Spider 360Spider / / This is the user agent string of the request, which identifies the type of client making the request. The user agent here indicates that the request seems to be made through the Firefox browser, but contains "360Spider", which may mean that this is a crawler
[0067] Accept-Encoding:gzip,deflate,br / / Indicates the compression formats supported by the client, including gzip, deflate, and Brotli
[0068] Accept:text / css,* / *; q=0.1 / / The client declares the content type it is willing to accept, with priority given to CSS files
[0069] Connection:keep-alive / / Indicates that the client wants to keep the connection open in order to send more requests
[0070] Host: www.beian.gov.cn / / Requested target host name
[0071] Accept-Language:en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7 / / A list of languages acceptable to the client, sorted by priority
[0072] Sec-Fetch-Site:same-origin / / The site relationship of the request, here is same-origin, indicating that the request and the server are in the same domain
[0073] Sec-Fetch-Mode:no-cors / / Secure fetch mode, no-cors indicates that the request does not need to comply with the CORS (cross-origin resource sharing) policy
[0074] Sec-Fetch-Dest:style / / The goal of the request is to obtain style resources (CSS)
[0075] Referer:[URL] / / Indicates the original page URL that triggered the request
[0076] Cookie: [cookie details] / / Contains the cookie data brought by this request, usually used for authentication or session management
[0077] X-Forwarded-For:101.199.125.254 / / An HTTP extension header used to identify the client's original IP address, which is very important for understanding and tracing the source of the request
[0078] Content-Length: 0 / / indicates the length of the HTTP request body. 0 indicates no body.
[0079] S202: Generate a prompt text according to the log to be processed.
[0080] In some embodiments, due to the high cost of training the security handling model and the certain delay in the speed of knowledge update, the embodiments of the present application consider combining with an external knowledge base to mine prior knowledge of known information in the log to be processed, so as to enhance the security handling model's cognition of newer attacks, so that the security handling model can output more targeted suggestions.
[0081] Thus, the embodiment of the present application can extract key fields from the log to be processed to obtain the key fields in the log to be processed. Among them, the key fields include source IP information and attack type. Exemplarily, the embodiment of the present application can determine the attack category corresponding to the hit rule based on the hit rule in the log to be processed.
[0082] The embodiment of the present application can also match the key fields with the data in the knowledge base to obtain a matching result. The knowledge base includes a threat intelligence knowledge base and a disposal strategy knowledge base.
[0083] As an example, an embodiment of the present application can match the source IP information with the threat intelligence in the threat intelligence knowledge base to determine the threat information corresponding to the source IP information. Exemplarily, an embodiment of the present application can interact with the threat intelligence knowledge base through an application program interface (API) call method to obtain the threat information corresponding to the source IP information from the threat intelligence knowledge base. An embodiment of the present application can determine whether the source IP information successfully matches the threat intelligence in the threat intelligence knowledge base based on the threat information. For example, the data structure of the threat information corresponding to the source IP information obtained from the threat intelligence knowledge base by an embodiment of the present application is shown in Table 1 below:
[0084] Table 1: Data structure of threat information
[0085]
[0086]
[0087] Among them, when the malicious judgment in the threat information is unknown, the embodiment of the present application can determine that the source IP information has not been successfully matched with the threat intelligence in the threat intelligence knowledge base. For another example, when the malicious judgment in the threat information is malicious, the embodiment of the present application can determine that the source IP information has been successfully matched with the threat intelligence in the threat intelligence knowledge base.
[0088] The embodiment of the present application can also match the attack type with the disposal suggestions in the disposal strategy knowledge base to determine the disposal suggestions corresponding to the attack type. Exemplarily, when the disposal suggestions corresponding to the attack type are determined from the disposal strategy knowledge base, it can be determined that the attack type is successfully matched with the disposal suggestions in the disposal strategy knowledge base. For another example, when the disposal suggestions corresponding to the attack type are not determined from the disposal strategy knowledge base, it can be determined that the attack type is unmatched with the disposal suggestions in the disposal strategy knowledge base.
[0089] After obtaining the matching result, the embodiment of the present application can generate a prompt text according to the matching result. The prompt text may include a prompt word, or may include a prompt word and a log to be processed. Exemplarily, the embodiment of the present application can generate the prompt text in the following manner.
[0090] Method 1: The matching result is a match failure
[0091] The embodiment of the present application can generate a prompt text according to the log to be processed and the prompt word. Among them, the prompt word can be a preset prompt word. Exemplarily, the embodiment of the present application can splice the log to be processed and the prompt word together to obtain the prompt text.
[0092] For example, the prompt word can be "Judge whether there is a threat in the following WAF device protection log. If so, please clarify the attack type and provide disposal suggestions."
[0093] Method 2: The matching result is successful
[0094] The embodiment of the present application can update the prompt word according to the threat information corresponding to the source IP information and / or the disposal suggestion corresponding to the attack type. The embodiment of the present application can also generate a prompt text according to the updated prompt word. Exemplarily, the embodiment of the present application can also generate a prompt text according to the updated prompt word and the log to be processed.
[0095] In the embodiment of the present application, the successful match can be divided into three cases: the first case is that the source IP information successfully matches the threat intelligence in the threat intelligence knowledge base; the second case is that the attack type successfully matches the disposal suggestion in the disposal strategy knowledge base; the third case is that the source IP information successfully matches the threat intelligence in the threat intelligence knowledge base, and the attack type successfully matches the disposal suggestion in the disposal strategy knowledge base. The following describes the generation process of the prompt text according to the above three cases.
[0096] The first case: the embodiment of the present application can update the prompt word according to the threat information corresponding to the source IP information to obtain the first prompt word. The embodiment of the present application can splice the first prompt word and the log to be processed together to obtain the prompt text.
[0097] Exemplarily, when the embodiment of the present application determines that the source IP is a malicious IP and there is a threatening attack behavior, the prompt word is updated according to the threat information corresponding to the source IP information to obtain a first prompt word that can indicate that the source IP has an attack behavior.
[0098] For example, when the prompt word is "Judge whether there is a threat in the following WAF device protection log. If there is, please clarify the attack type and give disposal suggestions", when the embodiment of the present application determines that the source IP is a malicious IP and there is a threat attack behavior, the above prompt word is optimized to the first prompt word. Among them, the first prompt word can be "The source IP of this log has collided with the threat intelligence library and detected the existence of historical behaviors such as XX attacks. Based on the known information, please analyze the following WAF log and give disposal suggestions."
[0099] The second situation: The embodiment of the present application can update the prompt word according to the disposal suggestions corresponding to the attack type to obtain the second prompt word. The embodiment of the present application can splice the second prompt word and the log to be processed together to obtain the prompt text. For example, when the prompt word is "Judge whether there is a threat in the following WAF device protection log. If so, please clarify the attack type and give disposal suggestions", the embodiment of the present application can optimize the prompt word to the second prompt word according to the disposal suggestions corresponding to the attack behavior. Among them, the second prompt word can be as follows:
[0100] "This log hits the WAF's XXX rule and is determined to be an XSS cross-site scripting attack. Common treatment suggestions include:
[0101] 1. Filter the required parameters before form submission or URL parameter passing.
[0102] 2. Filter user input: Check whether there is any illegal content in the user input.
[0103] Based on the above known information, please analyze the following WAF logs and give disposal suggestions. ".
[0104] The third case: The embodiment of the present application can update the prompt word according to the threat information corresponding to the source IP information to obtain the first prompt word. And the embodiment of the present application can also update the prompt word according to the disposal suggestion corresponding to the attack type to obtain the second prompt word. The embodiment of the present application can splice the first prompt word and the second prompt word together to obtain the prompt text. For another example, the embodiment of the present application can also splice the first prompt word, the second prompt word and the log to be processed together to obtain the prompt text.
[0105] S203: Input the prompt text into the security handling model, perform handling suggestion analysis on the prompt text based on the security handling model, and determine the security event handling suggestion for the log to be processed.
[0106] The security handling model is a large model that has been fine-tuned and trained. In the embodiment of the present application, the security handling model can be a security handling suggestion chat expert (Suggestion Generate CHAT, SG-CHAT). Exemplarily, the large model can be an open source large model, such as ChatGLM2, Tongyi Qianwen and other large models.
[0107] In some embodiments, after obtaining the security incident handling suggestions for the log to be processed, the embodiments of the present application can directly display the security incident handling suggestions through the API. Exemplarily, the embodiments of the present application can display the security incident handling suggestions in the security device, or can display the security incident handling suggestions on the console of the security device. In this way, the operating personnel can perform the next operation based on the displayed security incident handling suggestions, empower the security device, and thus improve the efficiency of security incident handling. In addition, when the log to be processed is a missed report log or a false alarm log, the embodiments of the present application can also help the operating personnel to modify the WAF rules in time by displaying the security incident handling suggestions, thereby improving the protection performance of the WAF and the self-security of the protected system.
[0108] In some embodiments, Figure 3 As shown, the embodiment of the present application can obtain the safety disposal model in the following manner:
[0109] Step 1: Construct a sample data set. Any sample data in the sample data set includes prompt words, labeled logs, and security incident handling suggestions corresponding to the labeled logs. Exemplarily, the sample data consists of three parts: instruction, input, and output. Instruction represents prompt instructions, corresponding to the prompt words in the sample data; input represents text, corresponding to the labeled logs in the sample data; output represents the returned result, corresponding to the security incident handling suggestions in the sample data.
[0110] The embodiment of the present application can be combined with the security application background to construct a security field data set, i.e., a sample data set, through log collection and distributed web crawler and other technologies. The security field data set includes security device protection logs, security event descriptions, and network forum data. The network forum data can be forum website data for handling suggestions obtained from outside the security device.
[0111] Exemplarily, the embodiment of the present application can be combined with the application scenario of WAF, and the prompt word corresponding to the security disposal model can be determined by the user. The embodiment of the present application can be combined with the application scenario of WAF, and the obtained WAF log can be annotated by the security expert to obtain the annotated log. The embodiment of the present application can also set security incident disposal suggestions for the annotated log by the security expert. For example, the security expert can divide the obtained WAF log into 3 categories, normal protection log, missed log and false alarm log. The security expert can also set corresponding security incident disposal suggestions for the annotated log. For example, for normal protection logs, the embodiment of the present application can collect corresponding security incident disposal suggestions for each type of attack in combination with the opinions of security experts. Among them, the security incident disposal suggestion includes the disposal of the current access IP and the system optimization measures that can be made to deal with the attack, for reference by the operator. For the false alarm log, the security incident disposal suggestion includes the WAF hit rule, reminding the operator to optimize the corresponding WAF rule and reduce the false alarm rate. For the missed alarm log, the security incident disposal suggestion includes the attack type, reminding the operator to optimize the corresponding WAF rule and reduce the missed alarm rate. The embodiment of the present application can generate a sample data set based on the determined prompt words, the marked logs, and the security incident handling suggestions corresponding to the marked logs.
[0112] For example, a normal protection log in a sample data set obtained by an embodiment of the present application may be as follows:
[0113] {
[0114] "instruction":"Judge whether the following WAF device protection logs contain threats. If so, please identify the attack type and provide disposal suggestions",
[0115] "input":"GET / css / custom / milk.css?v=2018.11.26HTTP / 1.1......",
[0116] "output":"According to this log, the WAF device has blocked an obvious SQL injection attempt because the attacker tried to execute a malicious SQL query. The handling suggestions are as follows:
[0117] 1. Analyze the source IP address: 135.181.74.27. If it is on a blacklist or associated with previous malicious activity, it may require further monitoring or blocking.
[0118] 2. Use parameterized queries: A parameterized query is a precompiled query that separates parameters from SQL statements, allowing the program to execute parameter values separately from SQL statements, thus avoiding SQL injection attacks.
[0119] 3. Filter input data: Filter all special characters entered by users as much as possible, such as semicolons, single quotes, etc., to prevent attackers from injecting malicious SQL code.
[0120] 4. Use stored procedures: Stored procedures can make SQL statements more secure. SQL statements can be saved on the server instead of being sent directly on the client, thereby effectively preventing SQL injection attacks.
[0121] 5. Use secure interfaces: Using secure programming interfaces can effectively improve the security of the database and avoid SQL injection attacks.
[0122] 6. Audit the database regularly: Audit the database regularly to detect SQL injection attacks so that timely measures can be taken to repair them.
[0123] }.
[0124] For another example, the false alarm log in the sample data set obtained by the embodiment of the present application may be as follows:
[0125] {
[0126] "instruction":"Judge whether the following WAF device protection logs contain threats. If so, please identify the attack type and provide disposal suggestions",
[0127] "input":"GET / favicon.ico HTTP / 1.1\\r\\ntrace_id:……",
[0128] "output":"According to this log, the WAF device has blocked a request for the / favicon.ico file because it could be considered a potential threat. However, normally, favicon.ico requests should not be considered a security threat."
[0129] }.
[0130] For another example, the underreporting log in the sample data set obtained by the embodiment of the present application may be as follows:
[0131] {
[0132] "instruction":"Judge whether the following WAF device protection logs contain threats. If so, please identify the attack type and provide disposal suggestions",
[0133] "input":"GET / favicon.ico HTTP / 1.1\\r\\ntrace_id:……",
[0134] "output":"According to this log, the WAF device missed a request to obtain a property file, which may involve illegal or malicious data access. Disposition suggestions may include:
[0135] 1. Analyze the source IP address: If it is on a blacklist or associated with previous malicious activity, it may require further monitoring or blocking.
[0136] 2. Update WAF rules: Based on the results of the analysis, it may be necessary to update WAF rules to better identify and block potential illegal data access attempts.
[0137] 3. It should be emphasized that attempts to obtain sensitive data or attribute files are usually malicious behavior and may involve illegal data access. Therefore, the blocking action of the WAF device is effective, but further analysis and processing are still required to ensure safety. If this is a real security incident, it is very important to work with security experts to take appropriate measures. "
[0138] }.
[0139] Step 2: Based on the fine-tuning algorithm and sample data set, train the large model to obtain a safe disposal model.
[0140] Among them, the fine-tuning algorithm can be Freeze, P-Tuning, Lora and other algorithms.
[0141] The embodiment of the present application can convert the sample data in the sample data set into Q&A instruction data that can be understood by the large model. For example, the embodiment of the present application can splice the prompt words and the marked logs in the security field data as Q instruction data, and the security event handling corresponding to the marked logs as A instruction data.
[0142] The embodiment of the present application can divide the converted sample data set into a test set, a training set, and a validation set. Among them, the division ratio can be test set 7: training set 2: validation set 1. The embodiment of the present application can fine-tune the large model based on the converted sample data set and the fine-tuning algorithm to obtain a security handling model. For example, the embodiment of the present application can use the p-tuningv2 mode to fine-tune the large model, use the converted sample data set to retrain some downstream task parameters of the large model, and finally obtain a trained security handling model. Among them, the obtained security handling model has more prior knowledge about security incidents than the base large model, and performs better in performing the task of generating security incident handling suggestions. The fine-tuning training method for the large model in the embodiment of the present application is the fine-tuning training method for the large model in the prior art, which will not be repeated here.
[0143] In an embodiment of the present application, by constructing a sample data set including prompt words, annotated logs, and security incident handling suggestions corresponding to the annotated logs, the large model is fine-tuned and trained to obtain a security handling model that can directly generate security incident handling suggestions.
[0144] After the security handling model training is completed, the embodiment of the present application can also perform the task of generating security incident handling opinions corresponding to the logs to be processed based on the security handling model. Figure 3 As shown, the embodiment of the present application can perform the above tasks by executing steps three and four.
[0145] Step 3: Update the prompt words in the prompt text in combination with the external knowledge base.
[0146] like Figure 3 As shown, the external knowledge base includes a threat intelligence knowledge base and a disposal strategy knowledge base. The embodiment of the present application can match the source IP information in the log to be processed with the threat intelligence in the threat intelligence knowledge base, and after the match is successful, the prompt word is updated to the first prompt word according to the threat information corresponding to the source IP information. The embodiment of the present application can also match the attack type in the log to be processed with the disposal suggestion in the disposal strategy knowledge base, and after the match is successful, the prompt word is updated to the second prompt word according to the disposal suggestion corresponding to the attack type. In this way, the embodiment of the present application can generate a prompt text according to the optimized first prompt word and the second prompt word.
[0147] Step 4: Use the security handling model to analyze the prompt text and output security incident handling suggestions.
[0148] In the embodiment of the present application, the prompt text can be input into the security handling model, and security incident handling suggestions can be obtained based on the security handling model.
[0149] After obtaining the security incident handling suggestion, the embodiment of the present application can also display the security incident handling suggestion in the security device or the console of the security device. In addition, the embodiment of the present application can also display the security incident handling suggestion to the operator so that the operator can perform the next step of the security device according to the security incident handling suggestion.
[0150] Based on the above content, the embodiments of the present application can combine with an external knowledge base to supplement the known information in the log to be processed, assist the security disposal model to make better judgments, and output more targeted security incident handling suggestions, thereby improving the efficiency of security incident handling.
[0151] In some embodiments, Figure 4 As shown, the present application embodiment provides a complete flow chart of a security incident handling method. Figure 4 As shown, the following steps are included:
[0152] S401: Obtain logs to be processed.
[0153] The log to be processed may be a WAF protection log.
[0154] S402: Extract key fields from the log to be processed to obtain source IP information and attack type.
[0155] S403: Match the source IP information with the threat intelligence in the threat intelligence knowledge base to determine the threat information corresponding to the source IP information.
[0156] S404: Determine whether the match is successful based on the threat information corresponding to the source IP information; if so, execute step S405; if not, execute step S408.
[0157] S405: Update the prompt word according to the threat information corresponding to the source IP information to obtain a first prompt word.
[0158] S406: Match the attack type with the disposal suggestions in the disposal strategy knowledge base to determine whether the match is successful; if so, execute step S407; if not, execute step S408.
[0159] S407: Update the prompt word according to the handling suggestion corresponding to the attack type to obtain a second prompt word.
[0160] S408: Generate prompt text.
[0161] Among them, when reaching S408 through steps S405 and S407, a prompt text is generated according to the log to be processed, the first prompt word, and the second prompt word. For another example, when reaching S408 through steps S405 and S406, a prompt text is generated according to the log to be processed and the first prompt word. For another example, when reaching S408 through S404 and S407, a prompt text is generated according to the log to be processed and the second prompt word. For another example, when reaching S408 through steps S404 and S406, a prompt text is generated according to the log to be processed and the prompt word.
[0162] S409: Input the prompt text into the security handling model, analyze the prompt text based on the security handling model, and obtain the security incident handling opinions corresponding to the log to be processed.
[0163] S410: Present security incident handling opinions to operations personnel.
[0164] Exemplarily, an embodiment of the present application may display security incident handling opinions in a security device or a security device console, so that an operator can perform the next step according to the displayed security incident handling opinions.
[0165] Based on the above content, after obtaining the log to be processed, the embodiment of the present application can use the threat intelligence knowledge base and the disposal strategy knowledge base to mine prior knowledge of the known information in the log to be processed, so as to update the prompt words and enrich the prompt text, thereby improving the security disposal model's understanding of attacks, helping the security disposal model to output more reliable and targeted disposal suggestions, thereby improving the efficiency of handling security incidents.
[0166] and Figure 2 The security incident handling method shown is based on the same inventive concept, and a security incident handling device is also provided in the embodiment of the present application, and the security incident handling device can be deployed in the terminal device. Since the device is the device corresponding to the security incident handling method in the embodiment of the present application, and the principle of solving the problem by the device is similar to that of the method, the implementation of the device can refer to the implementation of the above method, and the repeated parts will not be repeated.
[0167] Figure 5 A schematic diagram of the structure of a security incident processing device provided in an embodiment of the present application is shown. Figure 5 As shown, the security incident processing device includes: an acquisition unit 501, a generation unit 502, and an analysis unit 503; wherein,
[0168] The acquisition unit 501 is used to acquire the log to be processed;
[0169] A generating unit 502, configured to generate a prompt text according to the log to be processed;
[0170] The analysis unit 503 is used to input the prompt text into a security handling model, perform handling suggestion analysis on the prompt text based on the security handling model, and determine the security event handling suggestion for the log to be processed; the security handling model is a large model that has been fine-tuned and trained.
[0171] In an optional embodiment, the generating unit 502 is specifically configured to:
[0172] Extract key fields from the log to be processed to obtain key fields in the log to be processed; the key fields include source IP information and attack type;
[0173] Matching the key fields with data in a knowledge base to obtain a matching result; the knowledge base includes a threat intelligence knowledge base and a disposal strategy knowledge base;
[0174] The prompt text is generated according to the matching result.
[0175] In an optional embodiment, the generating unit 502 is specifically configured to:
[0176] Matching the source IP information with the threat intelligence in the threat intelligence knowledge base to determine the threat information corresponding to the source IP information;
[0177] The attack type is matched with the handling suggestions in the handling strategy knowledge base to determine the handling suggestions corresponding to the attack type.
[0178] In an optional embodiment, the generating unit 502 is specifically configured to:
[0179] If the matching result is a matching failure, the prompt text is generated according to the log to be processed and the prompt word; or,
[0180] If the matching result is a successful match, the prompt word is updated according to the threat information corresponding to the source IP information and / or the handling suggestion corresponding to the attack type, and the prompt text is generated according to the updated prompt word.
[0181] In an optional embodiment, the generating unit 502 is specifically configured to:
[0182] The prompt word is updated according to the threat information corresponding to the source IP information to obtain a first prompt word; and / or,
[0183] The prompt word is updated according to the handling suggestion corresponding to the attack type to obtain a second prompt word.
[0184] In an optional embodiment, the generating unit 502 is specifically configured to:
[0185] The prompt text is generated according to the updated prompt word and the log to be processed.
[0186] In an optional embodiment, the security handling model is trained in the following manner:
[0187] Acquire a sample data set, wherein any sample data in the sample data set includes the prompt word, the marked log, and the security incident handling suggestion corresponding to the marked log;
[0188] The large model is trained according to the fine-tuning algorithm and the sample data set to obtain the safety disposal model.
[0189] In an optional embodiment, obtaining the sample data set includes:
[0190] Determining a prompt word corresponding to the safety disposal model;
[0191] Obtain the marked log, where the marked log is a normal protection log, a missed alarm log, or a false alarm log;
[0192] Obtain security incident handling suggestions set for the marked log;
[0193] The sample data set is generated according to the prompt word, the marked log, and the security incident handling suggestion corresponding to the marked log.
[0194] Corresponding to the above-mentioned embodiment of the security incident processing method, the embodiment of the present application further provides an electronic device. The electronic device may be a server, or a terminal device such as a mobile terminal or a computer.
[0195] The electronic device includes at least a memory for storing data and a processor for data processing. Among them, for the processor for data processing, when executing the processing, a microprocessor, a CPU, a GPU (Graphics Processing Unit), a DSP or an FPGA can be used for implementation. For the memory, an operation instruction is stored in the memory, and the operation instruction can be a computer executable code, and each step in the process of the industrial quality inspection method of the embodiment of the present application is implemented by the operation instruction.
[0196] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application; Figure 6 As shown, in the embodiment of the present application, the electronic device 100 includes: a processor 101, a display 102, a memory 103, an input device 106, a bus 105 and a communication module 104; the processor 101, the memory 103, the input device 106, the display 102 and the communication module 104 are all connected via the bus 105, and the bus 105 is used to transmit data between the processor 101, the memory 103, the display 102, the communication module 104 and the input device 106.
[0197] Among them, the memory 103 can be used to store software programs and modules, such as the program instructions / modules corresponding to the security incident handling method in the embodiment of the present application. The processor 101 executes various functional applications and data processing of the electronic device 100 by running the software programs and modules stored in the memory 103, such as the security incident handling method provided in the embodiment of the present application. The memory 103 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, at least one application application, etc.; the data storage area may store data created according to the use of the electronic device 100 (such as logs to be processed, and related data such as trained security disposal models), etc. In addition, the memory 103 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0198] The processor 101 is the control center of the electronic device 100, and uses the bus 105 and various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions of the electronic device 100 and processes data by running or executing software programs and / or modules stored in the memory 103, and calling data stored in the memory 103. Optionally, the processor 101 may include one or more processing units, such as a CPU, a GPU, a digital processing unit, etc.
[0199] The processor 101 may display the security event processing suggestions corresponding to the log to be processed to the user through the display 102 .
[0200] The processor 101 may also connect to a network through the communication module 104 to obtain logs to be processed.
[0201] The input device 106 is mainly used to obtain the user's input operation. When the electronic device is different, the input device 106 may also be different. For example, when the electronic device is a computer, the input device 106 may be an input device such as a mouse or a keyboard; when the electronic device is a portable device such as a smart phone or a tablet computer, the input device 106 may be a touch screen.
[0202] An embodiment of the present application also provides a computer storage medium, which stores computer executable instructions, and the computer executable instructions are used to implement the security incident handling method recorded in any embodiment of the present application.
[0203] In some possible implementations, various aspects of the industrial quality inspection method provided by the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the security incident processing method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device may execute the following steps: Figure 2 The process of the security incident processing method of steps S201 to S203 is shown.
[0204] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0205] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A security incident processing method, characterized in that: include: Get the logs to be processed; Generate a prompt text according to the log to be processed; Inputting the prompt text into a security handling model, performing handling suggestion analysis on the prompt text based on the security handling model, and determining a security event handling suggestion for the log to be processed; The safety handling model is a large model that has been fine-tuned and trained.
2. The method according to claim 1, characterized in that The step of generating a prompt text according to the log to be processed includes: Extract key fields from the log to be processed to obtain key fields in the log to be processed; the key fields include source IP information and attack type; Matching the key fields with data in a knowledge base to obtain a matching result; the knowledge base includes a threat intelligence knowledge base and a disposal strategy knowledge base; The prompt text is generated according to the matching result.
3. The method according to claim 2, characterized in that The matching of the key field with the data in the knowledge base includes: Matching the source IP information with the threat intelligence in the threat intelligence knowledge base to determine the threat information corresponding to the source IP information; The attack type is matched with the handling suggestions in the handling strategy knowledge base to determine the handling suggestions corresponding to the attack type.
4. The method according to claim 3, characterized in that Generating the prompt text according to the matching result includes: If the matching result is a matching failure, the prompt text is generated according to the log to be processed and the prompt word; or, If the matching result is a successful match, the prompt word is updated according to the threat information corresponding to the source IP information and / or the handling suggestion corresponding to the attack type, and the prompt text is generated according to the updated prompt word.
5. The method according to claim 4, characterized in that The updating of the prompt word according to the threat information corresponding to the source IP information and / or the handling suggestion corresponding to the attack type includes: The prompt word is updated according to the threat information corresponding to the source IP information to obtain a first prompt word; and / or, The prompt word is updated according to the handling suggestion corresponding to the attack type to obtain a second prompt word.
6. The method according to claim 5, characterized in that The step of generating the prompt text according to the updated prompt word includes: The prompt text is generated according to the updated prompt word and the log to be processed.
7. The method according to any one of claims 1 to 6, characterized in that: The security handling model is trained by: Acquire a sample data set, wherein any sample data in the sample data set includes the prompt word, the marked log, and the security incident handling suggestion corresponding to the marked log; The large model is trained according to the fine-tuning algorithm and the sample data set to obtain the safety disposal model.
8. The method according to claim 7, characterized in that The obtaining of the sample data set comprises: Determining a prompt word corresponding to the safety disposal model; Obtaining the marked log, where the marked log is a normal protection log, a missed alarm log, or a false alarm log; Obtain security incident handling suggestions set for the marked log; The sample data set is generated according to the prompt word, the marked log, and the security incident handling suggestion corresponding to the marked log.
9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program executable on the processor, and when the computer program is executed by the processor, the method according to any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Event fusion analysis processing method and system
CN117523301A
Method for realizing security arrangement automation and response based on large language model
CN117828602A
Honeypot log analysis method and system based on large language model and medium
CN118113678A
Cited By
Industrial large model construction method and system for network flow analysis and detection
CN119583094A
An industry large model construction method and system for network traffic analysis detection
CN119583094B
Universal method and system for identifying attack success through large model
CN119728193A
A general method and system for identifying successful attacks using large models.
CN119728193B
Security event processing method and apparatus and electronic device
WO2025260626A1
