Theory FWNormalisationCore
subsection ‹Policy Normalisation: Core Definitions›
theory
FWNormalisationCore
imports
"../PacketFilter/PacketFilter"
begin
text‹
This theory contains all the definitions used for policy normalisation as described
in~\<^cite>‹"brucker.ea:icst:2010" and "brucker.ea:formal-fw-testing:2014"›.
The normalisation procedure transforms policies into semantically equivalent ones which are
``easier'' to test. It is organized into nine phases. We impose the following two restrictions
on the input policies:
\begin{itemize}
\item Each policy must contain a $\mathtt{DenyAll}$ rule. If this restriction were to be lifted,
the $\mathtt{insertDenies}$ phase would have to be adjusted accordingly.
\item For each pair of networks $n_1$ and $n_2$, the networks are either disjoint or equal. If
this restriction were to be lifted, we would need some additional phases before the start
of the normalisation procedure presented below. This rule would split single rules into
several by splitting up the networks such that they are all pairwise disjoint or equal.
Such a transformation is clearly semantics-preserving and the condition would hold after
these phases.
\end{itemize}
As a result, the procedure generates a list of policies, in which:
\begin{itemize}
\item each element of the list contains a policy which completely specifies the blocking behavior
between two networks, and
\item there are no shadowed rules.
\end{itemize}
This result is desirable since the test case generation for rules between networks $A$ and $B$
is independent of the rules that specify the behavior for traffic flowing between networks $C$
and $D$. Thus, the different segments of the policy can be processed individually. The
normalization procedure does not aim to minimize the number of rules. While it does remove
unnecessary ones, it also adds new ones, enabling a policy to be split into several independent
parts.
›
text‹
Policy transformations are functions that map policies to policies. We decided to represent
policy transformations as \emph{syntactic rules}; this choice paves the way for expressing the
entire normalisation process inside HOL by functions manipulating abstract policy syntax.
›
subsubsection‹Basics›
text‹We define a very simple policy language:›