Updating method and device of security protection strategy, equipment, medium and product

By generating attack sample variants through machine learning models, and automatically testing and updating security protection strategies, this solves the problems of low efficiency and poor security of manual optimization in existing technologies, and achieves efficient and automated optimization of security protection strategies.

CN121508928APending Publication Date: 2026-02-10BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511589290.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-31
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Current security protection strategies rely on manual collection of attack samples, which is inefficient, limited, and unable to proactively detect new attack methods, resulting in poor security performance.

Method used

Machine learning models are used to generate attack sample variants, which are automatically tested to bypass existing strategies. New security protection strategies are generated based on the test results, and existing strategies are automatically updated to optimize protection performance.

Benefits of technology

It has achieved automated optimization of security protection strategies, improved protection performance, reduced reliance on manual intervention, proactively discovered unknown risks, and improved security R&D efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121508928A_ABST
    Figure CN121508928A_ABST
Patent Text Reader

Abstract

The invention discloses a security protection strategy updating method and device, equipment, a medium and a product in the technical field of security, and the method comprises the steps: generating a second attack sample based on a first security protection strategy and a first attack sample through employing a first model when the first security protection strategy can carry out the detection interception of the first attack sample; and obtaining a test result of the second attack sample under the first security protection strategy, so that when the test result indicates that the second attack sample bypasses the first security protection strategy, a second model is utilized to generate a second security protection strategy based on the second attack sample, and the first security protection strategy is updated based on the second security protection strategy, the updated first security protection strategy not only can describe how to detect and intercept the first attack sample, but also can describe how to detect and intercept the second attack sample, so that protection performance optimization can be realized by means of an automatic process, and defects existing when protection performance optimization is performed by means of a manual mode are overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of security technology, and in particular to a method, apparatus, equipment, medium, or product for updating security protection strategies. Background Technology

[0002] In some scenarios, such as web scenarios, these scenarios are vulnerable to attacks. Therefore, to improve security, these scenarios can be protected against attacks by using security products such as Web Application Firewall (WAF) and Intrusion Prevention System (IPS).

[0003] Furthermore, to better improve the protective performance of these products, relevant personnel can first manually collect a large number of attack samples, such as attack payloads. Then, based on these attack samples, they can manually adjust the security protection strategies of these products to optimize their protective performance. However, it is evident that this optimization method relies on manual collection, which introduces some drawbacks. Summary of the Invention

[0004] To address the aforementioned technical problems, this application provides a method, apparatus, device, medium, or product for updating security protection strategies.

[0005] To achieve the above objectives, the technical solution provided in this application is as follows:

[0006] This application provides a method for updating a security protection strategy. The method includes: generating a second attack sample based on a first security protection strategy and a first attack sample corresponding to the first security protection strategy using a first model; obtaining test results of the second attack sample under the first security protection strategy; in response to the test results indicating that the second attack sample bypasses the first security protection strategy, generating a second security protection strategy based on the second attack sample using a second model; and updating the first security protection strategy based on the second security protection strategy.

[0007] In one possible implementation, generating the second attack sample includes: generating a plurality of second attack samples; in response to the test result indicating that the second attack sample bypasses the first security protection strategy, generating a second security protection strategy based on the second attack sample using a second model includes: in response to the test result indicating that at least one sample among the plurality of second attack samples bypasses the first security protection strategy, clustering the at least one sample that bypasses the first security protection strategy to obtain at least one sample set, wherein different sample sets correspond to different categories; and generating a second security protection strategy corresponding to each sample set using the second model.

[0008] In one possible implementation, the method further includes: obtaining analysis results of the at least one sample that bypasses the first security protection strategy, the analysis results indicating the distribution state of the at least one sample that bypasses the first security protection strategy in at least one dimension, the at least one dimension including the attack principle; the clustering of the at least one sample that bypasses the first security protection strategy includes: clustering the at least one sample that bypasses the first security protection strategy based on the analysis results.

[0009] In one possible implementation, generating a second attack sample includes: generating a plurality of second attack samples; obtaining test results of the second attack samples under the first security protection strategy includes: obtaining test results of the plurality of second attack samples under the first security protection strategy; in response to the test results indicating that the second attack samples bypass the first security protection strategy, generating a second security protection strategy based on the second attack samples using a second model includes: in response to the test results indicating that at least one sample among the plurality of second attack samples bypasses the first security protection strategy, selecting a sample from the at least one sample that bypasses the first security protection strategy, generating a second security protection strategy based on the selected sample using the second model, and updating the plurality of second attack samples based on other samples among the at least one sample that bypasses the first security protection strategy besides the selected sample; after updating the first security protection strategy based on the second security protection strategy, the method further includes: continuing to execute the step of obtaining test results of the plurality of second attack samples under the first security protection strategy until the test results indicate that there are no samples among the plurality of second attack samples that bypass the first security protection strategy.

[0010] In one possible implementation, the method further includes: verifying the second attack sample to obtain a verification result; obtaining the test result of the second attack sample under the first security protection strategy includes: in response to the verification result indicating that the second attack sample is valid, obtaining the test result of the second attack sample under the first security protection strategy.

[0011] In one possible implementation, the verification result includes a score corresponding to at least one verification method, wherein the at least one verification method includes at least some of syntax verification, semantic verification, and attack effect verification; in response to the verification result indicating that the second attack sample is valid, obtaining the test result of the second attack sample under the first security protection strategy includes: in response to the score corresponding to each of the at least one verification method being not lower than a preset threshold, obtaining the test result of the second attack sample under the first security protection strategy.

[0012] In one possible implementation, in response to the second attack sample satisfying a first condition, the verification result includes a score corresponding to syntax verification; in response to the second attack sample satisfying a second condition, the verification result includes a score corresponding to semantic verification; in response to the second attack sample satisfying a third condition, the verification result includes a score corresponding to attack effect verification.

[0013] In one possible implementation, the method further includes: identifying the attack type of the second attack sample to obtain an identification result; and verifying the second attack sample includes: verifying the second attack sample using the device corresponding to the identification result.

[0014] In one possible implementation, the method further includes at least one of the following: deleting the second attack sample in response to the verification result indicating that the second attack sample is invalid; updating the first model based on the second attack sample in response to the verification result indicating that the second attack sample is invalid; and adjusting the input data of the first model based on the second attack sample in response to the verification result indicating that the second attack sample is invalid to continue performing the step of generating the second attack sample.

[0015] In one possible implementation, the first object is configured to implement a security protection process using the first security protection strategy; the method satisfies at least one of the following constraints: the first object is a web application firewall or an intrusion prevention system; both the first model and the second model are large language models; the second attack sample is a variant of the first attack sample; both the first attack sample and the second attack sample are attack payloads; the test result is obtained by detecting the second attack sample using the first object based on the first security protection strategy.

[0016] This application provides a security protection strategy update apparatus, comprising: a first generation unit, configured to generate a second attack sample based on a first security protection strategy and a first attack sample corresponding to the first security protection strategy using a first model; a first acquisition unit, configured to acquire test results of the second attack sample under the first security protection strategy; a second generation unit, configured to generate a second security protection strategy based on the second attack sample using a second model in response to the test results indicating that the second attack sample bypasses the first security protection strategy; and a first update unit, configured to update the first security protection strategy of the first object based on the second security protection strategy.

[0017] This application provides an electronic device, the device comprising: a processor and a memory; the memory for storing instructions or computer programs; the processor for executing the instructions or computer programs in the memory, so that the electronic device performs the security protection strategy update method provided in this application.

[0018] This application provides a computer-readable medium storing instructions or computer programs that, when executed on a device, cause the device to perform the method for updating the security protection strategy provided in this application.

[0019] This application provides a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing an update method for the security protection strategy provided in this application.

[0020] Compared with related technologies, this application has at least the following advantages:

