[go: up one dir, main page]

CN104113516A - Method and terminal for recognizing rule conflicts of firewalls - Google Patents

Method and terminal for recognizing rule conflicts of firewalls Download PDF

Info

Publication number
CN104113516A
CN104113516A CN201310138626.4A CN201310138626A CN104113516A CN 104113516 A CN104113516 A CN 104113516A CN 201310138626 A CN201310138626 A CN 201310138626A CN 104113516 A CN104113516 A CN 104113516A
Authority
CN
China
Prior art keywords
rule
conflict
current
rules
conflicts
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201310138626.4A
Other languages
Chinese (zh)
Inventor
王毅
韩宗祥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Group Design Institute Co Ltd
Original Assignee
China Mobile Group Design Institute Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Group Design Institute Co Ltd filed Critical China Mobile Group Design Institute Co Ltd
Priority to CN201310138626.4A priority Critical patent/CN104113516A/en
Publication of CN104113516A publication Critical patent/CN104113516A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明实施例提供一种识别防火墙的规则冲突的方法和终端,对于防火墙中的每一条规则均定义多个数据包集,每一个数据包集存放与规则之间存在不同关联关系的数据包;定义规则之间出现的规则冲突的冲突类型;为当前规则构建一棵有向无环的规则决策树,基于当前规则规则决策树识别当前规则与其余规则之间出现的规则冲突的冲突类型;根据冲突类型回溯冲突源以找出引起冲突的冲突规则,以及冲突规则中所定义的引发了规则冲突的数据包集。为每一条规则均定义的多个数据包集和对冲突类型的划分,为各条规则各自构建一棵有向无环的规则决策树,基于每条规则的多个数据包集的相互关系进行冲突类型识别,能够为多于两条的规则之间出现的冲突进行识别。

Embodiments of the present invention provide a method and a terminal for identifying rule conflicts in a firewall. Multiple data packet sets are defined for each rule in the firewall, and each data packet set stores data packets that have different associations with the rules; Define the conflict type of rule conflicts between the rules; construct a directed acyclic rule decision tree for the current rule, and identify the conflict type of rule conflicts between the current rule and other rules based on the current rule decision tree; The conflict type traces back the source of the conflict to find the conflict rule that caused the conflict, and the set of packets defined in the conflict rule that caused the rule conflict. For the multiple data packet sets defined for each rule and the division of conflict types, a directed acyclic rule decision tree is constructed for each rule, based on the relationship between the multiple data packet sets of each rule. Conflict type identification can identify conflicts between more than two rules.

Description

一种识别防火墙的规则冲突的方法和终端A method and terminal for identifying firewall rule conflicts

技术领域 technical field

本发明涉及防火墙技术,特别是指一种识别防火墙的规则冲突的方法和终端。  The invention relates to firewall technology, in particular to a method and terminal for identifying conflicts of firewall rules. the

背景技术 Background technique

防火墙的规则是类似访问控制列表(ACL)的结构,包括序号、判定域和行为三部分。判定域可以由IP、TCP、UDP、ICMP首部任意字段构成,实际应用中的判定域通常包含了协议、源IP地址、源端口号、目的IP地址和目的端口号,行为是防火墙依据规则所应采取的动作。防火墙采用按序匹配的原则,当数据包到达防火墙,防火墙首先从第一条规则开始依次和数据包进行匹配,如果匹配则按照规则所定义的行为采取相应的动作:Deny表示丢弃数据包,Accept表示接收数据包,否则,继续检测数据包是否匹配第二条规则,如此循环到最后一条规则,最后一条规则称为默认规则,通常是丢弃所有数据包。  The rules of the firewall are similar to the structure of the access control list (ACL), including three parts: serial number, judgment domain and behavior. The judgment field can be composed of any fields in the IP, TCP, UDP, and ICMP headers. The judgment field in practical applications usually includes the protocol, source IP address, source port number, destination IP address, and destination port number. action taken. The firewall adopts the principle of sequential matching. When a data packet arrives at the firewall, the firewall first matches the data packet sequentially starting from the first rule. If it matches, it will take corresponding actions according to the behavior defined by the rule: Deny means to discard the data packet, Accept Indicates that the data packet is received, otherwise, continue to detect whether the data packet matches the second rule, and so on to the last rule. The last rule is called the default rule, which usually discards all data packets. the

当前成熟的防火墙的规则检测冲突算法是由Ehab S.Al-Shaer和Hazem H.Hamed提出的基于状态变迁图的检测冲突算法,其定义了开始状态:start;最终状态:shadowed、redundant、general、correlated、none;中间状态:redundant?、shadow?、generalize?等共计15个状态。任意两条规则rx、ry依次匹配协议(protocol)、源IP地址+源端口号(src)、目的IP地址+目的端口号(dst)、行为(action),依据匹配结果遍历整个变迁图,最后得出rx和ry是否产生冲突。  The currently mature firewall rule detection conflict algorithm is a state transition graph-based detection conflict algorithm proposed by Ehab S.Al-Shaer and Hazem H.Hamed, which defines the start state: start; final state: shadowed, redundant, general, correlated, none; intermediate state: redundant? , shadow?, generalize?, etc., a total of 15 states. Any two rules r x and r y match the protocol (protocol), source IP address + source port number (src), destination IP address + destination port number (dst), and action (action) in sequence, and traverse the entire transition graph according to the matching results , and finally draw whether r x and ry conflict.

该算法将任意2条规则冲突定义为覆盖冲突、关联冲突、泛化冲突和冗余冲突四种类型。  The algorithm defines any two rule conflicts as covering conflicts, association conflicts, generalization conflicts and redundancy conflicts. the

覆盖冲突(Shadowed),是指规则ry判定域定义的数据包完全被位于其前的规则rx所覆盖,规则ry按照防火墙按序匹配的原则,不匹配任何数据包,ry失效。  Coverage conflict (Shadowed) means that the data packet defined by the rule ry judgment domain is completely covered by the preceding rule r x , and the rule ry follows the principle of sequential matching of the firewall. If it does not match any data packets, ry becomes invalid.

关联冲突(Correlated),是指规则ry判定域定义的数据包部分被位于其前的 规则rx所覆盖,且rx和ry所定义行为不同。若交换rx和ry的位置,会引起防火墙对两条规则共同匹配的数据包采取不同的行为,更改防火墙策略配置。  Correlated conflict means that the part of the data packet defined by the decision domain of the rule ry is covered by the preceding rule r x , and the behaviors defined by r x and ry are different. If the positions of r x and r y are exchanged, the firewall will take different actions for the data packets matched by the two rules, and the firewall policy configuration will be changed.

泛化冲突(General),是指规则rx判定域定义的数据包完全被位于其后的规则ry所覆盖,且rx和ry所定义的行为不同。若交换rx和ry的位置,规则rx不匹配任何数据,且引起防火墙对rx所定义的数据包采取不同的行为,更改防火墙策略配置。  Generalization conflict (General) means that the data packet defined by the decision domain of rule r x is completely covered by the rule r y behind it, and the behaviors defined by r x and r y are different. If the positions of r x and r y are exchanged, the rule r x does not match any data, and causes the firewall to take different behaviors for the data packets defined by r x , changing the firewall policy configuration.

冗余冲突(Redundant),是指规则rx判定域定义的数据包完全被位于其后的规则ry所覆盖,且rx和ry所定义的行为相同。冗余冲突虽不会引起防火墙策略的更改,但由于增加了防火墙规则数目,提高了防火墙匹配时间,降低了防火墙效率。  Redundant conflict means that the data packet defined by the rule r x decision domain is completely covered by the subsequent rule ry y , and the behavior defined by r x and ry y is the same. Although redundant conflicts will not cause changes to the firewall policy, due to the increase in the number of firewall rules, the matching time of the firewall is increased and the efficiency of the firewall is reduced.

