Building Configuration Policy Checks, Part 2

Author
Terry Slattery
Principal Architect

In the prior post, Building Configuration Policy Checks, Part 1 I explained why configuration policies are needed. Now it is time to discuss how to build policies. I like to start with the written policies, because that tells me what was intended. An example is:

“All network devices will be configured to send syslog messages to the syslog server located at 10.1.200.5. The logging source should be the loopback0 and the level should be ‘informational’ and the default facility of local7 should be used.”

From this policy, I can create the device configuration statements and then create the rules and policies. The desired configuration for IOS and CatOS for logging would be:

IOS:
 logging 10.1.200.5

CatOS:
 set logging server enable
 set logging server 10.1.200.5
 set logging level sys 6 default

Now I can start to build the rules and policies.  There are several design choices that must be made when creating policies. A policy is comprised of multiple rules which are combined using boolean logic. Most tools, including NetMRI, includes a mechanism for building rules and policies.

It is best to use rules that check for the presence (or absence) of one or more configuration statements. In NetMRI, each rule can have a device filter applied that specifies the device configurations to which the rule should be applied. For example, checking that logging to a syslog server uses different syntax in IOS than in CatOS or JunOS. One way to build the check is to build separate policies for each OS type, using rules with the syntax that applies to the OS being checked. Using the is method creates a lot of policies, one for each OS type. In this case, no device filter is needed on each rule. The device filter is applied to the policy. Here is an example:

Rule 1: logging 10.1.200.5
  Policy IOS Logging: Rule 1
  Policy IOS Logging filter: IOS devices only

Rule 2: set logging server enable
Rule 3: set logging server 10.1.200.5
Rule 4: set logging level sys 6 default
  Policy CatOS Logging: Rule 2 and Rule 3 and Rule 4
  Policy CatOS Logging filter: CatOS devices only

The above method creates two policies. I find that having too many policies clutters the policy reports, making the reports more difficult to read.

I prefer to have a single policy that checks for the correct logging configuration. A single policy is constructed a bit differently and relies on device filters on each rule. Here is its example:

Rule 1: logging 10.1.200.5
Rule 1 filter: IOS devices
Rule 2: set logging server enable
Rule 2 filter: CatOS devices
Rule 3: set logging server 10.1.200.5
Rule 3 filter: CatOS devices
Rule 4: set logging level sys 6 default
Rule 4 filter: CatOS devices
  Policy Logging: Rule 1 and Rule 2 and Rule 3 and Rule 4

There is no policy filter needed, except perhaps to specify Cisco devices.

Rule 1 will only apply to IOS devices while Rule 2, Rule 3, and Rule 4 will only apply to IOS devices. All exceptions to the logging configuration will appear in the policy report specific to logging.

Policies can get complex as you deal with differences in OS versions. I sometimes have to make a command specific to a particular platform, such as the authentication attempts command, which is not found on certain platforms (3550/2950).
aaa authentication attempts login 5

The NetMRI issue display shows how many devices don’t match each policy, making it is easy to identify the configurations that need correction and quickly get to a compliant network.

-Terry

_____________________________________________________________________________________________

Re-posted with Permission 

NetCraftsmen would like to acknowledge Infoblox for their permission to re-post this article which originally appeared in the Applied Infrastructure blog under http://www.infoblox.com/en/communities/blogs.html

infoblox-logo

Leave a Reply

 

Nick Kelly

Cybersecurity Engineer, Cisco

Nick has over 20 years of experience in Security Operations and Security Sales. He is an avid student of cybersecurity and regularly engages with the Infosec community at events like BSides, RVASec, Derbycon and more. The son of an FBI forensics director, Nick holds a B.S. in Criminal Justice and is one of Cisco’s Fire Jumper Elite members. When he’s not working, he writes cyberpunk and punches aliens on his Playstation.

 

Virgilio “BONG” dela Cruz Jr.

CCDP, CCNA V, CCNP, Cisco IPS Express Security for AM/EE
Field Solutions Architect, Tech Data

Virgilio “Bong” has sixteen years of professional experience in IT industry from academe, technical and customer support, pre-sales, post sales, project management, training and enablement. He has worked in Cisco Technical Assistance Center (TAC) as a member of the WAN and LAN Switching team. Bong now works for Tech Data as the Field Solutions Architect with a focus on Cisco Security and holds a few Cisco certifications including Fire Jumper Elite.

 

John Cavanaugh

CCIE #1066, CCDE #20070002, CCAr
Chief Technology Officer, Practice Lead Security Services, NetCraftsmen

John is our CTO and the practice lead for a talented team of consultants focused on designing and delivering scalable and secure infrastructure solutions to customers across multiple industry verticals and technologies. Previously he has held several positions including Executive Director/Chief Architect for Global Network Services at JPMorgan Chase. In that capacity, he led a team managing network architecture and services.  Prior to his role at JPMorgan Chase, John was a Distinguished Engineer at Cisco working across a number of verticals including Higher Education, Finance, Retail, Government, and Health Care.

He is an expert in working with groups to identify business needs, and align technology strategies to enable business strategies, building in agility and scalability to allow for future changes. John is experienced in the architecture and design of highly available, secure, network infrastructure and data centers, and has worked on projects worldwide. He has worked in both the business and regulatory environments for the design and deployment of complex IT infrastructures.