Auditing Cisco configuration - CIS RAT

CIS RAT (Centre for Internet Security - Router Assessment Tool) is a free Perl tool that audits Cisco config files against CIS benchmarks, it creates an HTML report and shows where your config meets or fails CIS benchmark. We can audit against benchmark level 1 and 2.The tool is supported on both Linux and Windows (though getting it to work on Windows required a bit of source code tweaking). 

RAT can audit configuration of the following devices:
  • IOS
  • ASA
  • PIX
  • FWSM
RAT can be downloaded here: 

Installation on Windows requires ActiveState Perl to be installed. Detailed installation instruction can be found in "rat\etc\install.win32.txt" upon extraction. 

Upon installing RAT I had to edit "" and change the following (this shouldn't be required so it may work in your case)

  • line 669: to point to the correct directory
    • use lib 'c:\rat\lib';.
  • lines 746 & 747: again hard coding the paths
    • $ncat_prog        = $PROG_PREFIX . '\bin\';
    • $ncat_report_prog = $PROG_PREFIX . '\bin\'

RAT allows us to customize set of "checks" we want to perform. This step is not required if you want to audit against actual CIS benchmark, in most cases however, we will want to edit it to align it with our Security Policy. 

Run "":

"C:\rat\bin>perl -s customorules.conf"

The script will ask a number of questions and allow you to customize set of checks it'll perform. It'll then save "customrules.conf". For example if you have a separate management network (for VTY access or SNMP) that you already protect with ACLs you may not want to apply additional local ACLs, which is required by the "default" CIS benchmark. Another example is exec timeout. CIS requires that the timeout is set to 10 while your security policy may require 5.  

Running RAT:

By default RAT uses rule set for IOS devices, so we don't need to specify -t. 

c:\>perl  -r customrules.conf "c:\confs\"

To audit PIX, ASA, FWSM we need to use option "-t" to specify config type:

c:\>perl -t cisco-firewall -r customrules.conf "c:\confs\"

I have run into issue where RAT will fail with the following error:

"Nested quantifiers in regex; marked by <-- HERE in m/IOSSNMPCommunity->** <-- "

This happens when "snmp-server community" option is set to asterisks. That would be the case if you copy the IOS config file from CiscoWorks.  Just delete the asterisks and re-run the script. 

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.