基于状态变迁图的检测冲突算法简单、容易实现,但是存在如下问题:首先,冲突的分类和检测冲突算法只能适用于任意两条规则之间,并不能扩展到多条规则之间的冲突分类和冲突检测;其次,该算法虽可以提供引发冲突的规则号,但不能提供更为详尽冲突源信息,例如依据该算法检测出规则ry被规则rx所覆盖,可以得出引发冲突的规则为rx,但不能获取规则rx所定义的哪部分数据包引发了覆盖冲突,而这正是在防火墙管理中更为迫切需要的信息。  The conflict detection algorithm based on the state transition graph is simple and easy to implement, but there are the following problems: First, the conflict classification and conflict detection algorithm can only be applied between any two rules, and cannot be extended to the conflict classification between multiple rules and conflict detection; secondly, although the algorithm can provide the rule number that caused the conflict, it cannot provide more detailed conflict source information. For example, if the algorithm detects that rule r y is covered by rule r x , the rule that causes conflict is r x , but can't get which part of the data packet defined by rule r x causes coverage conflict, and this is the information that is more urgently needed in firewall management.

发明内容 Contents of the invention

本发明要解决的技术问题是提供一种识别防火墙的规则冲突的方法和终端,用于解决现有的冲突分类和检测冲突算法只能适用于任意两条规则之间,不能提供更为详尽的冲突源信息的缺陷。  The technical problem to be solved by the present invention is to provide a method and terminal for identifying firewall rule conflicts. The existing conflict classification and conflict detection algorithms can only be applied between any two rules and cannot provide more detailed information. Deficiency of conflicting source information. the

为解决上述技术问题,本发明的实施例提供一种识别防火墙的规则冲突的方法,包括:对于防火墙中的每一条规则均定义多个数据包集,每一个数据包集存放与规则之间存在不同关联关系的数据包;定义规则之间出现的规则冲突的冲突类型;为一条当前规则构建一棵有向无环的规则决策树,基于当前规则的规则决策树识别当前规则与其余规则之间出现的规则冲突的冲突类型;根据冲突类型回溯冲突源以找出引起冲突的冲突规则,以及冲突规则中所定义的引发了所述规则冲突的数据包集。  In order to solve the above technical problems, the embodiment of the present invention provides a method for identifying rule conflicts of firewalls, including: defining multiple data packet sets for each rule in the firewall, and each data packet set stores and rules exist between Data packets with different association relationships; define the conflict type of rule conflicts between rules; build a directed acyclic rule decision tree for a current rule, and identify the relationship between the current rule and other rules based on the rule decision tree of the current rule The conflict type of the rule conflict that occurs; according to the conflict type, the conflict source is traced back to find out the conflict rule causing the conflict, and the data packet set defined in the conflict rule that caused the rule conflict. the

所述的方法中,对于防火墙中的每一条规则均定义多个数据包集,每一个 数据包集存放与规则之间存在不同关联关系的数据包,具体包括:具有d个判定域F1,…,Fd的防火墙包含n条规则r1,r2,…,rn,对于一条规则ri定义四个数据包集:匹配集Ri,表示规则ri所定义的数据包集;判定集Ei,表示规则ri按照防火墙按序匹配的原则所首次匹配的数据包集,满足覆盖集,表示位于规则ri前面的规则所匹配的数据包集,满足Mi=Mi-1∪Ei-1;同配集Si,表示由位于规则ri之后的规则所匹配的数据包集,且和规则ri有相同的行为。  In the described method, multiple data packet sets are defined for each rule in the firewall, and each data packet set stores data packets with different association relationships with the rules, specifically including: having d judgment fields F 1 , ..., F d' s firewall contains n rules r 1 , r 2 ,..., r n , for a rule r i define four data packet sets: matching set R i represents the data packet set defined by rule ri ; decision The set E i represents the set of data packets first matched by the rule ri according to the principle of sequential matching by the firewall, satisfying Coverage set, which means the set of data packets matched by the rules in front of the rule r i , satisfying M i =M i-1 ∪E i-1 ; the co-matching set S i represents the data packet set matched by the rule after the rule ri , and has the same behavior as the rule ri .

所述的方法中,定义规则之间出现的规则冲突的冲突类型具体包括:完全覆盖冲突,当前规则所定义的任意数据包均匹配位于当前规则前面的规则,该当前规则被前面的规则完全覆盖,当前规则失效;部分覆盖冲突,当前规则所定义的部分数据包匹配位于当前规则前面的规则,该当前规则被前面的规则部分覆盖;完全覆盖冲突和部分覆盖冲突统称为覆盖冲突;冗余冲突,当前规则不被前面的规则完全覆盖,其判定集中的任意数据包均匹配位于当前规则之后的规则,且当前规则与之后的规则的行为一样。  In the described method, the conflict type of the rule conflict occurring between the definition rules specifically includes: complete coverage conflict, any data packet defined by the current rule matches the rule located in front of the current rule, and the current rule is completely covered by the previous rule , the current rule is invalid; partial coverage conflict, part of the data packet defined by the current rule matches the rule located in front of the current rule, and the current rule is partially covered by the previous rule; full coverage conflict and partial coverage conflict are collectively referred to as coverage conflict; redundant conflict , the current rule is not completely covered by the previous rules, and any data packet in the decision set matches the rules after the current rule, and the behavior of the current rule is the same as that of the subsequent rules. the

所述的方法中,依据对应的规则决策树求出当前规则的多个数据包集中的判定集和覆盖集,具体包括:当所述当前规则是ri时,前一个规则ri-1的规则决策树为ti-1,将当前规则ri的第一个判定域和规则决策树ti-1的根节点作为当前规则ri的规则决策树ti的输入,将新增加的边对应的路径计入当前规则ri的判定集Ei,求解出判定集Ei,其中,根节点为当前规则ri的第一条规则的第一个判定域;当前规则ri的覆盖集依据Mi=Mi-1∪Ei-1求出。  In the method, the decision set and coverage set in the multiple data packet sets of the current rule are obtained according to the corresponding rule decision tree, specifically including: when the current rule is r i , the previous rule r i-1 The rule decision tree is t i-1 , the first judgment domain of the current rule r i and the root node of the rule decision tree t i-1 are taken as the input of the rule decision tree t i of the current rule r i , and the newly added edge The corresponding path is included in the decision set E i of the current rule r i , and the decision set E i is solved, where the root node is the first decision field of the first rule of the current rule r i ; the coverage set of the current rule r i in accordance with M i =M i-1 ∪E i-1 is obtained.

所述的方法中,对于具有d个判定域F1,…,Fd的防火墙,一棵规则决策树t满足:特征1,t有且只有一个没有入边的根节点,没有出边的节点被称为叶子节点;特征2,t中任意节点v具有一个标签F(v),如果节点v不是叶子节点,标签F(v)∈F1,…,Fd,如果节点v是叶子节点,标签F(v)接收数据包或者丢弃数据包;特征3,t中任意一条边e:u具有一个标签I(e),I(e)是节点u的标签的值域的一个非空子集;特征4,t中从根节点到叶子节点的路径构成一条规则;特征5,t中任意节点v的出边的数据包集E(v)满足的条件是E(v)中任意两条不同的边e和e',有I(e)∩I(e')。  In the described method, for a firewall with d decision domains F 1 ,...,F d , a rule decision tree t satisfies: feature 1, t has one and only one root node without incoming edges, and no outgoing edges is called a leaf node; feature 2, any node v in t has a label F(v), if the node v is not a leaf node, the label F(v)∈F 1 ,...,F d , if the node v is a leaf node, Label F(v) receives data packets or discards data packets; feature 3, any edge e:u in t has a label I(e), and I(e) is a non-empty subset of the value range of the label of node u; Feature 4, the path from the root node to the leaf node in t constitutes a rule; feature 5, the outbound packet set E(v) of any node v in t satisfies the condition that any two different Edges e and e' have I(e)∩I(e').

