NetEdit Conformance - Best Practices
NetEdit Conformance - Best Practices
ARUBA NETEDIT
CONFORMANCE AND
BEST PRACTICES
Contents
REVISION HISTORY ....................................................................................................................................3
Introduction ..................................................................................................................................................4
Built-in Conformance Tests .............................................................................................................................................. 4
Conformance Tests Best Practices ..............................................................................................................8
Interface description ......................................................................................................................................................... 8
SNMP ............................................................................................................................................................................... 9
Management Access restriction ..................................................................................................................................... 10
IP helper ......................................................................................................................................................................... 12
VSX ................................................................................................................................................................................ 13
Banner ............................................................................................................................................................................ 14
NTP ................................................................................................................................................................................ 15
OSPF .............................................................................................................................................................................. 16
BGP ................................................................................................................................................................................ 17
Physical Security ............................................................................................................................................................ 18
Miscellaneous ................................................................................................................................................................. 19
Other Conformance Tests ..........................................................................................................................20
Hostname ....................................................................................................................................................................... 20
L3 interface numbering ................................................................................................................................................... 21
Routed Only Port ............................................................................................................................................................ 22
Appendix....................................................................................................................................................23
Regex Numeric Range Generator .................................................................................................................................. 23
NetEdit Conformance Help ............................................................................................................................................. 23
2
Technical Whitepaper
NetEdit Conformance and Best Practicest
REVISION HISTORY
3
Technical Whitepaper
NetEdit Conformance and Best Practicest
INTRODUCTION
This guide provides examples of Conformance test rules that can be enabled on NetEdit to check the compliance of the network
nodes against industry Best Practices or custom Best Practices.
NetEdit runs conformance test in real-time against stored configuration. As soon as the modified conformance test is enabled, the
result of the test is available through the configuration Editor or through the dashboard (Configuration Policy Violations).
Would the running configuration of the device be modified through another mechanism than the NetEdit configuration Editor, the
NetEdit user can see the compliance after a delay of 5 minutes (maximum), which corresponds to the regular NetEdit scan of the
AOS-CX nodes (during scan, NetEdit collects switch configuration among others).
Please note:
• The filter in the Conformance rule has great importance. If no filter is used, all devices must comply with the rule defined in the
Commands section. If filter is used, only switches matching the filter condition have to comply. Devices not matching the filter are
not verified against the said rule. The filter query applies to the current state of the switch, not to the candidate configuration. For
instance, the VSX test filters on 'role', but if the 'role' keyword is removed in a candidate configuration, then the conformance test
will still be applied to the candidate until it is deployed to the switch. So, it is not recommended to use “running-configuration
filter”. Instead, filter such as custom attributes could be very useful (example: production versus engineering node).
• Severity should be selected according to operational enforcement rules.
These are the built-in conformance tests coming by default with NetEdit:
4
Technical Whitepaper
NetEdit Conformance and Best
P ti t
Only “Requirements” conformance test is enabled as it is used to make sure that NetEdit can properly manage the devices.
https-server vrf .*
5
Technical Whitepaper
NetEdit Conformance and Best
P ti t
6
Technical Whitepaper
NetEdit Conformance and Best
P ti t
7
Technical Whitepaper
NetEdit Conformance and Best
P ti t
Interface description
Description: all physical interfaces, LAG interfaces, VSX LAG interfaces, that are active (“no shutdown”), must have a description.
Severity: WARNING
Commands:
WITHIN interface lag (\d+) multi-chassis IF no shutdown THEN description MUST EXIST
8
Technical Whitepaper
NetEdit Conformance and Best
P ti t
SNMP
Name: SNMP
Severity: WARNING
Severity should be selected according to operational enforcement rules. Device Filter: None (check all devices)
Commands:
snmpv3 .*
9
Technical Whitepaper
NetEdit Conformance and Best
P ti t
Severity: ERROR
Device Filter: None (check all devices). A filter could be applied to select only the production devices.
Commands:
10 10.10.10.0/24
object-group port mgmt_ports
10 eq 22
20 eq 443
access-list ip mgmt_traffic
10
Technical Whitepaper
NetEdit Conformance and Best
P ti t
First line can be uncommented and following lines removed for less specific matching.
11
Technical Whitepaper
NetEdit Conformance and Best
P ti t
IP helper
Severity: WARNING
Commands:
12
Technical Whitepaper
NetEdit Conformance and Best
P ti t
VSX
Severity: WARNING
This device filter called “role” matches all devices with running configuration containing the keyword “role”. Commands:
The linkup-delay-timer should be higher than 30s and lower than 600s.
13
Technical Whitepaper
NetEdit Conformance and Best
P ti t
Banner
Name: Banner
Severity: ERROR
Commands:
14
Technical Whitepaper
NetEdit Conformance and Best
P ti t
NTP
Name: NTP
Description: NTP
Severity: ERROR
Device Filter:
Commands:
ntp authentication
15
Technical Whitepaper
NetEdit Conformance and Best
P ti t
OSPF
Name: OSPF
Severity: ERROR
Commands:
router ospf.*
16
Technical Whitepaper
NetEdit Conformance and Best
P ti t
BGP
Name: BGP
Severity: ERROR
Commands:
router bgp .*
bgp fast-external-fallover
bgp always-compare-med
bgp log-neighbor-changes
bgp deterministic-med
17
Technical Whitepaper
NetEdit Conformance and Best
P ti t
Physical Security
Severity: ERROR
Commands:
no usb
18
Technical Whitepaper
NetEdit Conformance and Best
P ti t
Miscellaneous
Name: Misc
Severity: ERROR
Commands:
logging 10.1.10.100
19
Technical Whitepaper
NetEdit Conformance and Best
P ti t
Here is a list of conformance rules that proposed to help a network operation team building policies against internal organization practices.
Hostname
Name: hostname
Severity: ERROR
Device Filter: None (check all devices). Filter could be used to apply different rules based on device location
Commands:
hostname [A-Z]{3}SW-8(320|325|400)-\d{1,}
In this example the hostname must have 3 Upper letters (ex: site code), then SW then model then id. Ex: SFOSW-8400-12
20
Technical Whitepaper
NetEdit Conformance and Best
P ti t
L3 interface numbering
Description: VLAN IP address 3rd octet much match the VLAN number
Device Filter:
Commands:
21
Technical Whitepaper
NetEdit Conformance and Best
P ti t
Name: ROP
Severity: ERROR
Commands:
WITHIN interface lag (\d+) IF no shutdown THEN no routing MUST NOT EXIST
22
Technical Whitepaper
NetEdit Conformance and Best
P ti t
APPENDIX
In order to generate regex range easily, there are some tools available on internet, like:
http://gamon.webfactional.com/regexnumericrangegenerator/
Overview
Conformance validation detects configurations that violate your corporate policies or network design by comparing switch
configurations against conformance tests. You can define policies by creating and enabling conformance tests in Settings /
Conformance. The tests are run continuously against both candidate and running configurations. Conformance test results for
running configurations are searchable on the device search page and displayed on both the dashboard and plan details page.
Conformance test results for candidate configurations are displayed in the editor and on the plan details page.
To add a new conformance test, select Settings / Conformance / New and enter the name of the test, the severity (warning or
error), optionally the subset of devices to be validated, and the conformance test statements. Each conformance test can be
enabled or disabled. A disabled conformance test is not run against any configurations. To edit a conformance test, double-
click the test name.
The test can be applied to all devices by leaving the search query empty, or a query can be used to restrict the test so that it
runs only on matching devices. Note that this query is continuously evaluated, so if a device changes to match the query then
the test will be run against that device. For example, if you write a test and restrict it to switches running version 10.02.0010,
then this test will not be run against a switch running version 10.02.0001. If you then upgrade that switch to 10.02.0010, the
test will now automatically be run against this switch.
A good way to start writing a conformance test is to paste a known compliant block of switch configuration as a set of test
statements, then genericize the matching using regular expressions (where applicable). If additional tuning is needed, the
more powerful syntax and matching is described below.
A conformance test contains a collection of statements which describe the desired state of the configuration, from a semantic
perspective. A simple conformance test is the single statement:
ntp server 192.168.0.7
This test will pass if the configuration file has this exact line, and will fail if it does not.
General Format
More sophisticated tests can be written by using the test keywords, regular expressions, and parameters described below
and constructed according to the following general rules:
For example:
23
Technical Whitepaper
NetEdit Conformance and Best
P ti t
means that 'interface mgmt' context which contains the 'no shutdown' command, must also have a 'name' within that context.
The following configuration will fail this test because the interface does not have a name:
ip static 1.1.1.1/24
If the statement does not contain any keywords (WITHIN, IF, THEN, MUST, NOT, EXIST, MATCH) then the line must exist
and must exactly match. For example:
Context - compared to the entire line at root level. Qualifies where the remainder of the matching occurs. If not specified, the
remainder of the matches will occur at root level.
Condition - compared to other entire lines within the given context. Qualifies the condition under which the statement should
apply.
Parameter - compared to the start of the entire line within the given context. The parameter may include multiple terms.
Any items (context, condition, parameter, value) may contain extended regular expressions, for flexible matching. For
example:
specifies that all vlan interfaces (i.e., interfaces with names matching the regular expression 'vlan.*') must have 'ip ospf'
configured.
Any regex match groups specified in the context/condition may be used as parameter values. A match group is a portion of the
regular expression which is enclosed within parenthesis. Match groups allow you to write rules that use dynamic values from
configuration. For example:
specifies that interfaces in module 1 (i.e., modules whose interfaces match 1/1/(\d+)) must have an IP address constructed
using the interface number as the last digit (i.e., 10.0.0.\1). The following configuration will pass because the interface number
is 7 and the ip address is 10.0.0.7:
ip address 10.0.0.7
24
Technical Whitepaper
NetEdit Conformance and Best Practicest
The example above illustrates that a regular expression matching an integer can capture that value in a match group using
the syntax (\d+), and the matched value can be used in subsequent matches with the syntax '\1'. Generally the first
captured value is '\1', the second '\2', and so on.
Context
Within a statement, the context is optional. It restricts the configuration contextual block in which checking is performed. If
no context is specified, the statement will match only the root (top level) context.
Context is implied based upon indenting. If a statement is indented, the context will be the previous line context. It simplifies
adding multi-line configuration items into conformance policies, and is easier to read and verify that the policy specification
is correct. For example:
access-list ip segment-vlan261
20 permit any 15.55.0.0/255.255.0.0 any count 30 deny any any any log count
WITHIN access-list ip segment-vlan261 THEN 10 permit any 13.33.0.0/255.255.0.0 any MUST EXIST WITHIN access-list
ip segment-vlan261 THEN 20 permit any 15.55.0.0/255.255.0.0 any count MUST EXIST WITHIN access-list ip segment-
vlan261 THEN 30 deny any any any log count MUST EXIST
Condition
Within a statement the condition is optional. It restricts the matching to only occurring in a configuration context block where
the given condition occurs within that block. For example:
checks that any interfaces which are enabled must have a description. The statement does not apply to interfaces where no
shutdown does not appear in the configuration text.
Parameter and Value
Within a statement the match parameter is required. It specifies the keyword(s)/term(s) being validated. The value can be
specified within the parameter or separately using the 'MATCH value' syntax. For example, the following two statements are
equivalent:
WITHIN context IF condition THEN parameter value MUST EXIST WITHIN context IF condition THEN parameter MUST
MATCH value
Viewing Conformance Results
Conformance tests are run continuously against managed devices. When conformance validation detects a violation in the
current running and startup configurations of a device, that device is flagged and can be identified through:
The device details page shows the result of the current conformance settings against the device's current running
configuration at the top of the page. The conformance result for each plan at the time that plan was deployed is shown to
the right of the revision history.
Conformance in the Editor
When viewing a device configuration in the editor, relevant conformance failures are shown. The results are updated in
25
Technical Whitepaper
NetEdit Conformance and Best Practicest
real- time as the configuration is edited. This feedback loop allows admins to resolve all conformance failures prior to
deploying a configuration change.
Where possible, conformance failures will be associated with the line that most closely matches the error. Line-specific
failures are marked on the line where they occur on the left side of the editing pane. The details for any line-specific
failure are only shown in the Insights panel when the cursor is on the associated line.
Failures where no line is associated (such as a missing command) are not marked on the left side of the editor, they are
shown only in the Insights panel. Such failures appear in the Insights panel when the cursor is on any line.
The summary totals for the plan are shown in the lower right corner. These totals do not change depending upon which
candidates are hidden/visible.
Each statement in a conformance test will report a failure for every line which violates the test. It means that a conformance
test with a statement:
Conformance in Plans
When deploying a new configuration to a set of devices, or for plans previously deployed, the conformance validation status
is displayed on the plan details page. The conformance result for each device in the plan is shown under the list of
devices.
A summary of the failures in the entire plan is shown under "Conformance". Clicking this item will display a pop-up window
which shows all conformance tests that ran against the plan. Click the expansion arrow to view specific failures that
occurred for each test. Tests with no failures are shown, but are not expandable.
26
Technical Whitepaper
NetEdit Conformance and Best Practicest
www.arubanetworks.com
3333 Scott Blvd. Santa Clara, CA 95054
1.844.472.2782 | T: 1.408.227.4500 | FAX: 1.408.227.4550 | [email protected]