In Network Configuration Manager (NCM), rules define the criteria a device configuration must meet to comply with your organization’s standards. They form the building blocks of compliance policies, enabling you to detect deviations automatically, enforce best practices, and maintain security baselines.
A rule is composed of multiple components, and each component has a specific function in determining whether a configuration passes or fails the compliance check. Using Network Configuration Manager's rule creation workflow, you can add and configure components in the required sequence.
In Network Configuration Manager,
To create a new rule,
| Component | Fields |
|---|---|
| Condition |
|
| Block Identification |
|
| Loop |
Execute the defined Condition on each block |
| Compliant |
If the evaluated block fully meets the defined Condition |
| Violation |
|
| Not Required |
When a specific configuration does not need to be evaluated for compliance |
| End |
To stop the process after the intended checks have been completed |
| Process |
Execute multiple validations or operations independently, without interlinking |
The Condition component defines the exact criteria to be matched within the device configuration. This is the primary validation stage where NCM evaluates whether a configuration meets or fails the set standard. You can specify the match scope, criteria, variables, and pattern. The actual compliance happens here, and the results from this step directly determine the outcome for the evaluated configuration section.
This is an optional component. The Block Identification narrows the Condition to specific sections of the configuration. It identifies and extracts relevant sections based on start and end markers, indentation, or parsing rules without performing validation itself. When a start block and an end block are defined to identify a configuration block, the block identification criteria can be applied to run conditions only within the matched block, allowing further filtering of the configuration. By isolating these blocks, subsequent checks are more targeted and efficient.
Start Block is a mandatory field used to define the beginning of a configuration block. The value can be defined as a regular expression, and it may also include rule inputs or Grep outputs.
End Block is an optional field to specify the end of the block. Both variables and regex patterns are supported.
There are three ways of identifying blocks:
Consider a single line or multiple lines as a block.
The Loop component executes the defined Condition on each block identified in the previous step. This ensures that every relevant block is individually checked, and the loop can also be used to trigger further block identification.
If the evaluated block or pattern fully meets the defined Condition, NCM marks it as compliant. The result can be generated as a report for tracking.
If the evaluated block or pattern fails to meet the defined Condition, it is flagged as a violation. It includes severity levels, descriptive messages, remediation procedures, and automated configlets for resolution.
Not Required is used when a specific configuration or section does not need to be evaluated for compliance. This way, the user can decide when a rule is not applicable to certain devices, contexts, or configurations.
The End component signals the conclusion of the loop. Once this step is reached, no further evaluation is performed for the current block or configuration. It is used to stop the process after the intended checks have been completed.
It executes multiple validations or operations independently, without linking their logic together. It is particularly useful for running distinct compliance checks without creating multiple, separate rules. The results from each process are recorded individually.
| Field | Description |
|---|---|
| Name |
A descriptive label. |
| Scope |
Allows you to specify and select the device input, such as:
|
| Criteria |
|
| Variables |
Variables can be used to store values that can be reused in other components of the same rule, remediation configlet, and command template.
Click here to learn more about variable configuration. |
| Criteria pattern |
Users can add multiple expressions (AND/OR) to define the pattern of the criteria. |
set grayware, then any line that includes that text will be considered compliant.Variables serve as placeholders that store values which can be reused across multiple conditions or blocks within a workflow. In both "Parse from config" and "User Input", the variable can be reused in other components of the same rule, remediation configlet, and command template.
Parse from Config
The Parse from Config variables allow you to extract specific values from a device’s configuration using predefined patterns. They are defined inside brackets like ($VARIABLE_NAME) and are linked to a regex pattern provided by the user. This enables dynamic extraction of values from configurations.
For example, if the configuration contains interface Loopback0 and you need to capture Loopback0 as a variable, you can define it as interface ($INTERFACE_NAME). The $INTERFACE_NAME variable will then match the value based on the regex pattern you specify—such as (\S+), which captures any non-whitespace characters following the word interface.
Let us consider a sample input and its desired output:
Start Block: interface ($INTERFACE_NAME)
Vairable Details:
Please note that the RegEx value can be modified as per the user need. For instance, in case of an integer, \d+ can be used. $INTERFACE_NAME is replaced by (\S+) and the updated start block, interface (\S+), is used to match content in the configuration.
Sample configuration:
Output:
| Variable Name | Value |
|---|---|
| $INTERFACE_NAME |
loopback0 |
User Input
Users can customize and change the input. Unlike "Parse from config", the user input is a static value. Here, enabling the "Make this a global variable" check box allows the variable to be used in other rules.
Thank you for your feedback!