所述的方法中,基于当前规则的规则决策树识别当前规则与其余规则之间出现的规则冲突的冲突类型,包括:步骤1,依据对应每一条当前规则的规则 决策树求出当前规则的多个数据包集中的判定集和覆盖集,步骤2,若当前规则的判定集为空,当前规则被完全覆盖,执行步骤5;步骤3,若当前规则的判定集和匹配集相等,当前规则与其余规则之间没有产生规则冲突,执行步骤5;步骤4,识别部分覆盖冲突;识别冗余冲突;步骤5,退出当前规则冲突识别。  In the described method, based on the rule decision tree of the current rule, the conflict type of the rule conflict occurring between the current rule and the rest of the rules is identified, including: Step 1, according to the rule decision tree corresponding to each current rule, the multiplicity of the current rule is obtained. The decision set and coverage set in the data packet set, step 2, if the decision set of the current rule is empty, the current rule is completely covered, go to step 5; step 3, if the decision set and the matching set of the current rule are equal, the current rule and the matching set are equal If there is no rule conflict among the remaining rules, execute step 5; step 4, identify partial coverage conflict; identify redundant conflict; step 5, exit current rule conflict identification. the

所述的方法中,识别部分覆盖冲突,若当前规则ri满足并且Ei≠Ri,判定当前规则与其余规则之间产生了部分覆盖冲突;识别冗余冲突,构造当前规则ri的同配集Si,若出现并且判定当前规则与其余规则之间产生了冗余冲突。  In the method described, a partial coverage conflict is identified, if the current rule r i satisfies And E i ≠ R i , it is determined that a partial coverage conflict has occurred between the current rule and the rest of the rules; identify redundant conflicts, and construct the matching set S i of the current rule r i , if there is and It is determined that a redundant conflict has occurred between the current rule and the rest of the rules.

所述的方法中,构造当前规则ri的同配集Si,具体包括:初始化当前规则的同配集为空集;从当前规则的下一条规则开始至最后一条规则依次构造各条后续规则的规则决策树,并求出各条后续规则的判定集,将和当前规则行为相同的后续规则对应的判定集并入到当前规则的同配集Si。  In the described method, constructing the co-assignment set S i of the current rule r i specifically includes: initializing the co-assignment set of the current rule as an empty set; constructing successive rules from the next rule to the last rule of the current rule The rule decision tree of the current rule is obtained, and the decision set of each subsequent rule is obtained, and the decision set corresponding to the subsequent rule with the same behavior as the current rule is merged into the matching set S i of the current rule.

所述的方法中,根据冲突类型回溯冲突源以找出引起冲突的冲突规则,以及冲突规则中所定义的引发了所述规则冲突的数据包集,具体包括:若当前规则ri产生的是覆盖冲突,冲突源为Ri∩Mi;若当前规则ri产生的是冗余冲突,冲突源为Ei∩Si。  In the method, the conflict source is traced back according to the conflict type to find out the conflict rule causing the conflict, and the set of data packets defined in the conflict rule that caused the rule conflict, specifically including: if the current rule r i generates For coverage conflicts, the conflict source is R i ∩ M i ; if the current rule ri generates redundancy conflicts, the conflict source is E i ∩ S i .

一种识别防火墙的规则冲突的终端,包括:数据包集定义单元,用于对于防火墙中的每一条规则均定义多个数据包集,每一个数据包集存放与规则之间存在不同关联关系的数据包;冲突定义单元,用于定义规则之间出现的规则冲突的冲突类型;规则决策树单元,用于为一条当前规则构建一棵有向无环的规则决策树,基于当前规则的规则决策树识别当前规则与其余规则之间出现的规则冲突的冲突类型;冲突源回溯单元,用于根据冲突类型回溯冲突源以找出引起冲突的冲突规则,以及冲突规则中所定义的引发了规则冲突的数据包集。  A terminal for identifying rule conflicts of a firewall, comprising: a data packet set definition unit, configured to define multiple data packet sets for each rule in the firewall, each data packet set stores and has different associations with the rules Data package; conflict definition unit, used to define the conflict type of rule conflicts between rules; rule decision tree unit, used to build a directed acyclic rule decision tree for a current rule, based on the rule decision of the current rule The tree identifies the conflict type of the rule conflict that occurs between the current rule and the rest of the rules; the conflict source traceback unit is used to trace the conflict source according to the conflict type to find the conflict rule that caused the conflict, and the rule conflict defined in the conflict rule set of packets. the

本发明的上述技术方案的有益效果如下:为防火墙中的每一条规则均定义的多个数据包集和对冲突类型的划分,为各条规则各自构建一棵有向无环的规则决策树,基于每条规则的多个数据包集的相互关系进行冲突类型识别,能够为多于两条的规则之间出现的冲突进行识别,根据不同数据包集之间出现的交集进行冲突源回溯,找出引起冲突的冲突规则,以及冲突规则中所定义的引发 了该冲突的数据包集,因此提供了更为详尽的冲突源信息。  The beneficial effects of the above-mentioned technical solution of the present invention are as follows: for each rule in the firewall, a plurality of data packet sets and the division of conflict types are defined, and a directed acyclic rule decision tree is respectively constructed for each rule, Conflict type identification based on the relationship between multiple data packet sets of each rule can identify conflicts between more than two rules, and trace back the conflict source according to the intersection of different data packet sets to find out The conflict rule that caused the conflict and the data packet set that caused the conflict defined in the conflict rule are displayed, thus providing more detailed conflict source information. the

附图说明 Description of drawings

图1表示一种识别防火墙的规则冲突的方法的流程示意图;  Fig. 1 represents a schematic flow diagram of a method for identifying firewall rule conflicts;

图2表示冲突识别的流程示意图。  FIG. 2 shows a schematic flow chart of conflict identification. the

具体实施方式 Detailed ways

为使本发明要解决的技术问题、技术方案和优点更加清楚,下面将结合附图及具体实施例进行详细描述。  In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, the following will describe in detail with reference to the drawings and specific embodiments. the

本发明中,在防火墙形式化定义、冲突类型分类、冲突类型分类和防火墙冲突源回溯等方面进行改进。  In the present invention, improvements are made in aspects such as firewall formal definition, conflict type classification, conflict type classification, and firewall conflict source traceability. the

本发明实施例提供一种识别防火墙的规则冲突的方法,如图1所示,包括:  Embodiments of the present invention provide a method for identifying rule conflicts of firewalls, as shown in Figure 1, including:

步骤101,对于防火墙中的每一条规则均定义多个数据包集,每一个数据包集存放与规则之间存在不同关联关系的数据包;  Step 101, for each rule in the firewall, multiple data packet sets are defined, and each data packet set stores data packets with different association relationships with the rules;

步骤102,定义规则之间出现的规则冲突的冲突类型;  Step 102, defining conflict types of rule conflicts occurring between rules;

步骤103,为一条当前规则构建一棵有向无环的规则决策树,基于当前规则的规则决策树识别当前规则与其余规则之间出现的规则冲突的冲突类型;  Step 103, constructing a directed acyclic rule decision tree for a current rule, and identifying the conflict type of rule conflicts between the current rule and the rest of the rules based on the rule decision tree of the current rule;

步骤104,根据冲突类型回溯冲突源以找出引起冲突的冲突规则,以及冲突规则中所定义的引发了所述规则冲突的数据包集。  Step 104, trace back the source of the conflict according to the conflict type to find out the conflict rule causing the conflict, and the set of data packets defined in the conflict rule that caused the rule conflict. the

应用所提供的技术,为防火墙中的每一条规则均定义的多个数据包集和对冲突类型的划分,为各条规则各自构建一棵有向无环的规则决策树,基于每条规则的多个数据包集的相互关系进行冲突类型识别,能够为多于两条的规则之间出现的冲突进行识别,根据不同数据包集之间出现的交集进行冲突源回溯,找出引起冲突的冲突规则,以及冲突规则中所定义的引发了该冲突的数据包集,因此提供了更为详尽的冲突源信息。  Using the technology provided, for each rule in the firewall to define multiple data packet sets and the division of conflict types, build a directed acyclic rule decision tree for each rule, based on each rule Conflict type identification is performed on the interrelationship of multiple data packet sets, which can identify conflicts between more than two rules, and trace back the source of conflicts according to the intersection of different data packet sets to find out the conflicts that cause conflicts rule, and the set of packets defined in the conflict rule that caused the conflict, thus providing more detailed information about the source of the conflict. the