[0021] In the technical solution provided in this application, for the first security protection strategy (such as a security protection strategy already configured for security products such as WAF and IPS), when the first security protection strategy can detect and intercept the first attack sample, a first model is first used to generate a second attack sample (such as a variant of the first attack sample) based on the first security protection strategy and the first attack sample, so that there are some differences between the second attack sample and the first attack sample (such as different attack methods); then the test results of the second attack sample under the first security protection strategy are obtained, so that when the test results indicate that the second attack sample can bypass the first security protection strategy, it can be determined that the security protection process implemented based on the first security protection strategy cannot detect and intercept the second attack sample, thereby determining that the second attack sample can bypass the first security protection strategy. This demonstrates the inherent weaknesses in the security protection process itself. Therefore, a second model is used to generate a second security protection strategy based on the second attack sample. This second security protection strategy can instruct how to detect and intercept the second attack sample. Furthermore, the first security protection strategy is updated based on the second security protection strategy so that the updated first security protection strategy can describe not only how to detect and intercept the first attack sample but also how to detect and intercept the second attack sample. Consequently, the security protection process implemented based on the updated first security protection strategy can successfully detect and intercept both the first and second attack samples, thus overcoming the weakness. This automated process enables performance optimization, overcoming the shortcomings of manual performance optimization. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 A flowchart illustrating a method for updating a security protection strategy provided in an embodiment of this application;

[0024] Figure 2 A schematic diagram illustrating an update process provided in an embodiment of this application;

[0025] Figure 3 A schematic diagram illustrating another update process provided in an embodiment of this application;

[0026] Figure 4 A schematic diagram of the structure of a security protection strategy update device provided in an embodiment of this application;

[0027] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0028] Research has revealed that the protection performance optimization scheme based on manual data collection has at least the following problems: ① Because the attack samples used in this scheme are all collected manually, and the security protection strategies (such as rules) involved in the scheme are also constructed manually, the scheme has certain limitations and low efficiency; ② Security products based on this scheme are easily bypassed by "unexpected attack methods," resulting in missed attack detections and thus poor security performance; ③ The security protection strategies of this product are passively updated, making it impossible to predict and discover vulnerabilities, and making it easy to be bypassed by new attack methods, resulting in a lack of security assurance.

[0029] Based on the above research, in order to overcome the above problems, this application provides a method for updating a security protection strategy, which includes: for a first security protection strategy (such as a security protection strategy already configured for security products such as WAF and IPS), when the first security protection strategy can detect and intercept a first attack sample, a first model is first used to generate a second attack sample (such as a variant of the first attack sample) based on the first security protection strategy and the first attack sample, so that there are some differences between the second attack sample and the first attack sample (such as different attack methods); then, the test results of the second attack sample under the first security protection strategy are obtained, so that when the test results indicate that the second attack sample can bypass the first security protection strategy, it can be determined that the security protection process implemented based on the first security protection strategy cannot detect and intercept the second attack sample. It can be determined that the second attack sample can represent the vulnerability of the security protection process itself. Therefore, a second model is used to generate a second security protection strategy based on the second attack sample. This second security protection strategy can indicate how to detect and block the second attack sample. The first security protection strategy is updated based on the second security protection strategy so that the updated first security protection strategy can not only describe how to detect and block the first attack sample, but also how to detect and block the second attack sample. As a result, the security protection process implemented based on the updated first security protection strategy can not only successfully detect and block the first attack sample, but also detect and block the second attack sample. This allows the security protection process to overcome the vulnerability. In this way, the protection performance can be optimized through an automated process, overcoming the defects that exist when the protection performance is optimized manually.

[0030] As can be seen, in this application, for any security product (such as WAF or IPS), the product automates the entire process of building security defense capabilities by automatically updating security protection strategies, reducing reliance on manual labor and significantly improving efficiency. Furthermore, this application utilizes artificial intelligence (AI) to achieve the following: automatically generating bypass samples, automatically discovering new attack methods, and automatically updating security protection strategies based on these bypass samples to optimize the product's protection performance. This addresses the inherent problems of the aforementioned "protection performance optimization scheme based on manual collection methods" (such as limitations in sample collection, low efficiency, and inability to guarantee security), improving security R&D efficiency and proactively discovering unknown security risks. In addition, this application achieves a fully automated closed loop for the development, evaluation, and testing of security protection strategies through AI, tools, and scripts, thereby significantly reducing costs and increasing efficiency.

[0031] Furthermore, this application does not limit the entity executing the security protection strategy update method. For example, the method can be applied to a terminal device or a server. Alternatively, the method can be implemented through data interaction between the terminal device and the server. The terminal device can be a smartphone, computer, personal digital assistant (PDA), tablet computer, etc. The server can be a standalone server, a cluster server, or a cloud server.

[0032] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0033] To better understand the technical solution provided in this application, the updating method of the security protection strategy provided in this application will be explained below with reference to some accompanying drawings. For example... Figure 1 As shown, the method for updating the security protection strategy provided in this application includes S1-S4 below.

[0034] S1: Generate a second attack sample using the first model based on the first security protection strategy and the first attack sample corresponding to the first security protection strategy.

[0035] The first security protection strategy refers to the strategy required for security protection (such as...). Figure 2The WAF / IPS rules shown enable this first security protection strategy to describe how to detect and intercept certain attack payloads.

[0036] In addition, this application does not limit the first security protection strategy. For example, in some scenarios, the first security protection strategy may refer to any security protection strategy that has been configured by any security product, so that the product can use the first security protection strategy to implement the security protection process.

[0037] Based on the above, in one possible implementation, if the first object is configured to implement a security protection process using a first security protection strategy, then the first security protection strategy can refer to a security protection strategy that the first object itself already possesses that can effectively detect attack behavior (such as...). Figure 2 The WAF / IPS rules shown enable the first security protection strategy to indicate, to some extent, which attacks the first object can successfully defend against. Therefore, in one possible implementation, the first security protection strategy can refer to a pre-configured rule base for the first object, allowing the first security protection strategy to instruct the first object on which rules to follow for attack protection.

[0038] Furthermore, this application does not limit the implementation of the first security protection strategy. For example, in some scenarios (such as scenarios where manual and automated methods are used in coordination), the first security protection strategy may include a security protection strategy constructed manually and / or a security protection strategy constructed through at least one round of automated process.

[0039] Furthermore, this application does not limit the way the first security protection strategy is represented. For example, it can be implemented in any way that can represent the security protection strategy, such as by rules.

[0040] For the first object mentioned above (such as...) Figure 2 For the WAF or IPS shown, the first object refers to a security product with attack protection capabilities; and this application does not limit the implementation of the first object. For example, it can be implemented using any product that can achieve attack protection based on security protection strategies, such as WAF or IPS.

[0041] Therefore, in one possible implementation, the first object mentioned above can be a web application firewall or intrusion prevention system, so that the security protection strategy update method provided in this application can be used to automatically optimize the protection performance of these products, thereby efficiently meeting their performance optimization needs. This application does not limit the relationship between the update method and these products. For example, in some scenarios, the update method can be executed by other devices (such as servers) besides these products, enabling these products to achieve performance optimization with the assistance of these "other devices." Furthermore, in some scenarios, the update method can be executed by the products themselves, allowing them to continuously optimize their performance.

[0042] The first attack sample refers to an attack sample (such as an attack payload) that can be successfully detected and intercepted using the first security protection strategy of the first object, and that can cause an effective attack against the second object protected by the first object. This first attack sample can then be used as an example to demonstrate which attacks the first object can successfully defend against using the first security protection strategy. The second object refers to an object (such as a web application) that has attack protection requirements and is configured to use the first object for attack protection. Furthermore, this application does not limit the implementation method of the second object; for example, the second object can be implemented using any object with attack protection requirements, such as a web application.

[0043] Therefore, in one possible implementation, the aforementioned first attack sample can be an attack payload, such that the first attack sample at least satisfies the following constraint: the first attack sample can effectively attack the second object (such as a web application) to cause some damage to the second object. Here, the attack payload refers to code or program that can be executed on the second object to perform specific malicious operations after successfully breaching the security protection system of the second object (such as the first object).

