Skip to main content

Auditing Cisco configuration - startup-config vs running-config

There are two types of config files in Cisco switches and routers. They are "startup" and "running" configs. 


Startup config - is a configuration file stored in NVRAM that a device will use to configure itself upon reload. It can be viewed by running "show startup-config" command. 


Running config - is a currently used configuration stored in volatile memory. It can be viewed by running "show running-config" command.


When an admin logs in to a switch and makes configuration changes they are applied to running config. In order for them to be retained after switch reload, those changes must be committed to startup config by running "copy running-config startup-config" or simply "wr". If changes are not committed they will be lost upon reboot. 


Output of "show running-config" at the very beginning includes information regarding when last changes were made and when they were last committed.


In this example we can see that user "net-admin" made changes and committed them 1 second later:


!
! Last configuration change at 10:24:49 GMT Thu Mar 15 2012 by net-admin
! NVRAM config last updated at 10:24:50 GMT Thu Mar 15 2012 by net-admin
!


In this example we see that last configuration change was made in March but  last saved to startup config in February. This could cause unexpected issues upon switch reboot. 


!
! Last configuration change at 11:50:49 GMT Thu Mar 15 2012 by net-admin
! NVRAM config last updated at 10:24:50 GMT Thu Feb 15 2012 by net-admin
!


When I audit Cisco configuration I normally get both startup and running config. If I see discrepancy in timestamps I compare both configs. 


We can compare configs using CSDIFF. It is a free source code auditing tool which works great with config files. That way you can asses how important the changes were and what would the potential impact be had the switch been rebooted. 

CSDIF can be downloaded here:
http://www.componentsoftware.com/products/csdiff/download.htm


By looking at last changed and last saved times, we can asses change management practices used by our Network Admins. If changes are consistently not committed, it would suggest that there is an issue in change management procedures and they should be reviewed.   

Comments

Popular posts from this blog

x.509 Certificates - Critical vs non-critical extensions

Extensions are used to associate additional information with the user or the key.  Each certificate extension has three attributes - extnID, critical, extnValue extnID - Extension ID - an OID that specifies the format and definitions of the extension critical - Critical flag - Boolean value extnValue - Extension value  Criticality flag specifies whether the information in an extension is important. If an application doesn't recognize the extension marked as critical, the certificate cannot be accepted. If an extension is not marked as critical (critical value False) it can be ignored by an application. In Windows, critical extensions are marked with a yellow exclamation mark,  View certificate extensions using OpenSSL: # openssl x509 -inform pem -in cert.pem -text -noout (output abbreviated)         X509v3 extensions:             X509v3 Key Usage: critical                 Digital Signature, Key Encipherment             X509v3 Subject Key Identifier

DNS response and error types

In this post we explore common DNS response codes. We will cover the following responses: NOERROR SERVFAIL NXDOMAIN NODATA REFUSED Throughout article we’ll refer to the following RFCs: RFC 1034 - DOMAIN NAMES - CONCEPTS AND FACILITIES RFC 2308 - Negative Caching of DNS Queries (DNS NCACHE) RFC 2136 - Dynamic Updates in the Domain Name System (DNS UPDATE) RFC 8914 - Extended DNS Errors Response Codes - RCODEs The DNS RCODES are best defined in RFC2316 .  They signify what type of response was sent by the server. “RCODE   Response code - this four bit field is undefined in requests and set in responses.”   The table below shows the summary of the currently defined RCODEs. Mnemonic Val Description NOERROR 0 No error condition.

DNS blocking in Indonesia

DNS based censorship and domain blocking in Indonesia is very inconsistent among ISPs. There’s a government mandated black list which the ISPs operating in the country should enforce. However, Indonesia lacks centralised internet infrastructure and has many separate ISPs. In addition, the Indonesian government granted ISPs the authority to block content at their own discretion. All of this leads to a very inconsistent DNS blocking in Indonesia. Official DNS domain blacklist in Indonesia The Government mandated DNS blacklist is published in a redacted form and can be downloaded here: https://trustpositif.kominfo.go.id/ . This is where the blocked domains get redirected to. We can search the database and check if a domain is blocked. In the screenshot below we can see that a popular cryptocurrency exchange is blocked (Ada) and that wikipedia.org is not (Tidak Ada) - thanks to Google Translate. Examples of blocked DNS queries dig binance.com @182.253.45.122 ;; global options: +cmd ;; Got