关于防火墙形式化定义,为使得所提供的技术适应于各种防火墙,采用形式化方法定义防火墙f。  Regarding the formal definition of firewall, in order to make the provided technology adaptable to various firewalls, a formal method is used to define firewall f. the

在一个优选实施例中,具有d个判定域F1,…,Fd的防火墙包含n条规则r1,r2,…,rn,对于一条规则ri定义四个数据包集:  In a preferred embodiment, a firewall with d decision domains F 1 ,...,F d contains n rules r 1 , r 2 ,...,r n , and four data packet sets are defined for one rule r i :

匹配集(Matching Set)Ri,表示规则ri所定义的数据包集;  Matching Set (Matching Set) R i , which represents the data packet set defined by the rule r i ;

判定集(Evaluating Set)Ei,表示规则ri按照防火墙按序匹配的原则所首次匹配的数据包集,满足 Evaluating Set (Evaluating Set) E i , represents the set of data packets matched for the first time by rule ri according to the principle of sequential matching by the firewall, satisfying

覆盖集(Masking Set)Mi,表示位于规则ri前面的规则所匹配的数据包集,满足Mi=Mi-1∪Ei-1;  Covering set (Masking Set) M i , which means the set of data packets matched by the rules in front of the rule r i , satisfying M i = M i-1E i-1 ;

同配集(Same Set)Si,表示由位于规则ri之后的规则所匹配的数据包集,且和规则ri有相同的行为。  Same Set (Same Set) S i , which means the set of data packets matched by the rule after the rule ri , and has the same behavior as the rule ri .

在一个应用场景中,数据包P具有d个判定域F1,…,Fd,数据包P可以被定义为一个d维的元组(p1,…,pd),p1∈D(F1),其中,D(Fj)是判定域Fi的值域,是一个非负整数段或者数据包集。  In an application scenario, the data packet P has d decision fields F 1 ,…,F d , and the data packet P can be defined as a d-dimensional tuple (p 1 ,…,p d ), p 1 ∈ D( F 1 ), wherein, D(F j ) is the value range of the decision domain F i , which is a non-negative integer segment or a data packet set.

具有d个判定域F1,…,Fd的防火墙f包含n条规则r1,r2,…,rn,记为f<r1,r2,…,rn>,规则ri(1≤i≤n)定义为:<t>^(F1∈S1)^…^(Fd∈Sd)→<action>,其中Si(1≤i≤d)是D(Fj)的非空子集,action是规则定义的行为,如:deny和accept。  A firewall f with d decision domains F 1 ,…,F d contains n rules r 1 ,r 2 ,…,r n , denoted as f<r 1 ,r 2 ,…,r n >, rule r i ( 1≤i≤n) is defined as: <t>^(F 1 ∈ S 1 )^…^(F dS d )→<action>, where S i (1≤i≤d) is D(F j ), and action is the behavior defined by the rule, such as: deny and accept.

对于规则ri定义以下4个数据包集:  For rule r i define the following 4 packet sets:

匹配集(Matching Set)Ri,表示规则ri所定义的数据包集;  Matching Set (Matching Set) R i , which represents the data packet set defined by the rule r i ;

判定集(Evaluating Set)Ei,表示按照防火墙按序匹配的原则,规则ri所匹配的数据包集,则                                                   Evaluating Set (Evaluating Set) E i , which means according to the principle of sequential matching of firewalls, the set of data packets matched by rule r i , then

覆盖集(Masking Set)Mi,表示位于规则ri前面的规则所匹配的数据包集,    Mi-Mi-1∪Ei-1Covering set (Masking Set) M i , which represents the set of data packets matched by the rules in front of the rule r i , M i -M i-1E i-1 ;

同配集(Same Set)Si,表示由位于规则ri之后所匹配的数据包集,且和规则ri有相同的行为。  Same Set (Same Set) S i means the set of data packets matched by the rule ri , and has the same behavior as the rule ri .

关于冲突类型分类,对防火墙冲突进行了分类,给出了不同的冲突类型的定义,在一个优选实施例中,定义规则之间出现的规则冲突的冲突类型具体包括:  Regarding the classification of conflict types, firewall conflicts are classified, and the definitions of different conflict types are provided. In a preferred embodiment, the conflict types of rule conflicts occurring between definition rules specifically include:

完全覆盖冲突,当前规则所定义的任意数据包均匹配位于当前规则前面的规则,该当前规则被前面的规则完全覆盖,当前规则失效;  Complete coverage conflict, any packet defined by the current rule matches the rule in front of the current rule, the current rule is completely covered by the previous rule, and the current rule becomes invalid;

部分覆盖冲突,当前规则所定义的部分数据包匹配位于当前规则前面的规则,该当前规则被前面的规则部分覆盖;  Partial coverage conflict, part of the data packets defined by the current rule match the rule in front of the current rule, and the current rule is partially covered by the previous rule;

完全覆盖冲突和部分覆盖冲突统称为覆盖冲突;  Full coverage conflicts and partial coverage conflicts are collectively referred to as coverage conflicts;

冗余冲突,当前规则不被前面的规则完全覆盖,其判定集中的任意数据包均匹配位于当前规则之后的规则,且当前规则与之后的规则的行为一样。  Redundant conflicts, the current rule is not completely covered by the previous rules, any data packets in the decision set match the rules after the current rule, and the behavior of the current rule is the same as that of the subsequent rules. the

当前规则可以是任意一条规则,例如,当前规则具体是第i个规则ri。  The current rule may be any rule, for example, the current rule is specifically the i-th rule r i .

实施例所提供的冲突分类不仅适用于任意两条规则之间,还可以扩展到任意多条规则之间。  The conflict classification provided by the embodiment is not only applicable to any two rules, but also can be extended to any number of rules. the

在一个应用场景中,完全覆盖(Fully Masked),是指当前规则所定义的任意数据包均匹配位于其前面的规则,该当前规则被其前面规则完全覆盖,该当前规则失效。即,当前规则的判定集为空集,其形式化表达为:规则ri被完全覆盖,如果 In an application scenario, fully masked means that any data packet defined by the current rule matches the preceding rule, the current rule is completely covered by the previous rule, and the current rule becomes invalid. That is, the decision set of the current rule is an empty set, and its formal expression is: the rule r i is completely covered, if

部分覆盖(Partially Masked),是指当前规则ri所定义的部分(非完全)数据包匹配位于其前面的规则,该当前规则被其前面的规则部分覆盖,即该当前规则的判定集是其匹配集Ri的非空子集,形式化表达为:当前规则ri被部分覆盖,如果并且Ei≠Ri。  Partially Masked means that the partial (non-complete) data packet defined by the current rule r i matches the rule in front of it, and the current rule is partially covered by the rule in front of it, that is, the decision set of the current rule is its The non-empty subset of the matching set R i is formally expressed as: the current rule r i is partially covered, if And E i ≠ R i .

将完全覆盖和部分覆盖统称为覆盖冲突。  Full coverage and partial coverage are collectively referred to as coverage conflicts. the

冗余冲突(Redundant),是指当前规则ri不被其前面规则完全覆盖,其判定集中的任意数据包均匹配位于当前规则之后的后续规则,且它们的行为一样,形式化表达为:并且表明当前规则ri被冗余。  Redundant conflict means that the current rule r i is not completely covered by its previous rules, and any data packet in its decision set matches the subsequent rules after the current rule, and their behavior is the same, formally expressed as: and Indicates that the current rule ri is redundant.

关于防火墙冲突识别,检测冲突算法包括两部分:冲突识别算法和冲突源回溯算法。  Regarding firewall conflict identification, the conflict detection algorithm includes two parts: a conflict identification algorithm and a conflict source backtracking algorithm. the