[0044] Furthermore, this application does not limit the implementation of the aforementioned first attack sample. For example, in some scenarios (such as scenarios where manual and automated processes are used in coordination), the first attack sample may include attack examples carefully designed by relevant personnel (such as security experts) and / or attack samples generated through at least one round of automated processes. Thus, in one possible implementation, the first attack sample refers to an attack payload that the first object has already learned and processed at the current moment, so that the first attack sample can indicate what attack payloads the first object itself knows at the current moment and can accurately detect and intercept.

[0045] The first model refers to a machine learning model with the ability to generate attack samples, so that the first model can generate new attack samples based on the input data of the first model (such as the rule base that has been configured for the first object, the attack payload known to the first object, etc.).

[0046] Furthermore, this application does not limit the implementation of the first model. For example, it can be implemented using any machine learning model with attack sample generation capabilities, such as a Large Language Model (LLM).

[0047] Therefore, in one possible implementation, the first model described above can be a large language model (such as...). Figure 2 The LLM1 shown enables the first model to generate new attack samples based on the corresponding prompt. This application does not limit the implementation of the prompt; for example, the prompt may include at least a first security protection strategy and a first attack sample, so that the first model can clearly understand through the prompt what the configured security protection strategy for the first object is that can effectively detect and intercept attacks, and which attacks can be detected and intercepted using the first object, thereby enabling the first model to better generate new attack samples under the guidance of the prompt.

[0048] Research has revealed that in certain scenarios, for an existing attack sample, a new attack method can be used to replace the existing attack method, resulting in a new attack sample. This new attack sample can then replicate the working principle described in the existing attack sample, potentially leading to significant differences between the new and existing attack samples. Consequently, the new attack sample may be able to bypass the corresponding security protection strategies (such as rules) of the existing attack sample. An attack method refers to a series of specific operational steps, technical combinations, implementation strategies, and descriptions of attack principles used to achieve an attack objective (such as intrusion or destruction).

[0049] Based on the above research, in one possible implementation, the prompt word corresponding to the first model may also include at least one attack method, so that the first model can learn from the prompt word which attack methods it can use when constructing a new attack sample, so that the first model can subsequently select an attack method from these attack methods to generate a variant of the existing attack sample (such as the first attack sample).

[0050] Furthermore, this application does not limit the implementation of the above-mentioned at least one attack method. For example, in some scenarios, the at least one attack method may include methods provided by relevant personnel through manual input, attack methods automatically extracted from a large number of attack samples by means of a certain method (such as a pre-built machine learning model with attack method extraction function), and some or all of the attack methods automatically extracted from some documents by means of a certain method (such as a pre-built machine learning model with attack method extraction function), so that the at least one attack method can be as comprehensive as possible.

[0051] The second attack sample refers to a new attack sample generated by the first model, such as a difference between the second attack sample and the first attack sample, such as a different attack method.

[0052] It is evident that, in one possible implementation, the second attack sample and the first attack sample can at least satisfy the following constraints: the attack principle described by the second attack sample is consistent with the attack principle described by the first attack sample (e.g., the same or highly consistent); the attack method presented in the second attack sample is different from the attack method presented in the first attack sample.

[0053] It should be noted that this application does not limit the implementation of the above-mentioned "attack method presented in the second attack sample is different from the attack method presented in the first attack sample". For example, the second attack sample and the first attack sample are at least partially or completely different in the following aspects: ① The programming characteristics (such as programming language, programming instructions, etc.) used by the two are different; ② The lengths of the two are different; ③ One of the two uses uppercase for a certain character, and the other uses lowercase for that character; ④ One of the two adds double quotes to a certain string, and the other adds single quotes to the string or does not add any symbols.

[0054] Based on the aforementioned content of the second attack sample, it can be understood that, in one possible implementation, the second attack sample can be a variant of the first attack sample, so that the variant can be used to analyze whether the security protection strategy (such as the first security protection strategy mentioned above) corresponding to the first attack sample has any security weaknesses.

[0055] Furthermore, this application does not limit the implementation of the above-mentioned second attack sample. For example, in some scenarios, the second attack sample can be an attack payload, so that the second attack sample can present an effective attack on a second object (such as a web application).

[0056] Furthermore, this application does not limit the implementation of the above-mentioned S1. For example, in some scenarios (such as scenarios where attack samples are generated using LLM), S1 may specifically be: for the first object (such as security products such as WAF and IPS), firstly, based on the known rules of the first object (such as the first security protection strategy), the attack examples corresponding to the rules (such as the first attack sample), and some attack methods (such as various attack methods provided by relevant personnel), a first model (such as...) is constructed. Figure 2 The prompt words corresponding to LLM1 shown are used to indicate which rules the first object can use for attack protection at the current moment, which attacks the first object can successfully detect and block at the current moment, and which attack methods can be replaced in the attack samples that the first object can detect and block to form new attack samples. Then, the prompt words are input into the first model, and the first model automatically generates a variant of the attack example as a second attack sample based on the deep semantic understanding and logical induction capabilities of the first model. This allows for subsequent testing of whether the second attack sample can bypass the known rules, thereby maximizing the automatic discovery of the first object's defense vulnerabilities.

[0057] S2: Obtain the test results of the second attack sample under the first security protection strategy.

[0058] The testing results indicate whether the first object can successfully detect and intercept the second attack sample using the first security protection strategy. The test results also indicate whether the second attack sample can bypass the first security protection strategy to attack the second object (such as a web application) protected by the first object. In this way, the test results indicate whether the second attack sample can reveal the first object's security vulnerabilities.

[0059] Furthermore, this application does not limit the method of obtaining the above test results. For example, it can employ any method capable of detecting whether an attack sample can bypass existing security protection strategies, such as a method implemented by the first object itself or a method implemented by a simulation environment corresponding to the first object. The simulation environment can simulate the attack protection effect presented by the first object.

[0060] Therefore, in one possible implementation, the test results of the aforementioned second attack sample under the first security protection strategy can be obtained by utilizing the first object (such as...). Figure 2The WAF / IPS shown is obtained by detecting the second attack sample based on the first security protection strategy, so that the test result can indicate whether the second attack sample can bypass the protection of the first object to attack the second object (such as a web application) protected by the first object, thereby enabling the test result to indicate whether the second attack sample can reveal the vulnerability of the first object's protection.

[0061] Based on the above content related to S2, it can be seen that in some scenarios, after generating the second attack sample using the first model, the first object can be used to test the second attack sample to determine whether the second attack sample can bypass the security protection strategy of the first object (such as the first security protection strategy) and play an attack role.

[0062] S3: In response to the test results indicating that the second attack sample bypasses the first security protection strategy, a second security protection strategy is generated based on the second attack sample using the second model.

[0063] The second model refers to a machine learning model with security protection strategy generation capabilities (such as...). Figure 2 The LLM2 shown enables the second model to generate new security protection strategies (such as new rules) based on the input data of the second model.

[0064] Furthermore, this application does not limit the implementation of the second model. For example, it can be implemented using any machine learning model with the ability to generate security protection strategies, such as LLM.

[0065] Therefore, in one possible implementation, the second model described above can be a large language model (such as...). Figure 2 The LLM2 shown enables the second model to generate a new security protection strategy based on the corresponding prompt. This application does not limit the implementation of the prompt; for example, the prompt may include at least bypass samples (such as second attack samples) of the first security protection strategy, so that the second model can learn from the prompt which attack samples the first security protection strategy cannot detect or block, thereby enabling the second model to generate a supplementary strategy to the first security protection strategy under the guidance of the prompt.

[0066] For example, in some scenarios, to better improve the strategy generation effect, the prompts corresponding to the second model may also include pre-defined strategy generation specifications, so that the second model can gradually analyze and generate security protection strategies corresponding to bypass samples (such as the second attack sample) under the guidance of these specifications. This application does not limit these requirements; for example, they can be determined based on the security protection strategy generation needs of the actual application scenario.

[0067] For example, in some scenarios, in order to better improve the effectiveness and quality of the generation strategy, the prompt words corresponding to the second model mentioned above may also include at least some of the constraints shown in (1)-(2) below.

