Fork me on GitHub

Netspoc: A workflow outline

Netspoc is a Network Security Policy Compiler. It takes a set of access rules (services) and a given network topology specified in Netspoc policy language and generates access lists and static routes for those routers of the network topology marked to be managed by Netspoc (called managed routers in the following).

Netspoc is a two pass compiler. From input, pass 1 generates two files for every managed router: The configuration template file, containing router configurations excluding ACL information, and the rule file storing those rules of the given service input that affect ACL generation on the particular router. In pass 2, ACLs are derived from rule files and inserted in the configuration template. As ACL generation involves time consuming optimization processes and since input modifications usually affect a small selection of managed routers only, pass 2 tries to reuse configuration files generated from a previous run. For this purpose, pass 2 compares its current input with the stored input of the previous run, generating new configuration files only for affected routers and reusing configuration files otherwise.

To generate router configurations from a given input, following steps are conducted:

Pass 1

  1. Parse network topology and rule set.
  2. Connect elements of the topology to form a topology graph.
  3. Perform consistency checks on the rule set, transfer rules into a path rules set with [source, destination] pairs.
  4. Find all paths in the topology graph for every source and destination pair, marking managed routers on the path with the corresponding rules and routing information.
  5. Convert information collected at managed routers into configuration template and rule files.

Pass 2

  1. Check, whether reusable configuration files from a previous run exist.
  2. Optimize ruleset for routers, whose configuration files can not be reused.
  3. Generate ACLs and write final router configuration files.

Each of the steps consists of several tasks and operations that will be described below. For more detailed information, have a look at the technical documentation page, providing an elaborate description of the individual functions. If technical documentation is available for a certain step, the relevant part is linked within the descriptions below.

Pass 1

1. Parsing the input

First, input topology and rule set need to be parsed.

2. Creating the topology graph

In this step, topology objects generated during parsing are used to create a topology graph.

3. Preparing rules

Rules are now checked for consistency and grouped to receive a set of so called path rules. Path rules contain a [source zone, destination zone] pair and references to every input rule having its source within the source zone and its destination within the destination zone. Thus, the path rule set represents every rule from input.

4. Distributing rules and routes

For every pair in the path rule set, the topology graph is traversed from source to destination, collecting routing and rule information within the managed router objects on the path. During rule and routing distribution, further consistency checks are performed on the ruleset.

5. Generating output

Finally, pass 1 output is generated and printed to a directory specified by the user.

Pass 2

In pass 2, a valid and complete router configuration file is written for every router, combining its configuration template file and collected rule information.

1. Checking for reusable files

Check, whether configuration files from previous runs can be reused.

2. Optimizing router rule sets

For those routers whose configuration files can not be reused, local router rulesets are optimized and ACL information is generated from the optimized ruleset.

3. Generating final output

Finally, router configuration files are provided in the specified directory.

Copyright © 2023 Meike Bruns