基于规则决策树(RDT,Rule Decision Tree)的冲突识别算法,针对覆盖冲突识别和冗余冲突识别略有不同,规则决策树的定义是:  The conflict identification algorithm based on rule decision tree (RDT, Rule Decision Tree) is slightly different for coverage conflict identification and redundant conflict identification. The definition of rule decision tree is:

在一个优选实施例中,依据对应的规则决策树求出当前规则的多个数据包集中的判定集和覆盖集,具体包括:  In a preferred embodiment, according to the corresponding rule decision tree, the decision set and coverage set in the plurality of data packet sets of the current rule are obtained, specifically including:

当所述当前规则是ri时,前一个规则ri-1的规则决策树为ti-1,  When the current rule is r i , the rule decision tree of the previous rule r i-1 is t i-1 ,

将当前规则ri的第一个判定域和规则决策树ti-1的根节点作为当前规则ri的规则决策树ti的输入,将新增加的边对应的路径计入当前规则ri的判定集Ei,求解出判定集Ei,其中,根节点为当前规则ri的第一条规则的第一个判定域;  Take the first judgment domain of the current rule r i and the root node of the rule decision tree t i-1 as the input of the rule decision tree t i of the current rule r i , and include the path corresponding to the newly added edge into the current rule r i Judgment set E i of , solve the decision set E i , where the root node is the first judgment domain of the first rule of the current rule r i ;

当前规则ri的覆盖集依据Mi=Mi-1∪Ei-1求出。  Covering set basis for current rule r i M i =M i-1 ∪E i-1 is obtained.

防火墙中的各条规则,都具有一棵有向无环的规则决策树。每条规则构建一颗树,当前规则的决策树,是由上一条规则的规则决策树演变而来。  Each rule in the firewall has a directed acyclic rule decision tree. Each rule builds a tree, and the decision tree of the current rule is evolved from the rule decision tree of the previous rule. the

在一个优选实施例中,对于具有d个判定域F1,...,Fd的防火墙,一棵规则决策树t满足:  In a preferred embodiment, for a firewall with d decision domains F 1 ,...,F d , a rule decision tree t satisfies:

特征1,t有且只有一个没有入边的根节点,没有出边的节点被称为叶子节点;  Feature 1, t has one and only one root node without incoming edges, and nodes without outgoing edges are called leaf nodes;

特征2,t中任意节点v具有一个标签F(v),如果节点v不是叶子节点,标签F(v)∈F1,...,Fd,如果节点v是叶子节点,标签F(v)接收数据包或者丢弃数据包;  Feature 2, any node v in t has a label F(v), if the node v is not a leaf node, the label F(v)∈F 1 ,...,F d , if the node v is a leaf node, the label F(v ) to receive data packets or discard data packets;

特征3,t中任意一条边e:u具有一个标签I(e),I(e)是节点u的标签的值域的一个非空子集;  Feature 3, any edge e:u in t has a label I(e), and I(e) is a non-empty subset of the value range of the label of node u;

特征4,t中从根节点到叶子节点的路径构成一条规则;  Feature 4, the path from the root node to the leaf node in t constitutes a rule;

特征5,t中任意节点v的出边的数据包集E(v)满足的条件是E(v)中任意两条不同的边e和e',有I(e)∩I(e')。  Feature 5, the outbound packet set E(v) of any node v in t satisfies the condition that any two different edges e and e' in E(v) have I(e)∩I(e') . the

其中,如果节点v不是叶子节点,F(v)∈F1,...,Fd,如果节点v是叶子节点,F(v)接收数据包或者丢弃数据包。  Wherein, if node v is not a leaf node, F(v)∈F 1 ,...,F d , if node v is a leaf node, F(v) receives data packets or discards data packets.

设规则i-1的规则决策树为ti-1,将规则i的第一个判定域和ti-1的根节点作为输入,构造规则i所对应的规则决策树ti,在构造的过程中,将增加的新边所对应的路径计入规则i的判定集Ei,实现规则判定集的求解。  Let the rule decision tree of rule i-1 be t i-1 , take the first judgment domain of rule i and the root node of ti-1 as input, and construct the rule decision tree t i corresponding to rule i, during the construction process In , the path corresponding to the added new edge is included in the decision set E i of rule i to realize the solution of the rule decision set.

其中,根节点为第一条规则的第一个判定域,依据决策树的特征4可知,路径即是规则。  Among them, the root node is the first judgment domain of the first rule. According to the feature 4 of the decision tree, the path is the rule. the

规则决策树的构造算法和判定集求解如以下算法:  The construction algorithm of the rule decision tree and the solution of the decision set are as follows:

基于决策树的冲突识别算法,能够识别不同的冲突类型,对一条当前规则的冲突识别算法流程中,  The conflict identification algorithm based on the decision tree can identify different types of conflicts. In the process of the conflict identification algorithm for a current rule,

在一个优选实施例中,对于各条规则,依据规则决策树求出该规则的判定集,覆盖集。  In a preferred embodiment, for each rule, the decision set and coverage set of the rule are obtained according to the rule decision tree. the

在一个应用场景中,以当前规则为例,将当前规则的第一个判定域和根节点(第一条规则的第一个判定域)作为输入,实现构造当前规则所对应的规则决策树,以及求解当前规则所对应的判定集Ei,如此,依据规则决策树求出了当前规则的判定集,当前规则的覆盖集依据Mi=Mi-1∪Ei-1求出。  In an application scenario, taking the current rule as an example, the first judgment domain of the current rule and the root node (the first judgment domain of the first rule) are used as input to realize the construction of a rule decision tree corresponding to the current rule. And solve the decision set E i corresponding to the current rule. In this way, the decision set of the current rule is obtained according to the rule decision tree, and the coverage set of the current rule is based on M i =M i-1 ∪E i-1 is obtained.

在建立了各条规则的判定集,覆盖集之后,在一个优选实施例中,基于当前规则的规则决策树识别当前规则与其余规则之间出现的规则冲突的冲突类型,包括:  After establishing the decision set and coverage set of each rule, in a preferred embodiment, the rule decision tree based on the current rule identifies the conflict type of rule conflicts between the current rule and the rest of the rules, including:

步骤1,依据对应每一条当前规则的规则决策树求出当前规则的多个数据包集中的判定集和覆盖集,  Step 1, according to the rule decision tree corresponding to each current rule, the decision set and coverage set of the multiple data packet sets of the current rule are obtained,

步骤2,若当前规则的判定集为空,当前规则被完全覆盖,执行步骤5;  Step 2, if the decision set of the current rule is empty, the current rule is completely covered, go to step 5;

步骤3,若当前规则的判定集和匹配集相等,当前规则与其余规则之间没有产生规则冲突,执行步骤5;  Step 3, if the judgment set and matching set of the current rule are equal, and there is no rule conflict between the current rule and other rules, go to step 5;

步骤4,识别部分覆盖冲突;识别冗余冲突;  Step 4, identifying partial coverage conflicts; identifying redundant conflicts;

步骤5,退出当前规则冲突识别。  Step 5, exit the current rule conflict identification. the

在一个应用场景中,基于当前规则的规则决策树识别当前规则与其余规则之间出现的规则冲突的冲突类型,如图2所示,包括:  In an application scenario, the rule decision tree based on the current rule identifies the conflict type of rule conflicts between the current rule and other rules, as shown in Figure 2, including:

步骤201,开始进行冲突类型的识别。  Step 201, start identifying conflict types. the

步骤202,依据对应每一条当前规则的规则决策树求出当前规则的多个数据包集中的判定集和覆盖集。  Step 202 , according to the rule decision tree corresponding to each current rule, the decision set and coverage set in the plurality of data packet sets of the current rule are obtained. the

步骤203,当前规则的判定集是否为空,若判定集为空,转步骤204,否则转步骤205。  Step 203, whether the judgment set of the current rule is empty, if the judgment set is empty, go to step 204, otherwise go to step 205. the