[0068] (1) Template: Identify fixed skeletons (such as parameters common to some bypass samples) to generate templates and replace variables (such as parameters that differ in these bypass samples) with placeholders.

[0069] (2) Minimal general regularization: For several similar strings, such as bypass samples with the same or highly similar attack principles, perform pairwise diff analysis to extract common prefixes and suffixes and change positions, and construct regularization with grouping; use \d+, \w+, (?:…)? etc. to represent numbers / letters / optional symbols respectively.

[0070] The second security protection strategy refers to a new security protection strategy generated by the second model based on the second attack sample, so that the second security protection strategy can indicate the characteristics of the second attack sample, thereby enabling the second security protection strategy to indicate how to detect and intercept the second attack sample, and further enabling the second security protection strategy to be updated as supplementary information to the first object that has been configured with the first security protection strategy.

[0071] Based on the above content related to S3, it can be seen that for the second attack sample generated by the first model (such as a variant of an existing attack sample), when utilizing the first object (such as... Figure 2 After testing the second attack sample using the WAF / IPS shown, if the test results indicate that the second attack sample can bypass the first security protection strategy of the first object, it can be determined that the first object cannot detect or intercept the second attack sample. Therefore, it can be determined that the second attack sample reveals a weakness in the second object's protection, and thus the second model (such as...) can be directly utilized. Figure 2 The LLM2 shown analyzes the second attack sample to generate a second security protection strategy, which indicates how to detect and block the second attack sample so that the second security protection strategy can be updated to the first object as supplementary information to optimize the protection performance of the first object.

[0072] S4: Update the first security protection strategy based on the second security protection strategy.

[0073] It should be noted that this application does not limit the implementation of the above-described S4. For example, when the first object is configured to implement the security protection process using the first security protection strategy, the S4 may specifically be: updating the first security protection strategy of the first object according to the second security protection strategy, so that the updated first security protection strategy of the first object includes the second security protection strategy, thereby enabling the updated first object to not only detect and intercept the first attack sample, but also to detect and intercept the second attack sample, thereby making the updated first object exhibit fewer security weaknesses compared to the first object before the update, and thus making the protection performance of the updated first object better than that of the first object before the update.

[0074] It should also be noted that this application does not limit the way the first security protection strategy of the first object is updated. For example, it can adopt any method that can update the security protection strategy of security products, such as directly adding the generated new rules to the rule base of the product for implementation.

[0075] For example, in order to better reduce the number of policies, the update process of the first security protection policy of the first object can meet the constraints shown in (I) to (II) below, so as to reduce the number of policies as much as possible.

[0076] (a) Regular expression merging: Merge multiple regular expressions according to the "OR" character, and then use deterministic finite automaton minimization to compress them into fewer states or strategies.

[0077] (ii) Condition merging: Merge multiple rules with the same attributes into a single strategy with a Boolean expression to reduce the number of strategies.

[0078] Based on the above S1 to S4, the automatic optimization protection performance scheme provided in this application includes: for a first security protection strategy (such as a security protection strategy already configured for security products such as WAF and IPS), when the first security protection strategy can detect and intercept a first attack sample, a first model is first used to generate a second attack sample (such as a variant of the first attack sample) based on the first security protection strategy and the first attack sample, so that there are some differences between the second attack sample and the first attack sample (such as different attack methods); then, the test results of the second attack sample under the first security protection strategy are obtained, so that when the test results indicate that the second attack sample can bypass the first security protection strategy, it can be determined that the security protection process implemented based on the first security protection strategy cannot detect and intercept the second attack sample, thereby enabling... To determine that the second attack sample reveals a vulnerability in the security process itself, a second model is used to generate a second security strategy based on the second attack sample. This second security strategy indicates how to detect and intercept the second attack sample. The first security strategy is then updated based on the second security strategy, so that the updated first security strategy describes not only how to detect and intercept the first attack sample but also how to detect and intercept the second attack sample. This ensures that the security process implemented based on the updated first security strategy can successfully detect and intercept both the first and second attack samples, thereby overcoming the vulnerability. This automated process optimizes security performance, overcoming the shortcomings of manual optimization.

[0079] Research has shown that in certain scenarios (such as academic research), the requirements can be met by generating only one new attack sample at a time. Therefore, in one possible implementation, the second attack sample can be only one, meaning that the first model generates only one new attack sample at a time.

[0080] Research has also revealed that in certain scenarios (such as engineering implementation scenarios), generating a large number of new attack samples each time can meet the needs of that scenario, facilitating the rapid discovery of vulnerabilities in the first target's defenses. Based on this, in one possible implementation, the aforementioned second attack sample can be multiple; that is, the first model can be used to generate a large number of new attack samples each time to meet the optimization efficiency requirements in these scenarios.

[0081] Based on the foregoing, in one possible implementation, the method for updating the security protection strategy provided in this application may include the following steps: First, using a first model, multiple second attack samples (such as a large number of second attack samples) are generated based on the first security protection strategy and the first attack sample corresponding to the first security protection strategy, so that there are certain differences between different second attack samples (such as different attack methods), and that each second attack sample also has certain differences with the first attack sample (such as different attack methods); then, the test results of the multiple second attack samples under the first security protection strategy are obtained, so that the test results can indicate whether these second attack samples can bypass the first security protection strategy; then, in response to the... The test results indicate that at least one of the multiple second attack samples bypasses the first security protection strategy. Using a second model, a second security protection strategy is generated for each sample among these at least one that bypasses the first security protection strategy. This ensures that each second security protection strategy can describe how to detect and intercept each sample. Finally, the first security protection strategy is updated based on the second security protection strategies for each sample. The updated first security protection strategy can then describe not only how to detect and intercept the first attack sample, but also how to detect and intercept the at least one sample that bypasses the first security protection strategy. This allows for the discovery and overcoming of multiple security vulnerabilities through a single automated process, improving optimization efficiency.

[0082] Research has found that in some scenarios (such as when multiple bypass samples are found in the same round of automated process), if a dedicated detection and interception strategy is created for each bypass sample, the number of strategies will increase exponentially. This significantly increases maintenance costs and resource overhead during the attack protection process of security products.

[0083] Based on the above research, in order to overcome the defects shown in the preceding paragraph, the security protection strategy updating method provided in this application may include the following steps: generating multiple second attack samples (such as a large number of second attack samples) using a first model based on a first security protection strategy and a first attack sample corresponding to the first security protection strategy; then obtaining the test results of the multiple second attack samples under the first security protection strategy, so that the test results can indicate whether these second attack samples can bypass the first security protection strategy; then, in response to the test results indicating that there is at least one sample among the multiple second attack samples that bypasses the first security protection strategy, clustering the at least one sample that bypasses the first security protection strategy to obtain at least one sample set, with different sample sets corresponding to different categories, so that different sample sets represent different clusters obtained through clustering, thereby making multiple attacks belonging to the same sample set... The samples have high similarity (e.g., similar attack principles) and low similarity between attack samples belonging to different sample sets (e.g., significantly different attack principles). A second model is used to generate second security protection strategies for each sample set, so that each second security protection strategy can describe how to detect and intercept samples recorded in its corresponding sample set. Finally, the first security protection strategy is updated based on the second security protection strategies for each sample set, so that the updated first security protection strategy can not only describe how to detect and intercept the first attack sample, but also how to detect and intercept attack samples recorded in each sample set. This effectively reduces the number of new strategies by using clustering, overcoming the drawbacks of building a dedicated strategy for each bypass sample, such as low optimization efficiency, a rapid increase in the number of strategies, and high resource consumption.

[0084] It should be noted that this application does not limit the implementation of the above-mentioned step of "clustering the at least one sample that bypasses the first security protection strategy to obtain at least one sample set". For example, it can be implemented by any method that can achieve clustering of multiple attack samples.

[0085] Research has shown that in some scenarios, attack payloads with different syntax structures but the same attack principle can be grouped into the same group to ensure that different attack payloads belonging to the same group can be detected and blocked using the same security protection strategy (like a single rule), thereby unifying the security protection strategies corresponding to multiple attack payloads into a single security protection strategy.

[0086] Based on the above research, in one possible implementation, the process of determining the at least one sample set may include: obtaining the analysis results of the at least one sample that bypasses the first security protection strategy, wherein the analysis results indicate the distribution of different samples in the at least one sample that bypasses the first security protection strategy in at least one dimension (such as attack principle), so that the analysis results can indicate the similarity of the at least one sample that bypasses the first security protection strategy in these dimensions (such as attack principle); clustering the at least one sample that bypasses the first security protection strategy based on the analysis results to obtain at least one sample set, such that the at least one sample set satisfies at least the following constraints: multiple attack samples belonging to the same sample set are consistent in the at least one dimension (such as being the same or highly similar), and attack samples belonging to different sample sets have significant differences in the at least one dimension. In this way, clustering can be used to divide some bypass samples with the same or highly similar attack principles into the same group, and divide some bypass samples with significant differences in working principles into different groups, so that the second model can be used to quickly and accurately generate the security protection strategies corresponding to each working principle, thereby improving the strategy generation effect.

[0087] It should be noted that the aforementioned "at least one dimension" refers to the dimension required for clustering; moreover, this application does not limit the implementation method of the at least one dimension, for example, it may at least include the working principle. In addition, the at least one dimension can be determined based on the strategy (such as rules) of the actual application scenario to better meet the needs of that scenario.

[0088] It should also be noted that this application does not limit the implementation of the above-mentioned step of "obtaining the analysis results of at least one sample that bypasses the first security protection strategy". For example, it can be implemented by any method that can analyze the distribution of the attack sample in at least one dimension (such as working principle).

[0089] Research has shown that, to improve the effectiveness, Term Frequency-Inverse Document Frequency (TF-IDF) can be used to analyze the distribution of some attack samples. TF-IDF is a keyword statistical analysis method used to measure the importance of a word to the current document; the larger the TF-IDF value, the greater the importance of the word in the current document; the formula for calculating the TF-IDF value is shown in formulas (1) to (3) below. The Term Frequency (TF) value represents the frequency of a word in the current document. The larger the value, the higher the relevance of the word to the current document; and the formula for calculating the TF value is shown in formula (1) below. The Inverse Document Frequency (IDF) value represents the number of times a word appears in all documents. The more times a word appears, the smaller the value, and vice versa; and the formula for calculating the IDF value is shown in formula (2) below.

[0090] (1)

[0091] (2)

[0092] (3)

[0093] In the formula, This indicates the frequency of word t in document d; This indicates the number of times the word t appears in document d; This represents the number of times the k-th word appears in document d, where k is a positive integer and k ≤ M. d M d M is a positive integer. d Indicate the number of lexical categories in document d, so that This represents the total number of times all words appear in document d; This represents the inverse document frequency of the word t; This indicates the number of documents in the document collection; This indicates the number of documents in the document collection that contain the word t; This represents the TF-IDF value of the word t as presented in document d, so that... It can characterize the importance of the word t to the document d.

[0094] Based on the above research, in one possible implementation, for any sample among the at least one sample that bypasses the first security protection strategy, firstly, the sample is regarded as a document, and the semantic units (such as words) appearing in the sample are regarded as words. The word vector (also known as TF-IDF vector) of the sample is generated using the calculation method shown in formulas (1) to (3) above, so that the word vector can indicate the importance of each semantic unit in the sample to the sample. Then, based on the word vectors of each sample among the at least one sample that bypasses the first security protection strategy, the analysis result of the at least one sample that bypasses the first security protection strategy is determined, so that the analysis result includes the word vectors of each sample among the at least one sample that bypasses the first security protection strategy, so that the analysis result can describe the distribution of these samples in the working principle by means of the distribution of semantic units presented in the word vectors, so that clustering can be performed according to the word vectors of these samples in the future, so as to divide samples with similar word vectors into the same group and divide samples with dissimilar word vectors into different groups.

[0095] It should be noted that this application does not limit the implementation method of the above clustering. For example, it can be implemented using any clustering method, such as Hierarchical Agglomerative Clustering (HAC). HAC is a powerful hierarchical clustering method that constructs a hierarchical clustering structure by iteratively merging the most similar clusters from the bottom up. It has significant advantages in not requiring a preset number of clusters, providing a hierarchical structure, and adapting to different data characteristics.

[0096] It is evident that, in some scenarios, when passing tests (such as...) Figure 2 After obtaining at least one sample that bypasses the first security protection strategy (as shown in the test), TF-IDF and HAC can be used to classify these samples so that the working principles of multiple samples belonging to the same class are consistent (such as being the same or highly similar), and the working principles of samples belonging to different classes are significantly different. This allows for the generation of dedicated strategies for each class, so that the dedicated strategy can describe how to detect and block all samples in the corresponding class. This better overcomes the defects caused by building dedicated strategies for each bypassed sample, such as low optimization efficiency, a sharp increase in the number of strategies, and high resource consumption.

[0097] Research has revealed that in some scenarios (such as when multiple bypass samples are found in the same round of automated process), different bypass samples (such as different sample sets) may share the same set of security protection strategies (like the same rule), which may result in the repeated generation of the same security protection strategy when generating security protection strategies for different bypass samples.

[0098] Based on the above research, in order to avoid repeatedly generating the same security protection strategy, the security protection strategy update method provided in this application may include steps 11-14 below.

[0099] Step 11: Using the first model, generate multiple second attack samples (such as a large number of second attack samples) based on the first security protection strategy and the first attack sample corresponding to the first security protection strategy.

[0100] Step 12: Obtain test results of multiple second attack samples under the first security protection strategy, so that the test results can indicate whether these second attack samples can bypass the first security protection strategy.

[0101] Step 13: In response to the test results indicating that there is at least one sample among the multiple second attack samples that bypasses the first security protection strategy, select a sample from the at least one sample that bypasses the first security protection strategy, and generate a second security protection strategy based on the selected sample using the second model.

[0102] It should be noted that this application does not limit the implementation of step 13 above. For example, it can be implemented using any randomly selected method.

[0103] As can be seen, in one possible implementation, step 13 above can specifically be: in response to the test result indicating that there is at least one sample that bypasses the first security protection strategy among a plurality of second attack samples, randomly select a sample from the at least one sample that bypasses the first security protection strategy, and use the second model to perform strategy generation processing on the selected sample to obtain a second security protection strategy, so that the second security protection strategy can describe the characteristics of the selected sample, so that the selected sample can be detected and intercepted in the future by means of the second security protection strategy.

[0104] For example, in some scenarios, to improve efficiency, step 13 above can specifically be: in response to the test results indicating that there is at least one sample among multiple second attack samples that bypasses the first security protection strategy, clustering the at least one sample that bypasses the first security protection strategy to obtain at least one sample set, randomly selecting a sample set from the at least one sample set, and using the second model to perform strategy generation processing on the selected sample set to obtain a second security protection strategy, so that the second security protection strategy can describe how to detect and intercept all samples in the sample set. This can achieve the simultaneous selection of multiple samples with consistent working principles for strategy generation, thereby improving efficiency.

[0105] Step 14: Based on the samples other than the selected sample among the samples that bypass the first security protection strategy, update the plurality of second attack samples, update the first security protection strategy based on the second security protection strategy, and return to continue executing the above step 12 and subsequent steps until the test results indicate that there are no samples that bypass the first security protection strategy among the plurality of second attack samples, and end the iteration loop.

[0106] It should be noted that this application does not limit the implementation of the above-mentioned step of "updating the plurality of second attack samples based on the samples other than the selected sample among the at least one sample that bypasses the first security protection strategy". For example, it can specifically be: taking the samples other than the selected sample among the at least one sample that bypasses the first security protection strategy as the updated plurality of second attack samples, so that attack samples that can be detected and intercepted by the second security protection strategy generated in the current round can be removed from these other samples in the next round of testing, so as to avoid repeatedly generating the second security protection strategy in the subsequent iteration process and improve efficiency.

[0107] Based on the relevant content of steps 11 to 14 above, it can be seen that this application provides a method using multiple iterative loops (such as...) Figure 3 The loop shown implements an automatic verification mechanism to update the rule base of security products with the new rules (such as security protection policies) generated in the current round, and then uses the updated rule base to test and screen the remaining bypass samples to avoid generating the same rule repeatedly and improve efficiency.

[0108] Research has revealed that the first model has inherent technical limitations in terms of training data bias, contextual understanding boundaries, and the randomness of the inference process. As a result, the attack samples generated using this model may have some defects, such as syntax errors, semantic errors, and inability to effectively attack the second object. Consequently, these generated attack samples are not effective, such as being unable to execute or achieve any attack effect on the second object.

[0109] The study also found that the defect identification process shown in the above paragraph (such as...) Figure 2 The resource overhead of the verification process is less than that of the testing process. Therefore, in order to improve efficiency, the attack sample is validated before testing. This ensures that the attack sample is valid (e.g., it does not have semantic errors, does not have syntax errors, and can cause effective attacks against the second object) before testing it.

[0110] Based on the above research, in one possible implementation, the security protection strategy update method provided in this application may include at least the following steps: verifying the second attack sample to obtain a verification result, so that the verification result can indicate whether the second attack sample is effective; in response to the verification result indicating that the second attack sample is effective (such as the second attack sample being in an effective attack state on a second object protected by the first object), obtaining the test result of the second attack sample under the first security protection strategy. In this way, the verification process can quickly eliminate defective attack samples, thereby saving the resource overhead caused by testing the defective attack samples and effectively reducing resource overhead (such as time overhead, computing resource overhead, etc.).

[0111] Furthermore, this application does not limit the implementation method of the above verification process. For example, it can be implemented using any method capable of identifying whether an attack sample is effective, such as behavioral verification (safe execution / emulation). Behavioral verification refers to experimentally executing the attack payload or injecting it into a simulated vulnerable application within a strictly isolated sandbox / container / virtual network to observe the actual effects (whether it triggers scripts, changes some data results, or causes certain requests, etc.), so that the effectiveness of the attack payload can be determined subsequently based on these effects.

[0112] Research has found that for the aforementioned behavioral verification, this verification method requires creating unique environments (such as strictly isolated sandboxes, containers, virtual networks, etc.) for each attack payload, making this verification method relatively costly.

[0113] The study also found that in some scenarios, the attack payload is ineffective because it contains syntax errors, semantic errors, or other such errors.

[0114] Based on the two studies above, it is clear that, in one possible implementation, the effectiveness of an attack payload can be verified using multiple methods such as syntax verification, semantic verification, and behavioral verification to improve efficiency. This application does not limit the implementation method of syntax verification; for example, it can be implemented using a pre-built device with syntax verification capabilities (such as a syntax validator). Similarly, this application does not limit the implementation method of semantic verification; for example, it can be implemented using a pre-built device with semantic verification capabilities (such as a semantic validator). Furthermore, in some scenarios, since the time consumption of syntax verification < the time consumption of semantic verification < the time consumption of behavioral verification, to improve efficiency, syntax verification, semantic verification, and behavioral verification can be performed sequentially to remove flawed attack samples as early as possible.

[0115] Research has revealed that in some scenarios, certain attack payloads are prone to syntactic defects, so these attack payloads can be quickly removed using syntactic verification; some attack payloads are prone to semantic defects, so these attack payloads can be quickly removed using semantic verification; and some attack payloads are prone to failing to cause substantial attacks on a second object, so these attack payloads can be quickly removed using behavioral verification.

[0116] Based on the above research, in one possible implementation, the verification result can at least satisfy the following constraints: In response to the second attack sample satisfying a first condition (such as the condition satisfied by an attack payload suitable for rapid verification using syntax validation), the verification result includes a score corresponding to the syntax validation, so that the score can be used to quickly identify whether the second attack sample has defects; in response to the second attack sample satisfying a second condition (such as the condition satisfied by an attack payload suitable for rapid verification using semantic validation), the verification result includes a score corresponding to the semantic validation, so that the score can be used to quickly identify whether the second attack sample has defects; in response to the second attack sample satisfying a third condition (such as the condition satisfied by an attack payload suitable for rapid verification using behavioral validation), the verification result includes a score corresponding to the attack effect verification (such as behavioral verification), so that the score can be used to quickly identify whether the second attack sample has defects, thus improving verification efficiency.

[0117] It should be noted that the above attack effect verification is configured to verify whether an attack payload can cause a substantial attack against a second object; and this application does not limit the implementation method of the attack effect verification. For example, the attack effect verification can be implemented using the above behavior verification.

[0118] Based on the above two paragraphs, in some scenarios, for bypass samples (such as any second attack sample), if the bypass sample meets the pre-set first condition, it can be determined that the bypass sample is prone to syntax errors. Therefore, only syntax verification needs to be performed on the bypass sample, which is beneficial for quickly deleting attack samples with syntax defects. If the bypass sample meets the pre-set second condition, it can be determined that the bypass sample is prone to semantic errors. Therefore, only semantic verification needs to be performed on the bypass sample, which is beneficial for quickly deleting attack samples with semantic defects. If the bypass sample meets the pre-set third condition, it can be determined that the bypass sample is prone to failing to cause substantial attacks on the second object. Therefore, only behavioral verification needs to be performed on the bypass sample, which is beneficial for quickly deleting attack samples that do not have offensive capabilities. This allows for flexible identification of the validity of bypass samples using a certain verification method, thereby improving efficiency.

[0119] Based on the above verification process, it is known that, in one possible implementation, the method for updating the security protection strategy provided in this application may include at least the following steps: verifying the second attack sample to obtain a verification result, such that the verification result includes a score corresponding to at least one verification method, wherein the at least one verification method includes at least a portion of syntax verification, semantic verification, and attack effect verification (such as behavior verification), thereby enabling the verification result to indicate whether the second attack sample has syntax errors, whether it has semantic errors, and whether it can cause an attack on the second object; in response to the fact that the scores corresponding to each of the at least one verification method are not lower than a preset threshold, it can be determined that the second attack sample is effective, and thus the test result of the second attack sample under the first security protection strategy is obtained, thereby improving efficiency by using at least one verification method in a coordinated manner.

[0120] Research has shown that different types of attack payloads may be suitable for different verification devices (such as syntax verifiers, semantic verifiers, behavior verifiers, etc.).

[0121] Based on the above research, in one possible implementation, the security protection strategy update method provided in this application may include at least the following steps: identifying the attack type of the second attack sample to obtain an identification result, so that the identification result can indicate which attack type the second attack sample belongs to; using the device corresponding to the identification result (such as a syntax validator, semantic validator, behavior validator, etc.) to verify the second attack sample to obtain a verification result, so that the verification result can more accurately indicate whether the second attack sample is valid, thereby improving the verification accuracy and overcoming the defects caused by the relatively low verification accuracy.

[0122] Research has shown that if a bypass sample is not effective, it is unlikely to cause a substantial attack on the second target, thus rendering it unworthy of study in terms of security protection.

[0123] Based on the above research, in one possible implementation, in order to improve efficiency, the security protection strategy update method provided in this application may further include the following steps: in response to the above verification result indicating that the second attack sample is not valid (such as the verification method with a score lower than a preset threshold in at least one of the above verification methods), it can be determined that the second attack sample will not cause any attack on the second object protected by the first object. Therefore, the second attack sample can be directly deleted, and subsequent steps (such as testing processes) will no longer be performed on the second attack sample, so as to better avoid the interference caused by such defective attack payloads.

[0124] Research has shown that if a bypass sample is not valid, it indicates that the performance of the machine learning model that generated the bypass sample may need further improvement.

[0125] Based on the above research, in one possible implementation, in order to better improve the generation effect, the security protection strategy update method provided in this application may include at least the following steps: In response to the above verification result indicating that the second attack sample is not effective (such as the verification method with a score lower than a preset threshold in at least one of the above verification methods), it can be determined that the performance of the first model used to generate the second attack sample may have some limitations. Therefore, in order to overcome this limitation, the first model can be updated based on the second attack sample so that the updated first model can overcome this limitation as much as possible, so as to ensure that the first model generates as few defective attack samples as possible, thereby facilitating the faster discovery of the protection weaknesses of the first object.

[0126] Research has found that if a bypass sample is not valid, it indicates that the prompts corresponding to the machine learning model that generated the bypass sample may have some defects.

[0127] Based on the above research, in one possible implementation, in order to better improve the generation effect, the security protection strategy update method provided in this application may include at least the following steps: In response to the above verification result indicating that the second attack sample is not valid (such as the above at least one verification method having a score lower than a preset threshold, etc.), it can be determined that the prompt words corresponding to the first model used to generate the second attack sample may have some defects. Therefore, in order to overcome such defects, the input data (such as prompt words) of the first model can be adjusted based on the second attack sample to continue to execute the above steps of generating the second attack sample and its subsequent steps. In this way, the failure sample can be used as a guide to affect the generation process of the first model, so as to ensure that the first model generates as few defective attack samples as possible, thereby facilitating the faster discovery of the protection weaknesses of the first object.

[0128] Based on the above verification process, it can be seen that in some scenarios, for multiple second attack samples generated by the first model, the verification process performed on these second attack samples (such as by...) Figure 2 or Figure 3 The verification process implemented by the verification system shown may include some or all of the following five features.

[0129] Feature 1: It uses a pre-built attack type classifier to identify the attack type of each second attack sample generated by the first model, so that the subsequent verification devices, such as syntax validators, semantic validators, and behavior validators, can be used based on the identification results.

[0130] Feature 2: Syntax / grammar verification is performed for each second attack sample. Specifically, a pre-built syntax parser or regular expression / syntax tree is used to check whether the syntax of the attack payload (such as each second attack sample) is compliant, so as to quickly eliminate obviously invalid or malformed attack payloads.

[0131] Feature 3: Performs semantic verification (static semantics) on each second attack sample, specifically: statically checks whether there is valid semantics in the attack payload (such as each second attack sample).

[0132] Feature 4: Behavioral verification is performed for each second attack sample. Specifically, the attack payload (such as each second attack sample) is "experimentally executed" or injected into a simulated vulnerable application within a strictly isolated sandbox / container / virtual network to observe the actual effect (whether the script is triggered, etc.).

[0133] Feature 5: Each second attack sample is scored, specifically: a credibility score is given for the attack payload (as described above), so that the score can indicate whether the attack payload successfully passes syntax validation, semantic validation, and behavioral validation. Specifically, if the score for syntax validation is below threshold 1, it can be determined that the attack payload has failed the syntax validation, thus determining that the attack payload is invalid; if the score for semantic validation is below threshold 2, it can be determined that the attack payload has failed the semantic validation, thus determining that the attack payload is invalid; and if the score for behavioral validation is below threshold 3, it can be determined that the attack payload has failed the behavioral validation, thus determining that the attack payload is invalid.

[0134] Feature 6: Use failed samples (such as attack payloads that do not have effectiveness) to correct the prompt words of the first model or use failed samples to supervise the training of the first model.

[0135] Based on the security protection strategy updating method provided in the embodiments of this application, the embodiments of this application also provide a security protection strategy updating device, which is described below in conjunction with... Figure 4 Explanation and clarification will be provided. Among them, Figure 4This is a schematic diagram of a security protection strategy updating device provided in an embodiment of this application. It should be noted that for technical details of the security protection strategy updating device provided in this embodiment, please refer to the relevant content of the security protection strategy updating method described above.

[0136] like Figure 4 As shown, the security protection strategy updating device 400 provided in this application embodiment includes:

[0137] The first generation unit 401 is used to generate a second attack sample based on the first security protection strategy of the first object and the first attack sample corresponding to the first security protection strategy using the first model.

[0138] The first acquisition unit 402 is used to acquire the test results of the second attack sample under the first security protection strategy;

[0139] The second generation unit 403 is used to generate a second security protection strategy based on the second attack sample using a second model in response to the test result indicating that the second attack sample bypasses the first security protection strategy.

[0140] The first update unit 404 is used to update the first security protection policy of the first object based on the second security protection policy.

[0141] In one possible implementation, the first generation unit 401 is specifically used to: generate a plurality of the second attack samples;

[0142] The second generation unit 403 is specifically configured to: respond to the test result indicating that there is at least one sample among the multiple second attack samples that bypasses the first security protection strategy, cluster the at least one sample that bypasses the first security protection strategy to obtain at least one sample set, and different sample sets correspond to different categories; and generate a second security protection strategy corresponding to each sample set using the second model.

[0143] In one possible implementation, the second generation unit 403 is specifically configured to: obtain the analysis results of the at least one sample that bypasses the first security protection strategy, the analysis results indicating the distribution state of the at least one sample that bypasses the first security protection strategy in at least one dimension, the at least one dimension including the attack principle; and cluster the at least one sample that bypasses the first security protection strategy based on the analysis results.

[0144] In one possible implementation, the first generation unit 401 is specifically used to: generate a plurality of the second attack samples;

[0145] The first acquisition unit 402 is specifically used to: acquire the test results of multiple second attack samples under the first security protection strategy;

[0146] The second generation unit 403 is specifically configured to: in response to the test result indicating that there is at least one sample among the plurality of second attack samples that bypasses the first security protection strategy, select a sample from the at least one sample that bypasses the first security protection strategy, and generate the second security protection strategy based on the selected sample using the second model;

[0147] The first updating unit 404 is specifically used to: update multiple second attack samples based on other samples besides the selected sample among the at least one sample that bypasses the first security protection strategy; update the first security protection strategy of the first object based on the second security protection strategy; and return to the first acquisition unit 402 to continue executing the step of acquiring the test results of multiple second attack samples under the first security protection strategy until the test results indicate that there are no samples among the multiple second attack samples that bypass the first security protection strategy.

[0148] In one possible implementation, the security protection strategy updating device 400 further includes:

[0149] The verification unit is used to verify the second attack sample and obtain the verification result;

[0150] The first acquisition unit 402 is specifically used to: in response to the verification result indicating that the second attack sample is valid, acquire the test result of the second attack sample under the first security protection strategy.

[0151] In one possible implementation, the verification result includes a score corresponding to at least one verification method, wherein the at least one verification method includes at least some of syntax verification, semantic verification, and attack effect verification.

[0152] The first acquisition unit 402 is specifically used to: in response to the fact that the scores corresponding to each of the at least one verification method are not lower than a preset threshold, acquire the test results of the second attack sample under the first security protection strategy.

[0153] In one possible implementation, in response to the second attack sample satisfying a first condition, the verification result includes a score corresponding to syntax verification; in response to the second attack sample satisfying a second condition, the verification result includes a score corresponding to semantic verification; in response to the second attack sample satisfying a third condition, the verification result includes a score corresponding to attack effect verification.

[0154] In one possible implementation, the verification unit is specifically used to: identify the attack type of the second attack sample to obtain an identification result; and verify the second attack sample using the device corresponding to the identification result.

[0155] In one possible implementation, the security protection strategy updating device 400 further includes at least one of the following:

[0156] The deletion unit is configured to delete the second attack sample in response to the verification result indicating that the second attack sample is invalid.

[0157] The second update unit is used to update the first model based on the second attack sample in response to the verification result indicating that the second attack sample is invalid.

[0158] The third update unit is used to adjust the input data of the first model based on the second attack sample in response to the verification result indicating that the second attack sample is invalid, so as to continue to execute the step of generating the second attack sample.

[0159] In one possible implementation, the security protection strategy updating device 400 satisfies at least one of the following constraints: the first object is a web application firewall or an intrusion prevention system; both the first model and the second model are large language models; the second attack sample is a variant of the first attack sample; both the first attack sample and the second attack sample are attack payloads; and the test result is obtained by detecting the second attack sample using the first object based on the first security protection strategy.

[0160] In one possible implementation, the security protection strategy update device 400 is embedded inside the first object.

[0161] Based on the aforementioned content regarding the security protection strategy update device 400, the working principle of the device 400 includes: for a first object (such as a WAF, IPS, or other security products), when the first security protection strategy of the first object can detect and intercept the first attack sample, a first model is first used to generate a second attack sample (such as a variant of the first attack sample) based on the first security protection strategy and the first attack sample, so that there are some differences between the second attack sample and the first attack sample (such as different attack methods); then, the test results of the second attack sample under the first security protection strategy are obtained, so that when the test results indicate that the second attack sample can bypass the first security protection strategy, it can be determined that the attack is based on the first security protection strategy. The first object being protected cannot detect or intercept the second attack sample, thus it can be determined that the second attack sample reveals a vulnerability in the first object's own protection. Therefore, a second model is used to generate a second security protection strategy based on the second attack sample, so that the second security protection strategy can indicate how to detect and intercept the second attack sample, and the first security protection strategy of the first object is updated based on the second security protection strategy, so that the updated first object can not only successfully detect and intercept the first attack sample, but also detect and intercept the second attack sample, thereby enabling the updated first object to overcome the vulnerability. In this way, the protection performance of the first object can be optimized through an automated process, overcoming the defects that exist when the protection performance is optimized manually.

[0162] In addition, this application embodiment also provides an electronic device, the device including a processor and a memory: the memory is used to store instructions or computer programs; the processor is used to execute the instructions or computer programs in the memory, so that the electronic device performs any implementation of the security protection strategy update method provided in this application embodiment.

[0163] See Figure 5 This diagram illustrates a structural schematic of an electronic device 500 suitable for implementing embodiments of the present disclosure. The terminal devices in these embodiments may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0164] like Figure 5As shown, electronic device 500 may include a processing unit (e.g., central processing unit, graphics processor, etc.) 501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 502 or a program loaded from storage device 508 into random access memory (RAM) 503. RAM 503 also stores various programs and data required for the operation of electronic device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. Input / output (I / O) interface 505 is also connected to bus 504.

