Skip to main content

Mapping

A mapping section declares a map between one or more rWeb Zones and one or more Director Workflows. You can have one or more mappings declared in Director configuration, that will be checked periodically against the current rWeb configuration (using poll-time).

Mapping​

[[mapping]]
# This is the easiest way to set a default workflow for every zone - the default
# can be overriden by subsequent mappings as necessary
group-id-recursive = 0 # Default Group is always ID 0
workflows = []

# A second mapping, overriding previous mappings where they overlap
# Each section will fully override previous sections that match the same zone.
[[mapping]]
# List of workflow names for this map.
# Must correspond to a valid workflow in the `[workflows]` section
# Example:
workflows = [
"A-Workflow",
"Another-Workflow",
]

# Use one or more of these ID mapping tools examples:

# Set or override mapping for specific zones
zone-id = 1
zone-ids = [1, 2]

# Applies to each zone of the group
group-id = 1
group-ids = [1, 2]

# Applies to each zone in the group as well as all the child groups all the way down
# `group-id-recursive = 0` is the easiest to use for default behavior
group-id-recursive = 1
group-ids-recursive = [1, 2, 3]

Mapping Keys​

Each mapping should contain at least two key value sets:

  • workflows: A set of zero or more workflows that have also been specified in the configuration file. Each configured workflow will be checked against the traffic conditions specified for each of the Zones identified in the mapping.
  • One or more of the following Zone mappings, that will provide the set of Zones that will be checked against each of the configured workflows:
    • zone-id: A single specified Zone by its ID.
    • zone-ids: A list of Zones, specified by their IDs.
    • group-id: A single Group, specified by its ID. This will in turn provide the set of Zones that have this Group as their direct owning parent.
    • group-ids: A list of Groups, specified by their IDs. This will in turn provide the set of Zones that have any Group from this list as their direct owner.
    • group-id-recursive: A single Group, specified by its ID. This will in turn provide the set of all Zones that are either in this Group or are in a Group that has this one as an ancestor. Essentially, it "walks the tree" of all children Groups and Zones to derive all child Zones. The Default Group, with a group ID of 0, is the easiest way to configure a baseline behavior for all Zones (see the example TOML fragment above).
    • groups-ids-recursive: Identical to group-id-recursive, except that it checks the tree of each specified Group ID and merges their Zones into a unique final set of child Zones.
warning

The order of mapping entries matter. Later entries will overwrite workflows assigned to Groups or Zones previously. While this can be useful (such as assigning a default workflow to all Zones using 'group-id-recursive = 0'), care should be taken to make sure any further overwrites are intentional. The workflows for a zone can be checked in the CLI by issuing show config zone.

Default Zone Caveats​

The Default Zone (with zone ID 0) is normally configured with two default routes: 0.0.0.0/0 for IPv4 and ::/0 for IPv6. Director strips these routes when configuring the internal mappings, as the network flow samples being processed may not have a fixed direction (samples could be inbound or outbound) and a Zone (in rWeb) is meant to represent inbound traffic only. If you do not have more specific prefixes configured against other Zones, you should consider at a minimum adding your address space prefixes to the Default Zone's routes. This way Director knows which samples can be considered inbound vs outbound network traffic when doing rate calculations. See additional explanation here.