步骤204,当前规则的判定集为空,表明当前规则被完全覆盖,转步骤209。  In step 204, the judgment set of the current rule is empty, indicating that the current rule is completely covered, and then go to step 209. the

步骤205,判定集是否等于匹配集,若是转步骤206,否则转步骤207。  Step 205, determine whether the set is equal to the matching set, if so go to step 206, otherwise go to step 207. the

步骤206,表明当前规则与其余规则之间不存在规则冲突,转步骤209。  Step 206, indicating that there is no rule conflict between the current rule and other rules, go to step 209. the

步骤207,识别部分覆盖冲突。步骤207和步骤208之间不存在时间上的先后次序,因此,若在步骤207之前步骤208已经执行完毕,则在执行完步骤207之后转步骤209。  Step 207, identifying partial coverage conflicts. There is no chronological sequence between step 207 and step 208, therefore, if step 208 has been executed before step 207, go to step 209 after step 207 is executed. the

步骤208,识别冗余冲突。  Step 208, identifying redundancy conflicts. the

步骤209,退出当前规则冲突识别,结束。  Step 209, exit the current rule conflict identification, and end. the

基于决策树的冲突识别算法,对于覆盖冲突识别和冗余冲突识别略有不同。其中,  The decision tree-based conflict identification algorithm is slightly different for coverage conflict identification and redundancy conflict identification. in,

在一个优选实施例中,识别部分覆盖冲突,若当前规则ri满足并且Ei≠Ri,判定当前规则与其余规则之间产生了部分覆盖冲突。  In a preferred embodiment, a partial coverage conflict is identified if the current rule ri satisfies And E i ≠ R i , it is determined that a partial coverage conflict has occurred between the current rule and other rules.

在一个优选实施例中,识别部分覆盖冲突,若当前规则ri满足并且Ei≠Ri,判定当前规则与其余规则之间产生了部分覆盖冲突;  In a preferred embodiment, a partial coverage conflict is identified if the current rule ri satisfies And E i ≠ R i , it is determined that there is a partial coverage conflict between the current rule and other rules;

识别冗余冲突,构造当前规则ri的同配集Si,若出现并且判定当前规则与其余规则之间产生了冗余冲突。  Identify redundant conflicts, construct the matching set S i of the current rule r i , if and It is determined that a redundant conflict has occurred between the current rule and the rest of the rules.

在一个优选实施例中,构造当前规则ri的同配集Si,具体包括:  In a preferred embodiment, constructing the assortment set S i of the current rule r i specifically includes:

初始化当前规则的同配集为空集;  Initialize the matching set of the current rule as an empty set;

从当前规则的下一条规则开始至最后一条规则依次构造各条后续规则的规则决策树,并求出各条后续规则的判定集,  From the next rule of the current rule to the last rule, the rule decision tree of each subsequent rule is constructed sequentially, and the decision set of each subsequent rule is obtained,

将和当前规则行为相同的后续规则对应的判定集并入到当前规则的同配集Si。  Merge the decision set corresponding to the subsequent rule with the same behavior as the current rule into the matching set S i of the current rule.

关于防火墙冲突源回溯,在一个优选实施例中,根据冲突类型回溯冲突源以找出引起冲突的冲突规则,以及冲突规则中所定义的引发了所述规则冲突的数据包集,具体包括:  Regarding firewall conflict source backtracking, in a preferred embodiment, according to the conflict type, backtracking the conflict source to find out the conflict rule causing the conflict, and the set of data packets defined in the conflict rule that caused the rule conflict, specifically including:

若当前规则ri产生的是覆盖冲突,冲突源为Ri∩Mi;  If the current rule r i generates a coverage conflict, the source of the conflict is R i ∩ M i ;

若当前规则ri产生的是冗余冲突,冲突源为Ei∩Si。  If the current rule r i generates a redundant conflict, the conflict source is E i ∩ S i .

对于各个冲突类型实现了查找冲突源,得出引发冲突的规则号以及该规则所定义的哪部分数据包集引发了该冲突。  For each conflict type, the source of the conflict is searched, and the number of the rule that causes the conflict and which part of the data packet set defined by the rule causes the conflict is obtained. the

本发明实施例提供一种识别防火墙的规则冲突的终端,包括:  An embodiment of the present invention provides a terminal for identifying firewall rule conflicts, including:

数据包集定义单元,用于对于防火墙中的每一条规则均定义多个数据包集,每一个数据包集存放与规则之间存在不同关联关系的数据包;  The data packet set definition unit is used to define multiple data packet sets for each rule in the firewall, and each data packet set stores data packets that have different associations with the rules;

冲突定义单元,用于定义规则之间出现的规则冲突的冲突类型;  The conflict definition unit is used to define the conflict type of the rule conflict occurring between the rules;

规则决策树单元,用于为一条当前规则构建一棵有向无环的规则决策树,基于当前规则的规则决策树识别当前规则与其余规则之间出现的规则冲突的冲突类型;  The rule decision tree unit is used to construct a directed acyclic rule decision tree for a current rule, and identify the conflict type of rule conflicts between the current rule and other rules based on the rule decision tree of the current rule;

冲突源回溯单元,用于根据冲突类型回溯冲突源以找出引起冲突的冲突规则,以及冲突规则中所定义的引发了所述规则冲突的数据包集。  The conflict source traceback unit is configured to trace back the conflict source according to the conflict type to find out the conflict rule causing the conflict, and the set of data packets defined in the conflict rule that caused the rule conflict. the

采用本方案之后的优势是:实现了对防火墙规则之间的冲突的完全识别,其识别不局限于两条规则之间,可以扩展到多条规则,提供了防火墙规则冲突源的详细信息,为排除规则冲突提供了便利,判断过程简单且结果可靠。  The advantage of adopting this scheme is that it realizes the complete identification of conflicts between firewall rules, and its identification is not limited to between two rules, but can be extended to multiple rules, providing detailed information on the source of firewall rule conflicts, providing Elimination of rule conflicts provides convenience, the judgment process is simple and the results are reliable. the

以上所述是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明所述原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。  The above description is a preferred embodiment of the present invention, it should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, some improvements and modifications can also be made, and these improvements and modifications can also be made. It should be regarded as the protection scope of the present invention. the

Claims (10)