[0165] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0166] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, it performs the functions defined in the methods of embodiments of this disclosure.

[0167] The electronic device provided in this embodiment belongs to the same inventive concept as the method provided in the above embodiments. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0168] This application also provides a computer-readable medium storing instructions or computer programs that, when executed on a device, cause the device to perform any implementation of the security protection strategy update method provided in this application.

[0169] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0170] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0171] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0172] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, enable the electronic device to perform the aforementioned methods.

[0173] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0174] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. 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 indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated 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 the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0175] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units / modules do not necessarily limit the specific unit itself.

[0176] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.

[0177] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0178] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems or apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and relevant parts can be referred to the method section.

[0179] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0180] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0181] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0182] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for updating a security protection strategy, characterized in that, The method includes: A second attack sample is generated using a first model based on a first security protection strategy and a first attack sample corresponding to the first security protection strategy. Obtain the test results of the second attack sample under the first security protection strategy; In response to the test results indicating that the second attack sample bypasses the first security protection strategy, a second security protection strategy is generated based on the second attack sample using a second model. The first security protection strategy is updated based on the second security protection strategy.

2. The method according to claim 1, characterized in that, The generation of the second attack sample includes: generating multiple second attack samples; The step of generating a second security protection strategy based on the second attack sample using a second model in response to the test result indicating that the second attack sample bypasses the first security protection strategy includes: in response to the test result indicating that at least one sample among the multiple second attack samples bypasses the first security protection strategy, clustering the at least one sample that bypasses the first security protection strategy to obtain at least one sample set, with different sample sets corresponding to different categories; and generating a second security protection strategy corresponding to each sample set using the second model.

