Juniper CONFIG_CHECK Keywords
The following table indicates how each keyword in the Juniper compliance checks can be used:
Keyword |
Example Use and Supported Settings |
---|---|
type |
CHECK_CONFIG and SHOW_CHECK_CONFIG “CHECK_CONFIG” determines if the specified config item exists in the Juniper “show configuration” output in “set” format. In the same manner, “SHOW_CONFIG_CHECK” audits if the config item exists in the “show configuration” output in default format. |
description |
This keyword provides the ability to add a brief description of the check that is being performed. It is strongly recommended that the Example: description: " 3.1 Disable Unused Interfaces" |
info |
The “ Note: Each “ Example: info: "Review the list of interfaces" info: "Disable unused interfaces" |
severity |
The “ Example: severity: MEDIUM The severity can be set to HIGH, MEDIUM, or LOW. |
regex |
The “ Example: regex: " set system syslog .+" The following meta-characters require special treatment: + \ * ( ) ^ Escape these characters out twice with two backslashes “\\” or enclose them in square brackets “[]” if you wish for them to be interpreted literally. Other characters such as the following need only a single backslash to be interpreted literally: . ? " ' This has to do with the way that the compiler treats these characters. If a check has “ |
expect |
This keyword allows auditing the configuration item matched by the “ Example: expect: "syslog host 1.1.1.1" The check passes as long as the config line found by “ Example: regex: "syslog host [0-9\.]+" expect: "syslog host 1.1.1.1" In the above case, the “ |
not_expect |
This keyword allows searching the configuration items that should not be in the configuration. Example: not_expect: "syslog host 1.1.1.1" It acts as the opposite of “ Example: regex: "syslog host [0-9\.]+" not_expect: "syslog host 1.1.1.1" In the above case, the “ |
number_of_lines |
This keyword allows testing compliance of an audit check based on the number of matching lines returned by the config. <custom_item> type: CONFIG_CHECK description: "Syslog" regex: "syslog host [0-9\.]+" number_of_lines: "^1$" </custom_item> In the above case the check will pass as long as only one line is returned that matches the “ |