1.一种识别防火墙的规则冲突的方法,其特征在于,包括:1. A method for identifying firewall rule conflicts, comprising: 对于防火墙中的每一条规则均定义多个数据包集,每一个数据包集存放与规则之间存在不同关联关系的数据包;For each rule in the firewall, multiple data packet sets are defined, and each data packet set stores data packets that have different associations with the rules; 定义规则之间出现的规则冲突的冲突类型;Conflict types that define rule conflicts that arise between rules; 为一条当前规则构建一棵有向无环的规则决策树,基于当前规则的规则决策树识别当前规则与其余规则之间出现的规则冲突的冲突类型;Construct a directed acyclic rule decision tree for a current rule, and identify the conflict type of rule conflicts between the current rule and other rules based on the rule decision tree of the current rule; 根据冲突类型回溯冲突源以找出引起冲突的冲突规则,以及冲突规则中所定义的引发了所述规则冲突的数据包集。The source of the conflict is traced back according to the conflict type to find out the conflict rule causing the conflict, and the set of data packets defined in the conflict rule that caused the rule conflict. 2.根据权利要求1所述的方法,其特征在于,对于防火墙中的每一条规则均定义多个数据包集,每一个数据包集存放与规则之间存在不同关联关系的数据包,具体包括:2. The method according to claim 1, characterized in that, for each rule in the firewall, a plurality of data packet sets are defined, and each data packet set stores data packets with different associations with the rules, specifically comprising : 具有d个判定域F1,…,Fd的防火墙包含n条规则r1,r2,…,rn,对于一条规则ri定义四个数据包集:A firewall with d decision domains F 1 ,…,F d contains n rules r 1 ,r 2 ,…,r n , for a rule r i define four data packet sets: 匹配集Ri,表示规则ri所定义的数据包集;Matching set R i represents the packet set defined by rule ri ; 判定集Ei,表示规则ri按照防火墙按序匹配的原则所首次匹配的数据包集,满足 E i &SubsetEqual; R i ; The decision set E i represents the packet set matched by the rule ri for the first time according to the principle of sequential matching by the firewall, satisfying E. i &SubsetEqual; R i ; 覆盖集,表示位于规则ri前面的规则所匹配的数据包集,满足Mi=Mi-1∪Ei-1Coverage set, which means the set of data packets matched by the rules in front of the rule r i , satisfying M i = M i-1E i-1 ; 同配集Si,表示由位于规则ri之后的规则所匹配的数据包集,且和规则ri有相同的行为。The co-matching set S i represents the packet set matched by the rule after the rule ri , and has the same behavior as the rule ri . 3.根据权利要求1所述的方法,其特征在于,定义规则之间出现的规则冲突的冲突类型具体包括:3. The method according to claim 1, characterized in that, defining the conflict types of rule conflicts occurring between rules specifically includes: 完全覆盖冲突,当前规则所定义的任意数据包均匹配位于当前规则前面的规则,该当前规则被前面的规则完全覆盖,当前规则失效;Complete coverage conflict, any packet defined by the current rule matches the rule in front of the current rule, the current rule is completely covered by the previous rule, and the current rule becomes invalid; 部分覆盖冲突,当前规则所定义的部分数据包匹配位于当前规则前面的规则,该当前规则被前面的规则部分覆盖;Partial coverage conflict, some data packets defined by the current rule match the rule before the current rule, and the current rule is partially covered by the previous rule; 完全覆盖冲突和部分覆盖冲突统称为覆盖冲突;Full coverage conflicts and partial coverage conflicts are collectively referred to as coverage conflicts; 冗余冲突,当前规则不被前面的规则完全覆盖,其判定集中的任意数据包均匹配位于当前规则之后的规则,且当前规则与之后的规则的行为一样。Redundant conflicts, the current rule is not completely covered by the previous rules, any data packets in the decision set match the rules after the current rule, and the behavior of the current rule is the same as that of the subsequent rules. 4.根据权利要求2所述的方法,其特征在于,依据对应的规则决策树求出当前规则的多个数据包集中的判定集和覆盖集,具体包括:4. The method according to claim 2, wherein, according to the corresponding rule decision tree, the determination set and the coverage set in a plurality of data packets of the current rule are obtained, specifically comprising: 当所述当前规则是ri时,前一个规则ri-1的规则决策树为ti-1When the current rule is r i , the rule decision tree of the previous rule r i-1 is t i-1 , 将当前规则ri的第一个判定域和规则决策树ti-1的根节点作为当前规则ri的规则决策树ti的输入,将新增加的边对应的路径计入当前规则ri的判定集Ei,求解出判定集Ei,其中,根节点为当前规则ri的第一条规则的第一个判定域;Take the first judgment domain of the current rule r i and the root node of the rule decision tree t i-1 as the input of the rule decision tree t i of the current rule r i , and include the path corresponding to the newly added edge into the current rule r i Judgment set E i of , solve the decision set E i , where the root node is the first judgment domain of the first rule of the current rule r i ; 当前规则ri的覆盖集依据Mi=Mi-1∪Ei-1求出。Covering set basis for current rule r i M i =M i-1 ∪E i-1 is obtained. 5.根据权利要求4所述的方法,其特征在于,对于具有d个判定域F1,…,Fd的防火墙,一棵规则决策树t满足:5. The method according to claim 4, characterized in that, for a firewall with d decision domains F 1 ,..., F d , a rule decision tree t satisfies: 特征1,t有且只有一个没有入边的根节点,没有出边的节点被称为叶子节点;Feature 1, t has one and only one root node without incoming edges, and nodes without outgoing edges are called leaf nodes; 特征2,t中任意节点v具有一个标签F(v),如果节点v不是叶子节点,标签F(v)∈F1,…,Fd,如果节点v是叶子节点,标签F(v)接收数据包或者丢弃数据包;Feature 2, any node v in t has a label F(v), if the node v is not a leaf node, the label F(v)∈F 1 ,...,F d , if the node v is a leaf node, the label F(v) receives packet or drop the packet; 特征3,t中任意一条边e:u具有一个标签I(e),I(e)是节点u的标签的值域的一个非空子集;Feature 3, any edge e:u in t has a label I(e), and I(e) is a non-empty subset of the value range of the label of node u; 特征4,t中从根节点到叶子节点的路径构成一条规则;Feature 4, the path from the root node to the leaf node in t constitutes a rule; 特征5,t中任意节点v的出边的数据包集E(v)满足的条件是E(v)中任意两条不同的边e和e',有I(e)∩I(e')。Feature 5, the outbound packet set E(v) of any node v in t satisfies the condition that any two different edges e and e' in E(v) have I(e)∩I(e') . 6.根据权利要求5所述的方法,其特征在于,基于当前规则的规则决策树识别当前规则与其余规则之间出现的规则冲突的冲突类型,包括:6. The method according to claim 5, wherein, based on the rule decision tree of the current rule, the conflict type of the rule conflict occurring between the current rule and the remaining rules is identified, comprising: 步骤1,依据对应每一条当前规则的规则决策树求出当前规则的多个数据包集中的判定集和覆盖集,Step 1, according to the rule decision tree corresponding to each current rule, the decision set and coverage set of the multiple data packet sets of the current rule are obtained, 步骤2,若当前规则的判定集为空,当前规则被完全覆盖,执行步骤5;Step 2, if the decision set of the current rule is empty, the current rule is completely covered, go to step 5; 步骤3,若当前规则的判定集和匹配集相等,当前规则与其余规则之间没有产生规则冲突,执行步骤5;Step 3, if the judgment set and matching set of the current rule are equal, and there is no rule conflict between the current rule and other rules, go to step 5; 步骤4,识别部分覆盖冲突;识别冗余冲突;Step 4, identifying partial coverage conflicts; identifying redundant conflicts; 步骤5,退出当前规则冲突识别。Step 5, exit the current rule conflict identification. 7.根据权利要求6所述的方法,其特征在于,7. The method of claim 6, wherein, 识别部分覆盖冲突,若当前规则ri满足并且Ei≠Ri,判定当前规则与其余规则之间产生了部分覆盖冲突;Identify partial coverage conflicts if the current rule r i satisfies And E i ≠ R i , it is determined that there is a partial coverage conflict between the current rule and other rules; 识别冗余冲突,构造当前规则ri的同配集Si,若出现并且判定当前规则与其余规则之间产生了冗余冲突。Identify redundant conflicts, construct the matching set S i of the current rule r i , if and It is determined that a redundant conflict has occurred between the current rule and the rest of the rules. 8.根据权利要求7所述的方法,其特征在于,构造当前规则ri的同配集Si,具体包括:8. The method according to claim 7, characterized in that, constructing the matching set S i of the current rule r i specifically includes: 初始化当前规则的同配集为空集;Initialize the matching set of the current rule as an empty set; 从当前规则的下一条规则开始至最后一条规则依次构造各条后续规则的规则决策树,并求出各条后续规则的判定集,From the next rule of the current rule to the last rule, the rule decision tree of each subsequent rule is constructed sequentially, and the decision set of each subsequent rule is obtained, 将和当前规则行为相同的后续规则对应的判定集并入到当前规则的同配集SiMerge the decision set corresponding to the subsequent rule with the same behavior as the current rule into the matching set S i of the current rule. 9.根据权利要求7所述的方法,其特征在于,根据冲突类型回溯冲突源以找出引起冲突的冲突规则,以及冲突规则中所定义的引发了所述规则冲突的数据包集,具体包括:9. The method according to claim 7, characterized in that, according to the conflict type, the source of the conflict is traced back to find out the conflict rule causing the conflict, and the defined packet set in the conflict rule that caused the rule conflict, specifically comprising : 若当前规则ri产生的是覆盖冲突,冲突源为Ri∩MiIf the current rule r i generates a coverage conflict, the source of the conflict is R i ∩ M i ; 若当前规则ri产生的是冗余冲突,冲突源为Ei∩SiIf the current rule r i generates a redundant conflict, the conflict source is E i ∩ S i . 10.一种识别防火墙的规则冲突的终端,其特征在于,包括:10. A terminal for identifying firewall rule conflicts, characterized in that it comprises: 数据包集定义单元,用于对于防火墙中的每一条规则均定义多个数据包集,每一个数据包集存放与规则之间存在不同关联关系的数据包;The data packet set definition unit is used to define multiple data packet sets for each rule in the firewall, and each data packet set stores data packets that have different associations with the rules; 冲突定义单元,用于定义规则之间出现的规则冲突的冲突类型;a conflict definition unit, configured to define a conflict type of a rule conflict occurring between rules; 规则决策树单元,用于为一条当前规则构建一棵有向无环的规则决策树,基于当前规则的规则决策树识别当前规则与其余规则之间出现的规则冲突的冲突类型;The rule decision tree unit is used to construct a directed acyclic rule decision tree for a current rule, and identify the conflict type of rule conflicts between the current rule and other rules based on the rule decision tree of the current rule; 冲突源回溯单元,用于根据冲突类型回溯冲突源以找出引起冲突的冲突规则,以及冲突规则中所定义的引发了所述规则冲突的数据包集。The conflict source traceback unit is configured to trace back the conflict source according to the conflict type to find out the conflict rule causing the conflict, and the set of data packets defined in the conflict rule that caused the rule conflict.
CN201310138626.4A 2013-04-19 2013-04-19 Method and terminal for recognizing rule conflicts of firewalls Pending CN104113516A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310138626.4A CN104113516A (en) 2013-04-19 2013-04-19 Method and terminal for recognizing rule conflicts of firewalls

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310138626.4A CN104113516A (en) 2013-04-19 2013-04-19 Method and terminal for recognizing rule conflicts of firewalls