3. The method according to claim 2, characterized in that, The method further includes: obtaining the analysis results of the at least one sample that bypasses the first security protection strategy, wherein the analysis results indicate the distribution state of the at least one sample that bypasses the first security protection strategy in at least one dimension, wherein the at least one dimension includes the attack principle; The step of clustering the at least one sample that bypasses the first security protection strategy includes: clustering the at least one sample that bypasses the first security protection strategy based on the analysis results.

4. The method according to claim 1, characterized in that, The generation of the second attack sample includes: generating multiple second attack samples; The step of obtaining the test results of the second attack sample under the first security protection strategy includes: obtaining the test results of multiple second attack samples under the first security protection strategy; The step of generating a second security protection strategy based on the second attack sample using a second model in response to the test result indicating that the second attack sample bypasses the first security protection strategy includes: in response to the test result indicating that at least one sample among the plurality of second attack samples bypasses the first security protection strategy, selecting a sample from the at least one sample that bypasses the first security protection strategy, generating a second security protection strategy based on the selected sample using the second model, and updating the plurality of second attack samples based on other samples among the at least one sample that bypasses the first security protection strategy besides the selected sample; After updating the first security protection strategy based on the second security protection strategy, the method further includes: continuing to execute the step of obtaining test results of multiple second attack samples under the first security protection strategy until the test results indicate that there are no samples among the multiple second attack samples that bypass the first security protection strategy.

