A security policy compilation, centralized control, and forwarding parallel method and device
By counting the repeated rule items in the security policy information, it is divided into policy templates and decision trees, and a classification compilation method is used to solve the problem of slow compilation speed in the existing technology and improve the compilation efficiency and implementation speed of network security policies.
Patent Information
- Application Number
- CN202410850503.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-06-27
AI Technical Summary
As network scale and threat complexity increase, existing compilation algorithms are slow to compile security policies and take a long time to compile, resulting in low network security policy implementation efficiency.
By counting the repeated rule items in the security policy information, it is divided into policy templates and decision trees, and a classification compilation method is used to reduce the depth and number of nodes of the decision tree and improve compilation efficiency.
It significantly reduces the overall machine compilation time of security policies, improves parsing efficiency and device throughput, and ensures the rapid implementation of network security policies.
Smart Images

Figure CN118400200B
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security technology, and in particular to a method and device for compiling, centrally controlling, and forwarding security policies in parallel. Background Art
[0002] Network security convergence equipment is usually deployed at the entrance and exit of the core network to provide comprehensive security protection for the entire network. With the continuous expansion of network scale and network traffic, various network applications and network attacks emerge in an endless stream, and the threats to network security are becoming increasingly complex and diverse.
[0003] In this environment, the number of security policies of network security convergence equipment becomes a crucial indicator. In the field of network security, security policy is to filter the messages in and out of the network according to the rules configured by the user, and adopt specific filtering strategies according to the different matched security policies.
[0004] Security policies usually consist of fields such as source IP address, destination IP address, port number, protocol, etc. However, the fields of each security policy form a multi-dimensional data, and there is usually no particularly good way to process multi-dimensional data, and the splitting of certain fields will also cause the expansion of the number of security policies.
[0005] High-configuration network security convergence devices usually support 100,000-level security policies. Network security convergence devices need to compile the rules or definitions of security policies into a form that can be directly used by network security convergence devices. This compilation process can ensure the consistency and accuracy of security policies, thereby effectively implementing security policies in network security convergence devices.
[0006] However, as the magnitude of security policies increases, using existing compilation algorithms to compile security policies will lead to problems such as slow compilation speed and long compilation time. Summary of the invention
[0007] In order to overcome the problems existing in the related art, the present application provides a method and device for compiling, centrally controlling, and forwarding security policies in parallel.
[0008] According to a first aspect of any embodiment of the present application, a method for compiling, centrally controlling, and forwarding security policies in parallel is provided, the method comprising:
[0009] Counting the number of repetitions of each rule item in all security policy information, and classifying the rule items whose number of repetitions falls within a preset number range as policy templates;
[0010] Classifying the security policy information that hits the policy template as first policy information corresponding to the policy template;
[0011] Classifying the security policy information that does not match the policy template as second policy information corresponding to the decision tree;
[0012] The first policy information and the second policy information are classified and compiled to obtain a compilation result; wherein the second policy information is compiled in a manner of the decision tree.
[0013] According to a second aspect of any embodiment of the present application, a parallel device for compiling, centrally controlling, and forwarding security policies is provided, the device comprising:
[0014] A policy template division module is used to count the number of repetitions of each rule item in all security policy information, and divide the rule items whose number of repetitions meets a preset number range into policy templates;
[0015] A policy template classification module, used to classify the security policy information that hits the policy template as the first policy information corresponding to the policy template;
[0016] A decision tree classification module, used to classify the security policy information that does not hit the policy template as second policy information corresponding to the decision tree;
[0017] The security policy processing module is used to classify and compile the first policy information and the second policy information to obtain a compilation result; wherein the second policy information is compiled by means of the decision tree.
[0018] According to a third aspect of any embodiment of the present application, there is provided an electronic device, including:
[0019] processor;
[0020] a memory for storing processor-executable instructions;
[0021] The processor implements the method described in any embodiment of the present application by running the executable instructions.
[0022] According to a fourth aspect of any embodiment of the present application, a computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, the method described in any embodiment of the present application is implemented.
[0023] According to a fifth aspect of any embodiment of the present application, a computer program product is provided, on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the method described in any embodiment of the present application is implemented.
[0024] The technical solution provided by this application may have the following beneficial effects:
[0025] According to the above embodiments, by counting the number of repetitions of each rule item in all security policy information, the rule items whose number of repetitions meets the preset number range are divided into policy templates, and the security policy information that hits the rule items in the policy template is classified as the first policy information corresponding to the policy template, and the security policy information that does not hit the rule items is classified as the second policy information corresponding to the decision tree. The depth and the number of nodes of the decision tree can be reduced, and the first policy information and the second policy information are classified and compiled to obtain the compilation result. By classifying and compiling the first policy information corresponding to the policy template and the second policy information corresponding to the decision tree, the compilation time of the whole machine policy is greatly reduced, the parsing efficiency of the security policy information is effectively improved, and the throughput of the whole device is improved.
[0026] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The accompanying drawings, which are incorporated in the specification and constitute a part of this application, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.
[0028] Figure 1 It is a flowchart of a parallel method for compiling, centrally controlling, and forwarding a security policy according to an exemplary embodiment of the present application;
[0029] Figure 2 is a schematic diagram of a compilation security strategy according to an exemplary embodiment of the present application;
[0030] Figure 3 is a flow chart of a centralized management and control method of compilation results according to an exemplary embodiment of the present application;
[0031] Figure 4 is a schematic diagram of a centralized control compilation result according to an exemplary embodiment of the present application;
[0032] Figure 5 is a schematic diagram of forwarding parallel service messages according to an exemplary embodiment of the present application;
[0033] Figure 6 It is a flowchart of another parallel method for compiling, centrally controlling, and forwarding security policies according to an exemplary embodiment of the present application;
[0034] Figure 7 is a structural schematic diagram of an electronic device according to an exemplary embodiment of the present application;
[0035] Figure 8It is a block diagram of a parallel device for compiling, centrally controlling, and forwarding security policies according to an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0036] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0037] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0038] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0039] At present, due to the increasing magnitude of security policies, using existing compilation algorithms to compile security policies will lead to problems such as slow compilation speed and long compilation time.
[0040] In order to solve the above problems, the present application proposes a security policy compilation, centralized control, and forwarding parallel method. Before introducing the method, in order to make the description of the method easier to understand, some concepts involved in the subsequent description of the embodiments of the present application are first explained:
[0041] 1) Security Policy
[0042] Security policies are used to control network traffic and protect the network from unauthorized access or malicious attacks. Through security policies, users can define rules to check the source address, destination address, port number, protocol type and other information of data packets, and make decisions on whether to allow or deny data packets based on this information.
[0043] 2) Main control board
[0044] The main control board is used for whole machine configuration management and some complex business processing.
[0045] 3) Business board
[0046] The service board is a board that implements various network services, security services and application functions and can be inserted into frame-type devices.
[0047] 4) Cloud Board
[0048] The cloud board is a logical business board virtualized from multiple business boards.
[0049] 5) Interface board
[0050] The interface board is a single board implemented by a switching chip that receives external messages, processes them, and performs layer 2 or layer 3 forwarding.
[0051] 6) Decision Tree
[0052] A decision tree is a tree-based data structure used to solve classification and regression problems. At each node, the data is split into smaller subsets based on the condition of the feature until the final decision node is reached.
[0053] 7) Hash Table
[0054] Hash tables are used to implement mapping relationships between key-value pairs. They map the key to an index position in an array of a fixed size after being processed by a hash function, and store the value at that position. Hash tables have the characteristics of fast search, insertion, and deletion operations, and are suitable for scenarios that require efficient search.
[0055] To further illustrate the present application, the following examples are provided:
[0056] See also Figure 1 , Figure 1 The present application is a flowchart of a security policy compilation, centralized control, and forwarding parallel method according to an exemplary embodiment. The security policy compilation, centralized control, and forwarding parallel method can be applied to network security fusion equipment, which is used to process security policies to protect the network, such as routers, firewalls, and other devices.
[0057] The method may include the following steps:
[0058] Step 102: Count the number of repetitions of each rule item in all security policy information, and classify the rule items whose number of repetitions meets a preset number range as policy templates.
[0059] In this step, the user can log in to the main control board in the network security fusion device to configure security policy information through the web page, Telnet or Secure Shell (SSH). The network security fusion device can count the number of repetitions of each rule item in all security policy information configured by the user.
[0060] The security policy information is the user's configuration information for the security policy. The rule item is the policy field in the security policy information, such as a source IP (Internet Protocol) address, a destination IP address, a port number, etc. The number of repetitions is the number of repetitions of the rule item in the entire security policy information.
[0061] The network security fusion device can divide one or more rule items whose repetition quantity falls within a preset quantity range into a policy template.
[0062] The preset number range is used to divide the rule items in the policy template, for example: a range exceeding a preset threshold, a preset ratio exceeding the number of policies corresponding to all security policy information, and the like.
[0063] A policy template is a hash template stored in a hash table and is used to classify and store security policy information that matches the rule items in the policy template.
[0064] The number of repetitions in the policy template is within the preset range, for example: fixed mask source IP address + fixed mask destination IP address, fixed mask source IP address + any destination IP address, any source IP address + fixed mask destination IP address, etc.
[0065] Step 104: Classify the security policy information that hits the policy template as the first policy information corresponding to the policy template.
[0066] In this step, the main control board classifies all security policy information based on the policy template and matches all security policy information with the rule items in the policy template. If the match is successful, it means that the policy template is hit.
[0067] The main control board classifies the security policy information that hits the policy template among all the security policy information as the first policy information corresponding to the policy template. The first policy information that hits the policy template is stored in the policy template.
[0068] The first policy information is security policy information of a rule item in a matching policy template.
[0069] Step 106: Classify the security policy information that does not match the policy template as the second policy information corresponding to the decision tree.
[0070] In this step, the main control board classifies the security policy information that does not match the policy template among all the security policy information as the second policy information corresponding to the decision tree.
[0071] The second policy information is security policy information of a rule item in a missed policy template.
[0072] Step 108: Classify and compile the first policy information and the second policy information to obtain a compilation result; wherein the second policy information is compiled in a decision tree manner.
[0073] In this step, the main control board can classify and compile the first policy information and the second policy information. The main control board parses the first policy information in the policy template, converts it into a form that the network security fusion device can understand and execute, and stores the compiled result in the policy template.
[0074] The main control board constructs a decision tree according to the characteristics of the second strategy information in a decision tree manner. Each node of the decision tree represents a decision point or condition, and each branch represents a possible result or action of the condition.
[0075] According to the selected features, the main control board divides the data set of the second policy information into multiple subsets. Each subset represents a specific condition or rule. For each subset, the main control board repeats the steps of feature selection and data set division to recursively build a subtree.
[0076] The main control board compiles the constructed decision tree into a form that the network security fusion device can understand and execute, thereby obtaining the compilation results corresponding to all security policy information. The main control board will send the compilation results obtained after user-mode compilation to the kernel, and at the same time, send the compilation results to the business board through centralized management and control, forward the received business messages to each business board in parallel, and each business board will process the business messages based on the compilation results.
[0077] Furthermore, the main control board can use multi-threading technology to classify and compile the first policy information and the second policy information in parallel, and simultaneously compile the first policy information classified as corresponding to the policy template and the second policy information classified as corresponding to the decision tree to obtain the compilation results, further shortening the compilation time of the security policy and speeding up the compilation efficiency.
[0078] The compilation result is a rule set obtained by compiling the security policy information.
[0079] See also Figure 2 , Figure 2A schematic diagram of compiling a security policy is shown. First, the user configures the security policy, and the network security fusion device receives the security policy information configured by the user. The network security fusion device can perform security policy preprocessing such as checking data integrity, processing missing values, and standardization on the security policy information.
[0080] Exemplarily, the network security fusion device can use more than half of the number of policies in the security policy information as the preset number range. The network security fusion device counts the number of repetitions of each rule item in the security policy information configured by the user, and divides the rule items whose repetition numbers meet the preset number range into policy templates.
[0081] The policy templates include: a first policy template 201, a second policy template 202, a third policy template 203 and several policy templates.
[0082] Among them, the rule item of the first policy template 201 is the source IP address with a fixed mask + the destination IP address with a fixed mask, the rule item of the second policy template 202 is the source IP address with a fixed mask + any destination IP address (Any), and the rule item of the third policy template 203 is any source IP address (Any) + the destination IP address with a fixed mask.
[0083] The main control board classifies all security policy information. The main control board classifies the security policy information that hits the first policy template 201 as the first policy information corresponding to the first policy template 201. The main control board classifies the security policy information that hits the second policy template 202 as the first policy information corresponding to the second policy template 202.
[0084] The main control board classifies the security policy information that hits the third policy template 203 as the first policy information corresponding to the third policy template 203 , and classifies the security policy information that does not hit the policy template as the second policy information corresponding to the decision tree 204 .
[0085] The main control board uses multi-threading technology to classify and compile the first policy information corresponding to each policy template and the second policy information corresponding to the decision tree 204 in parallel to obtain the compilation result of the security policy information.
[0086] The security policy compilation, centralized control, and forwarding parallel method of the present embodiment counts the number of repetitions of each rule item in all security policy information, divides the rule items whose number of repetitions meets a preset number range into policy templates, and classifies the security policy information that hits the rule items in the policy template as the first policy information corresponding to the policy template, and classifies the security policy information that does not hit the rule items as the second policy information corresponding to the decision tree. This can reduce the depth and number of nodes of the decision tree, classify and compile the first policy information and the second policy information to obtain a compilation result, and by classifying and compiling the first policy information classified as corresponding to the policy template and the second policy information classified as corresponding to the decision tree, the compilation time of the entire machine policy is greatly reduced, the parsing efficiency of the security policy information is effectively improved, and the throughput of the entire device is improved.
[0087] In the above embodiment, the first policy information corresponding to the policy template and the second policy information corresponding to the decision tree are classified and compiled to obtain the compilation result. In the following embodiment, how to issue the compilation result is described in detail and can be applied to any of the above embodiments.
[0088] In one embodiment, the network security fusion device generally includes a main control board, an interface board, and multiple service boards. After the main control board compiles the security policy information, it is necessary to send the compilation results to multiple service boards for storage.
[0089] See also Figure 3 , Figure 3 A flowchart of a method for centralized management and control of compilation results is shown. The method for centralized management and control of compilation results may include the following steps:
[0090] Step 302: executing the calling function corresponding to the policy delivery function, and centrally managing the function information of the policy delivery function in the kernel information queue of the main control board; wherein the function information includes: compilation result.
[0091] In this step, the main control board centrally controls the process of issuing compilation results. When the compilation results need to be issued, the framework in the main control board can execute the calling function corresponding to the policy issuing function, and store and centrally control the function information of the policy issuing function in the kernel information queue of the main control board.
[0092] The policy delivery function is a function in the business board used to store the compilation result. Function information is information required to store the compilation result, including: the compilation result.
[0093] Function information may also include the function type and identification information of the policy delivery function. Function types include, but are not limited to, blocking, non-blocking, important, and unimportant. Identification information is used by the business board to identify the policy delivery function that the main control board will call, such as process identifier (PID) and other information.
[0094] Step 304: Send the function information in the kernel information queue to the service board through multi-channel threads.
[0095] In this step, the main control board can act as a client and loop through the kernel information queue. If a calling function is executed, the function information is obtained from the queue node of the kernel information queue, and the function type and identification information in the function information are parsed. The function information is distributed to the specified channel thread, which is sent to each business board by the channel thread.
[0096] By sending compilation results based on multi-channel threads, the execution efficiency from the main control board to the business board can be improved, avoiding congestion in one channel causing packet loss due to the main control board packet sending queue or the business board packet receiving queue being full, and improving the accuracy of sending compilation results.
[0097] Step 306: Execute the policy delivery function in the service board and store the compilation result.
[0098] In this step, the business board can act as a server, create a subthread in advance according to the business type, and block and wait for the policy delivery function to be called. When the business board receives the function information sent by the main control board, it calls the policy delivery function corresponding to the identification information according to the identification information in the function information.
[0099] The business board uses the compilation result in the function information as the input parameter of the policy delivery function. The business board executes the policy delivery function and stores the compilation result.
[0100] If the policy delivery function has a return value, the business board sends the return value of the policy delivery function to the main control board. The main control board receives the return value of the business board and sets it to the kernel. The main control board obtains the return value from the kernel and uses the return value as an output parameter for use by the business process.
[0101] The return value can be used to identify the execution result of the policy delivery function, and can also be used to identify the execution result of the calling function.
[0102] See also Figure 4 , Figure 4A schematic diagram of centralized management and control of compilation results is shown. The kernel information queue in the main control board includes: a first queue node 401, a second queue node 402 and a plurality of queue nodes FQ. T1 and T2 represent channel threads, and the second queue node 402 stores function information B1T2 and function information B2T2.
[0103] The main control board executes the first calling function Ufunc1, and stores the function information of the policy issuing function corresponding to the first calling function Ufunc1 in the first queue node 401. The main control board executes the second calling function Ufunc2, and stores the function information of the policy issuing function corresponding to the second calling function Ufunc2 in the second queue node 402.
[0104] The main control board can send the function information in the first queue node 401 to the business B1 and the business board B2 through the channel thread T1. At the same time, the main control board sends the function information B1T2 in the second queue node 402 to the business board B1 through the channel thread T2, and the main control board sends the function information B2T2 in the second queue node 402 to the business board B2 through the channel thread T2.
[0105] As described above, by executing the calling function corresponding to the policy delivery function, the function information of the policy delivery function is centrally controlled in the kernel information queue of the main control board, and the function information in the kernel information queue is sent to the business board through multi-channel threads, and the policy delivery function in the business board is executed, and the compilation results are stored. The delivery process of the compilation results is centrally controlled, and there is no need to consider the logic implemented by the policy delivery function calling process, thereby reducing the complexity of the delivery code implementation, avoiding the configuration of compilation results according to different business boards, simplifying the delivery process of the compilation results, and enabling security policies to be quickly delivered to the business board and take effect, thereby reducing the error probability of delivering the compilation results; and, in the case of a large number of existing security policies, even if the security policy information changes, the security policy information can take effect quickly without affecting the forwarding performance.
[0106] In the above-mentioned embodiment, it is introduced that the calling function corresponding to the function is issued by executing the policy, and the function information in the kernel information queue is issued to the business board through multi-channel threads, and the business board stores the compilation result. In the following embodiment, how to forward the received business message to multiple business boards in parallel will be described in detail, and it can be applied to any of the above embodiments.
[0107] In one embodiment, one or more cloud boards may be configured in the network security fusion device. The cloud board is composed of multiple service boards in a virtual manner. The cloud board has extremely high service processing capabilities. All service messages are evenly processed among multiple service boards in the cloud board. The cloud board processing capacity is the sum of the processing capacity of all member boards, without any loss, and all service boards can forward parallel service traffic.
[0108] The main control board sends the identification information of each business board in the cloud board to the forwarding chip. The business message coming from the interface is introduced to the forwarding chip through the diversion strategy. The forwarding chip adopts aggregation technology to balance the traffic of each business board in the cloud board.
[0109] The forwarding chip uses a hash algorithm to calculate the hash value of the data flow corresponding to the service message. Since the hash algorithm has good hashing properties, the forwarding chip can evenly distribute the service message to each service board in the cloud board according to the identification information, thereby introducing the message coming from the interface into the service board.
[0110] The forwarding chip can also distribute service messages to different service boards according to the performance ratio of each service board in the cloud board, thereby achieving traffic balance among each service board.
[0111] The compilation results corresponding to the security policy information are stored in each service board of the cloud board. The identification information is used to identify the service board in the cloud board, which may be the slot number of the service board, a unique identifier, and the like.
[0112] See also Figure 5 , Figure 5 A schematic diagram of forwarding parallel service messages is shown. The service message enters the forwarding chip 502 from the interface 501. The forwarding chip 502 performs hash algorithm processing on the service message, and the forwarding chip 502 evenly distributes the service message to each service board in the cloud board 503.
[0113] As mentioned above, by adopting a hash algorithm, the received business messages are forwarded in parallel to each business board in the cloud board, avoiding reliance on complex diversion strategies to distribute business messages. The main control board dynamically adjusts the traffic distribution, so that the entire machine traffic can be intelligently diverted to different business boards for business processing, reducing the configuration of diversion strategies, realizing parallel forwarding of multiple business boards, improving the forwarding performance of the entire device, and ensuring the maximization of the overall performance.
[0114] Furthermore, since the cloud board technology fully utilizes the physical connectivity of the entire machine, the main control board can dynamically detect the presence of the business board. When the main control board detects that the first business board has been pulled out of the slot or is damaged, the main control board queries the first cloud board to which the first business board belongs, and sends the first identification information of the normally operating business board in the first cloud board to the forwarding chip.
[0115] The forwarding chip can avoid the first service board that has an abnormal problem, and the forwarding chip evenly distributes the received service messages to the service boards corresponding to the first identification information.
[0116] The first business board is a business board with abnormal problems in the network security fusion device, and the first cloud board is a cloud board to which the first business board belongs. The first identification information is the identification information of the business board that is operating normally in the first cloud board, and is used to identify the business board that is operating normally. The first identification information does not include the identification information corresponding to the first business board.
[0117] As described above, when the main control board detects an abnormal problem with the first business board, the main control board queries the first cloud board to which the first business board belongs, and sends the first identification information of the normally operating business board in the first cloud board to the forwarding chip. The forwarding chip evenly distributes the received business messages to the business board corresponding to the first identification information, thereby avoiding a large number of packet losses caused by a single point failure, ensuring that the network will not be interrupted, and ensuring the normal operation of the network. The cloud board has the ability to detect and switch faults. As long as one business board in the cloud board can work normally, the entire cloud board can operate, thereby improving the reliability of the equipment.
[0118] Further, when the main control board detects that the first service board has returned to normal, for example, the main control board detects that the first service board has been reinserted into the slot, the main control board sends the compilation result to the first service board again, and the first service board stores the compilation result sent by the main control board.
[0119] The main control board queries the first cloud board to which the first service board belongs, and sends the second identification information of the normally operating service board in the first cloud board to the forwarding chip. The forwarding chip evenly distributes the received service messages to the service boards corresponding to the second identification information.
[0120] The second identification information is the identification information of the normally operating business board in the first cloud board, and the second identification information at least includes: identification information corresponding to the first business board.
[0121] As described above, when the main control board detects that the first business board has returned to normal, the first business board stores the compilation result issued by the main control board, and the main control board queries the first cloud board to which the first business board belongs, and sends the second identification information of the normally operating business board in the first cloud board to the forwarding chip. The forwarding chip evenly distributes the received business messages to the business boards corresponding to the second identification information, thereby ensuring that the workload of each business board is balanced and improving the resource utilization of the entire cloud board.
[0122] In the above embodiment, it is introduced that the forwarding core evenly distributes the received service messages to each service board in the cloud board. In the following embodiment, how the service board matches the compilation result with the received service message is described in detail, and can be applied to any of the above embodiments.
[0123] In one embodiment, the service board can match the received service message with the first compilation result stored in the memory of the service board. According to the attributes of the service message such as the source IP address and the destination IP address, the memory storing the first compilation result is directly traversed, and after finding the security policy that meets the attributes, each policy rule is marked by a bitmap to see whether it has been matched by the traffic condition.
[0124] The service board determines whether there is a security policy matching the service message in the first compilation result according to the marking result of the Bitmap.
[0125] The service board matches the service message with the second compilation result through the decision tree. The service board extracts the source IP address, destination IP address and other features of the service message, and uses these features to traverse the decision tree until a leaf node is reached. The leaf node is the security policy that matches the service message.
[0126] After matching the service message through the policy template and the decision tree, if there are multiple matching security policies, the service message can be executed using the security policy with the highest priority by comparing the priorities of the security policies.
[0127] The first compilation result is a compilation result of the first policy information, and the second compilation result is a compilation result of the second policy information.
[0128] As described above, by matching the received business message with the first compilation result stored in the memory, the matching efficiency can be improved; and, by matching the business message with the second compilation result through a decision tree, the depth and number of nodes of the decision tree obtained after classification using a policy template are greatly reduced, thereby reducing the matching depth, thereby improving the matching performance and improving the throughput of the entire device.
[0129] Furthermore, in an actual use environment, since there may be a large number of security policies with fixed mask combinations, such security policies may only include a source IP address, a destination IP address, or a fixed combination thereof.
[0130] If all security policy information is compiled using a decision tree, the security policy information in a dimension that is not configured or configured as an arbitrary address (Any) is actually considered as a node that needs to be matched. In this way, the depth of the compiled decision tree and the number of nodes in it are very large. This will not only cause the security policy compilation time to be too long, but also cause the matching depth to be too long.
[0131] When dividing into policy templates, the main control board can divide rule items with a repetition number higher than a first preset number into general templates. The rule items in the general templates are used to classify security policy information with a large number of fixed masks, thereby covering most existing security policies.
[0132] The main control board may also classify rule items with a repetition number lower than a second preset number into special templates, and use the rule items in the special templates to classify security policy information with special IP addresses.
[0133] The first preset number is greater than the second preset number. The general template is used to classify security policy information with a large number of fixed masks, and the special template is used to classify security policy information with special IP addresses, such as wildcard addresses, addresses in a small range, and the like.
[0134] The business board matches the received business messages in the order of general compilation results, decision tree compilation results, and special compilation results, lowering the priority of the security policy information matching in the special template, and obtains the security policy matching the business messages.
[0135] The general compilation result is a compilation result corresponding to the security policy information classified into the general template, and the special compilation result is a compilation result corresponding to the security policy information classified into the special template.
[0136] As described above, by dividing the rule items with a repetition number higher than the first preset number into general templates, and dividing the rule items with a repetition number lower than the second preset number into special templates, the received business messages are matched in the matching order of general compilation results to decision tree compilation results and then to special compilation results. By matching the general compilation results first, most of the messages that meet or do not meet the basic security requirements can be quickly screened out, reducing the complexity of subsequent processing. The special compilation results are designed for specific situations, and more precise matching is performed on the business messages after matching the general compilation results and the decision tree compilation results, further improving processing efficiency.
[0137] Furthermore, in real networks, due to the huge number of security policies, only about 20% of the millions of security policies may be hit in the long term.
[0138] The main control board can count the policy hit data of the compilation results corresponding to the security policy of the historical business messages, store the selected compilation results whose policy hit data meet the preset hit conditions in the buffer, and regularly update the selected compilation results stored in the buffer.
[0139] The service board may preferentially match the selected compilation result in the buffer with the received service message to obtain a security policy that matches the service message.
[0140] The historical service message is the service message received within a preset time period. The selected compilation result is the compilation result that has been hit by the historical service message for a long time. The policy hit data is used to identify the hit status of the security policy corresponding to the compilation result, which can be the hit count, hit rate and other data of the security policy.
[0141] The preset hit condition is used to determine whether the security policy corresponding to the compilation result is hit for a long time, for example: the hit count of the security policy exceeds the preset hit threshold, the top 20% security policy with the highest hit count, etc.
[0142] As described above, by counting the policy hit data of the compilation results of historical business messages, the selected compilation results whose policy hit data meet the preset hit conditions are stored in the buffer, and the selected compilation results in the buffer are matched with the received business messages. This can greatly reduce the problem of multiple mismatches in the policy template and further improve the matching performance.
[0143] To further illustrate the parallel process of security policy compilation, centralized control, and forwarding, Figure 6 A flowchart of another method for compiling, centrally controlling, and forwarding security policies is shown. The method for compiling, centrally controlling, and forwarding security policies may include the following steps:
[0144] Step 602: Count the number of repetitions of each rule item in all security policy information, and classify the rule items with a number of repetitions higher than a first preset number into common templates.
[0145] In this step, the main control board receives all security policy information configured by the user, counts the number of repetitions of each rule item in all security policy information, and classifies rule items with a number of repetitions exceeding a first preset number, such as a large number of fixed mask types, as general templates.
[0146] Step 604: Classify the rule items whose repetition number is lower than the second preset number as special templates.
[0147] In this step, the main control board classifies rule items with a repetition number lower than a second preset number, such as special IP addresses, as special templates.
[0148] Step 606: Classify the security policy information that hits the policy template as the first policy information corresponding to the policy template.
[0149] In this step, the main control board classifies the security policy information that hits the policy template as the first policy information corresponding to the policy template, and the first policy information is stored in the policy template.
[0150] Step 608: Classify the security policy information that does not hit the policy template as the second policy information corresponding to the decision tree.
[0151] In this step, the main control board classifies the security policy information that does not hit the policy template as the second policy information corresponding to the decision tree, and constructs a decision tree based on the second policy information.
[0152] Step 610: Classify and compile the first policy information and the second policy information in parallel to obtain a compilation result.
[0153] In this step, the main control board uses multi-threading technology to parse the first policy information in the policy template. At the same time, the second policy information is compiled by a decision tree to obtain a compilation result that can be understood and executed by the network security fusion device.
[0154] Step 612: the main control board executes the calling function corresponding to the policy delivery function, and centrally manages the function information of the policy delivery function in the kernel information queue of the main control board.
[0155] Step 614: The main control board sends the function information in the kernel information queue to the business board through multi-channel threads.
[0156] Step 616: The business board executes the policy delivery function in the business board and stores the compilation result.
[0157] Step 618: The main control board adopts a hash algorithm to forward the received service message in parallel to each service board in the cloud board.
[0158] Step 620: When the main control board detects that an abnormal problem occurs in the first service board, the forwarding chip forwards the received service message in parallel to a normally operating service board in the first cloud board to which the first service board belongs.
[0159] In this step, when the main control board detects an abnormal problem with the first business board, the main control board queries the first cloud board to which the first business board belongs, and sends the first identification information of the normally operating business board in the first cloud board to the forwarding chip. The forwarding chip forwards the received business messages and distributes them evenly to the business boards corresponding to the first identification information in parallel.
[0160] Step 622: When the main control board detects that the first service board has returned to normal, the forwarding chip forwards the received service message in parallel to the first service board and other normally operating service boards in the first cloud board.
[0161] In this step, when the main control board detects that the first business board has returned to normal, the first business board stores the compilation result sent by the main control board, the main control board queries the first cloud board to which the first business board belongs, and sends the second identification information of the business board operating normally in the first cloud board to the forwarding chip. The forwarding chip forwards the received business messages and distributes them evenly to the business boards corresponding to the second identification information.
[0162] Step 624: Match the received service message in the matching order from the selected compilation result to the general compilation result to the decision tree compilation result and then to the special compilation result.
[0163] In this step, the received service message is matched according to the matching order from the selected compilation result to the general compilation result to the decision tree compilation result and then to the special compilation result.
[0164] The service board preferentially matches the service message with the selected compilation result in the buffer. If there is a matching security policy, there is no need to match it with the general compilation result, decision tree compilation result and special compilation result.
[0165] If there is no matching security policy in the selected compilation result, the received service message is matched with the general compilation result stored in the memory in the matching order from the general compilation result to the decision tree compilation result and then to the special compilation result. Then the service message is matched with the second compilation result through the decision tree. Finally, the service message is matched with the special compilation result stored in the memory.
[0166] If there are multiple matching security policies, the matching security policy with the highest priority is used to execute the service message.
[0167] Figure 7 1 is a schematic diagram of a structure of an electronic device according to an exemplary embodiment of the present application. The electronic device may be, for example, a mobile phone, a computer, a digital broadcast terminal, a message transceiver device, a game console, a tablet device, a personal digital assistant, a server, a smart home appliance, etc. Figure 7 At the hardware level, the electronic device includes a processor 702, an internal bus 704, a network interface 706, a memory 708, and a non-volatile memory 710, and may also include hardware required for other services. The processor 702 reads the corresponding computer program from the non-volatile memory 710 into the memory 708 and then runs it, forming a parallel device for compiling, centralizing, and forwarding security policies at the logical level. Of course, in addition to software implementations, this application does not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0168] Figure 8 This is a block diagram of a security policy compilation, centralized control, and forwarding parallel device according to an exemplary embodiment of the present application. Figure 8 The device may include: a policy template division module 802, a policy template classification module 804, a decision tree classification module 806 and a security policy processing module 808, wherein:
[0169] The policy template division module 802 is used to count the number of repetitions of each rule item in all security policy information, and divide the rule items whose number of repetitions meets a preset number range into policy templates;
[0170] The policy template classification module 804 is used to classify the security policy information that hits the policy template as the first policy information corresponding to the policy template;
[0171] The decision tree classification module 806 is used to classify the security policy information that does not hit the policy template as the second policy information corresponding to the decision tree;
[0172] The security policy processing module 808 is used to classify and compile the first policy information and the second policy information to obtain a compilation result; wherein the second policy information is compiled in a manner of the decision tree.
[0173] In one example, the security policy processing module 808 is also used to execute a calling function corresponding to a policy delivery function, and centrally manage the function information of the policy delivery function in the kernel information queue of the main control board; wherein the function information includes: the compilation result; sending the function information in the kernel information queue to the business board through a multi-channel thread; executing the policy delivery function in the business board and storing the compilation result.
[0174] In one example, the security policy processing module 808 is also used to adopt a hash algorithm to forward the received business message in parallel to each business board in the cloud board; wherein each business board of the cloud board stores the compilation result.
[0175] In one example, the compilation result includes: a first compilation result corresponding to the first policy information and a second compilation result corresponding to the second policy information; the security policy processing module 808 is also used to match the received business message with the first compilation result stored in the memory; and match the business message with the second compilation result through the decision tree.
[0176] In an example, the policy template includes: a general template and a special template; the first compilation result includes: a general compilation result corresponding to the general template and a special compilation result corresponding to the special template; the policy template division module 802, when used to divide the rule items whose repetition quantity meets the preset quantity range into policy templates, includes: dividing the rule items whose repetition quantity is higher than the first preset quantity into the general template; dividing the rule items whose repetition quantity is lower than the second preset quantity into the special template; wherein the first preset quantity is greater than the second preset quantity; the security policy processing module 808 is also used to match the received business messages according to the matching order from the general compilation result to the decision tree compilation result and then to the special compilation result.
[0177] In one example, the security policy processing module 808 is also used to count the policy hit data of the compilation results of historical business messages; store the selected compilation results whose policy hit data meet the preset hit conditions in a buffer; and match the selected compilation results in the buffer with the received business messages.
[0178] In one example, the security policy processing module 808 is also used to query the first cloud board to which the first business board belongs when the main control board detects an abnormal problem with the first business board, and send the first identification information of the normally operating business board in the first cloud board to the forwarding chip; the forwarding chip evenly distributes the received business messages to the business boards corresponding to the first identification information.
[0179] In one example, the security policy processing module 808 is also used for, when the main control board detects that the first business board has returned to normal, the first business board stores the compilation result issued by the main control board; the main control board queries the first cloud board to which the first business board belongs, and sends the second identification information of the normally operating business board in the first cloud board to the forwarding chip; the forwarding chip evenly distributes the received business messages to the business boards corresponding to the second identification information.
[0180] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0181] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying creative labor.
[0182] In an exemplary embodiment, a non-temporary computer-readable storage medium including instructions is also provided, such as a memory including instructions. The above instructions can be executed by a processor of a security policy compilation, centralized management, and forwarding parallel device to implement a method as described in any of the above embodiments.
[0183] The non-temporary computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc., and the present application does not limit this.
[0184] In an exemplary embodiment, a computer program product including a computer program / instruction is also provided. The computer program / instruction can be executed by a processor of a security policy compilation, centralized management, and forwarding parallel device to implement any of the methods described in the above embodiments.
[0185] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0186] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the inventions claimed herein. The present application is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
[0187] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A parallel method for compiling, centrally controlling, and forwarding security policies, characterized in that: The method comprises: Counting the number of repetitions of each rule item in all security policy information, and classifying the rule items whose number of repetitions falls within a preset number range as policy templates; Classifying the security policy information that hits the policy template as first policy information corresponding to the policy template; Classifying the security policy information that does not match the policy template as second policy information corresponding to the decision tree; The first policy information and the second policy information are classified and compiled to obtain a compilation result; wherein the second policy information is compiled in a manner of the decision tree.
2. The method according to claim 1, characterized in that The method further comprises: The calling function corresponding to the execution policy delivery function is centrally managed and controlled in the kernel information queue of the main control board the function information of the policy delivery function; wherein the function information includes: the compilation result; Sending the function information in the kernel information queue to the service board through multi-channel threads; Execute the policy delivery function in the service board and store the compilation result.
3. The method according to claim 1, characterized in that The method further comprises: Using a hash algorithm, the received service messages are forwarded to each service board in the cloud board in parallel; Wherein, each business board of the cloud board stores the compilation result.
4. The method according to claim 1, characterized in that The compilation result includes: a first compilation result corresponding to the first policy information and a second compilation result corresponding to the second policy information; The method further comprises: Matching the received service message with the first compilation result stored in the memory; The service message is matched with the second compilation result through the decision tree.
5. The method according to claim 4, characterized in that The policy template includes: a general template and a special template; the first compilation result includes: a general compilation result corresponding to the general template and a special compilation result corresponding to the special template; The dividing the rule items whose repetition quantity meets the preset quantity range into strategy templates includes: Classify the rule items whose repetition number is higher than the first preset number as the general template; Classify the rule items whose repetition number is lower than a second preset number as the special template; wherein the first preset number is greater than the second preset number; The method further comprises: The received service message is matched according to a matching order from the general compilation result to the decision tree compilation result and then to the special compilation result.
6. The method according to claim 1, characterized in that The method further comprises: Collecting statistics on the strategy hit data of the compilation result by historical service messages; The selected compilation results of the strategy hit data that meet the preset hit conditions are stored in a buffer; The selected compilation result in the buffer is matched with the received service message.
7. A parallel device for compiling, centrally controlling, and forwarding security policies, characterized in that: The device comprises: A policy template division module is used to count the number of repetitions of each rule item in all security policy information, and divide the rule items whose number of repetitions meets a preset number range into policy templates; A policy template classification module, used to classify the security policy information that hits the policy template as the first policy information corresponding to the policy template; A decision tree classification module, used to classify the security policy information that does not hit the policy template as second policy information corresponding to the decision tree; The security policy processing module is used to classify and compile the first policy information and the second policy information to obtain a compilation result; wherein the second policy information is compiled by means of the decision tree.
8. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 6 by running the executable instructions.
9. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instruction is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product having a computer program / instructions stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Data packet filtering method and device
CN105939323A
Policy compiling method and device, electronic device and computer storage medium
CN109542601A
Arrangement method for security policy configuration, system, device and computer readable storage medium
CN112751806A
Detection rule base generation method and system, electronic equipment and storage medium
CN113709189A
Firewall configuration method and device
CN116599760A