Publications (1)

Publication Number Publication Date
CN104113516A true CN104113516A (en) 2014-10-22

Family

ID=51710150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310138626.4A Pending CN104113516A (en) 2013-04-19 2013-04-19 Method and terminal for recognizing rule conflicts of firewalls

Country Status (1)

Country Link
CN (1) CN104113516A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106453387A (en) * 2016-07-28 2017-02-22 电子科技大学 Security strategy conflict detecting and eliminating method based on Hicuts algorithm
CN108471412A (en) * 2018-03-19 2018-08-31 武汉华大国家数字化学习工程技术有限公司 A kind of firewall rule conflict detection method
CN108566382A (en) * 2018-03-21 2018-09-21 北京理工大学 The fire wall adaptive ability method for improving of rule-based life cycle detection
CN109327472A (en) * 2018-11-30 2019-02-12 深圳天元云科技有限公司 Dynamic Programming firewall policy insertion method, system, terminal and storage medium
CN112425131A (en) * 2018-11-30 2021-02-26 华为技术有限公司 ACL rule classification method, ACL rule search method and ACL rule classification device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101388789A (en) * 2007-09-10 2009-03-18 上海市闵行中学 Solving method for IP address collision failure brought up by router software BUG
CN101753369A (en) * 2008-12-03 2010-06-23 北京天融信网络安全技术有限公司 Method and device for detecting firewall rule conflict
CN101876994A (en) * 2009-12-22 2010-11-03 中国科学院软件研究所 A Method of Establishing and Implementing a Multi-level Optimal Strategy Evaluation Engine
CN102737126A (en) * 2012-06-19 2012-10-17 合肥工业大学 Classification rule mining method under cloud computing environment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101388789A (en) * 2007-09-10 2009-03-18 上海市闵行中学 Solving method for IP address collision failure brought up by router software BUG
CN101753369A (en) * 2008-12-03 2010-06-23 北京天融信网络安全技术有限公司 Method and device for detecting firewall rule conflict
CN101876994A (en) * 2009-12-22 2010-11-03 中国科学院软件研究所 A Method of Establishing and Implementing a Multi-level Optimal Strategy Evaluation Engine
CN102737126A (en) * 2012-06-19 2012-10-17 合肥工业大学 Classification rule mining method under cloud computing environment

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
刘军军: "《基于决策树的防火墙策略算法研究》", 《万方数据库》 *
李林等: "《一种快速的防火墙规则冲突检测算法》", 《计算机应用研究》 *
王毅: "《防火墙规则冲突检测研究与实现》", 《防火墙规则冲突检测研究与实现 中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106453387A (en) * 2016-07-28 2017-02-22 电子科技大学 Security strategy conflict detecting and eliminating method based on Hicuts algorithm
CN106453387B (en) * 2016-07-28 2019-08-13 电子科技大学 Security strategy collision detection and removing method based on Hicuts algorithm
CN108471412A (en) * 2018-03-19 2018-08-31 武汉华大国家数字化学习工程技术有限公司 A kind of firewall rule conflict detection method
CN108566382A (en) * 2018-03-21 2018-09-21 北京理工大学 The fire wall adaptive ability method for improving of rule-based life cycle detection
CN108566382B (en) * 2018-03-21 2020-12-08 北京理工大学 A Firewall Adaptive Ability Improvement Method Based on Rule Life Cycle Detection
CN109327472A (en) * 2018-11-30 2019-02-12 深圳天元云科技有限公司 Dynamic Programming firewall policy insertion method, system, terminal and storage medium
CN112425131A (en) * 2018-11-30 2021-02-26 华为技术有限公司 ACL rule classification method, ACL rule search method and ACL rule classification device
CN109327472B (en) * 2018-11-30 2021-06-25 深圳天元云科技有限公司 Method, system, terminal and storage medium for dynamically planning firewall policy insertion
CN112425131B (en) * 2018-11-30 2022-03-04 华为技术有限公司 ACL rule classification method, ACL rule search method and ACL rule classification device

Similar Documents

Publication Publication Date Title
CN104243315B (en) Device and method for uniquely enumerating the path in analytic tree
US9270704B2 (en) Modeling network devices for behavior analysis
CN104113516A (en) Method and terminal for recognizing rule conflicts of firewalls
US7813350B2 (en) System and method to process data packets in a network using stateful decision trees
US10397116B1 (en) Access control based on range-matching
CN103259793B (en) Based on the deep packet inspection method of suffix automaton canonical engine configuration
CN105976031A (en) Parallel processing of data by multiple semantic reasoning engines
CN105743871A (en) Decision tree-based firewall policy conflict detection method
WO2010065418A1 (en) Graph-based data search
US9647947B2 (en) Block mask register key processing by compiling data structures to traverse rules and creating a new rule set
CN106027497A (en) DDoS (Distributed Denial of Service) tracing and source end filtering method oriented to SDN (Software Defined Networking) and based on OpenFlow-DPM
US20170048116A1 (en) Method And Systems To Reduce Filter Engine Rules For Network Packet Forwarding Systems
US9692705B1 (en) System and method for measurement of flow statistics
Pisharody et al. Security policy checking in distributed SDN based clouds
EP2023567A1 (en) Managing security rule conflicts
US9363275B2 (en) Sampled deterministic finite automata for deep packet inspection
US11968286B2 (en) Packet filtering using binary search trees
CN103746869B (en) With reference to data/mask and the multistage deep packet inspection method of regular expression
Antonello et al. Deterministic finite automaton for scalable traffic identification: The power of compressing by range
US8166536B1 (en) Transformation of network filter expressions to a content addressable memory format
US9413662B1 (en) Intra-term logical or operation in a network filter
CN104836700A (en) NAT (Network Address Translation) host number detection method based on IPID and probability statistics model
WO2016101552A1 (en) Message detection method and device, and storage medium
CN108512838A (en) Wireless sensor network Security Analysis of Routing Protocol method based on loophole attack
US9912581B2 (en) Flow inheritance

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20141022