5. The method according to claim 1, characterized in that, The method further includes: verifying the second attack sample to obtain a verification result; The step of obtaining the test results of the second attack sample under the first security protection strategy includes: in response to the verification result indicating that the second attack sample is valid, obtaining the test results of the second attack sample under the first security protection strategy.

6. The method according to claim 5, characterized in that, The verification result includes a score corresponding to at least one verification method, wherein the at least one verification method includes at least some of the following: syntax verification, semantic verification, and attack effect verification. The step of obtaining the test results of the second attack sample under the first security protection strategy in response to the verification result indicating that the second attack sample is valid includes: obtaining the test results of the second attack sample under the first security protection strategy in response to the fact that the scores corresponding to each of the at least one verification method are not lower than a preset threshold.

7. The method according to claim 5, characterized in that, In response to the second attack sample satisfying the first condition, the verification result includes a score corresponding to the syntax check; In response to the second attack sample satisfying the second condition, the verification result includes a score corresponding to the semantic verification. In response to the second attack sample satisfying the third condition, the verification result includes a score corresponding to the attack effect verification.

8. The method according to claim 5, characterized in that, The method further includes: identifying the attack type of the second attack sample to obtain an identification result; The verification of the second attack sample includes: verifying the second attack sample using the device corresponding to the identification result.

