first checks if the ICIR has a valid structure for clustering. That is, (1) the considered
ICIR must have at least two children; (2) at least one selector of ICIR root must be a
range of values or a wildcard. The joined rules in a cluster must form a continuous
range (with or without overlapping) and must be subset, superset or equal the
corresponding root selector; and (3) for root selectors that do not have multiple
values, rules in the cluster must have the same value as root, or at least one of them
must be a wildcard. Then it sorts children by destination port in ascending order.
Algorithm 3. Inconsistency Characterization.
1
Func doClassification(in Rule: root, Rule: cluster; out
1
else { // Root is first rule
2
String: conflictType)
2
if (superset(cluster, root)
3
Alg
3
conflictType = “Cluster is generalization of root”
4
// Root is last rule
4
else if (subset(cluster, root)
5
if (root.getPriority()>cluster.getLastRulePriority()) {
5
conflictType = “Cluster is shadowed by root”
6
if (cluster == root)
6
else
7
conflictType = “Root is exact shadowed by union”
7
conflictType = “Root and cluster are correlated”
8
else if (superset(cluster, root))
8
}
9
conflictType = “Root is shadowed by cluster”
9
return conflictType
10
else if (subset(cluster, root))
10
End Alg
11
conflictType = “Root is generalization of cluster”
11
12
else
12
13
conflictType = “Root and cluster are correlated”
13
14
}
14
Next, the algorithm checks if root is the last or first rule or is in between. If root is in
between it divides children in two lists: rules that come before and rules that go after
root, as also was explained before. Finally, if clustering is possible, it calls Algorithm
2, and if not, it calls directly the inconsistency characterization (Algorithm 3). Algo-
rithm 2 also takes as input ICIR root and children. This algorithm implement the
heuristic as it has been described in the previous section. Characterization algorithm
(Algorithm 3) follows directly the extended definitions proposed in an earlier section.
Algorithm 3 takes as input ICIR root and the clusters of that ICIR. Then, it checks
each type of inconsistency using the equality, subset and superset operations. Note
that characterization is different depending on the relative priority of the ICIR root (if
it is the first or last rule). Algorithm 3 is in O(c). Result is returned as a text string.
The combined worst case complexity of the three algorithms is in O(clogc). As these
algorithms must be run for each ICIR, the final time complexity is in O(h*clogc),
where h is the cardinality of the diagnosis set (or the number of ICIRs) and c is the
number of children of each ICIR. Note that the combinatorial part of the inconsis-
tency characterization problem is only the clusterization (where the heuristic has been
used), and not the characterization itself.
5 Conclusions and Future Works
In this paper, we have analyzed the inconsistency characterization problem in firewall
rule sets. We have proposed a complete and formal inconsistency characterization for
clusters of rules in order to obtain a one-to-many characterization. The analysis of the
characterization problem enabled us to identify and isolate the combinatorial part of
143