9. The method according to claim 5, characterized in that, The method further includes at least one of the following: In response to the verification result indicating that the second attack sample is invalid, the second attack sample is deleted; In response to the verification result indicating that the second attack sample is invalid, the first model is updated based on the second attack sample; In response to the verification result indicating that the second attack sample is invalid, the input data of the first model is adjusted based on the second attack sample to continue the step of generating the second attack sample.

10. The method according to any one of claims 1-9, characterized in that, The first object is configured to utilize the first security protection strategy to implement the security protection process; The method satisfies at least one of the following constraints: The first object is a web application firewall or intrusion prevention system; Both the first model and the second model are large language models; The second attack sample is a variant of the first attack sample; Both the first attack sample and the second attack sample are attack payloads; The test results were obtained by using the first object to detect the second attack sample based on the first security protection strategy.

11. A device for updating a security protection strategy, characterized in that, include: The first generation unit is used to generate a second attack sample based on a first security protection strategy and a first attack sample corresponding to the first security protection strategy using a first model. The first acquisition unit is used to acquire the test results of the second attack sample under the first security protection strategy; The second generation unit is used to generate a second security protection strategy based on the second attack sample using a second model in response to the test result indicating that the second attack sample bypasses the first security protection strategy. The first update unit is used to update the first security protection policy based on the second security protection policy.

12. An electronic device, characterized in that, The device includes: a processor and a memory; The memory is used to store instructions or computer programs; The processor is configured to execute the instructions or computer program in the memory to cause the electronic device to perform the method according to any one of claims 1-10.

13. A computer-readable medium, characterized in that, The computer-readable medium stores instructions or computer programs that, when executed on the device, cause the device to perform the method according to any one of claims 1-10.

14. A computer program product, characterized in that, It includes a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the method according to any one of claims 1-10.

Citation Information

Patent Citations

  • Network security protection system and algorithm based on simulation attack strategy

    CN113225347A