Config Management
by @vahagn-madatyan
Configuration backup, drift detection, and golden config validation across Cisco IOS-XE/NX-OS, Juniper JunOS, and Arista EOS. Covers running vs startup compa...
clawhub install config-managementπ About This Skill
name: config-management description: >- Configuration backup, drift detection, and golden config validation across Cisco IOS-XE/NX-OS, Juniper JunOS, and Arista EOS. Covers running vs startup comparison, config archival, section-level drift analysis, and compliance validation for ongoing configuration assurance. license: Apache-2.0 metadata: safety: read-write author: network-security-skills-suite version: "1.0.0" openclaw: '{"emoji":"π§","safetyTier":"read-write","requires":{"bins":["ssh"],"env":[]},"tags":["config","backup","drift"],"mcpDependencies":["git-netops-mcp"],"egressEndpoints":[]}'
Configuration Management
Ongoing configuration assurance skill covering backup, drift detection, and golden config validation. This skill identifies unauthorized or unintended changes by comparing device configurations against known-good baselines and organizational compliance rules.
Commands are labeled [Cisco], [JunOS], or [EOS] where syntax diverges. Unlabeled statements apply to all three vendors.
> Safety Note β Read-Write Operations: This skill includes procedures that > may modify device state (config archival to remote storage, rollback, config > replace). Steps that write to devices are marked with β οΈ WRITE. Always > confirm authorization and maintenance window status before executing write > operations. Read-only assessment steps can be run at any time without risk.
When to Use
Prerequisites
Procedure
Follow these steps sequentially. Steps 1β2 are always safe (read-only). Steps 3β7 include optional write operations marked with β οΈ.
Step 1: Config Collection
Capture the current running and startup/saved configurations.
[Cisco]
show running-config
show startup-config
[JunOS]
show configuration | display set
show configuration | compare rollback 0
[EOS]
show running-config
show startup-config
On JunOS, the candidate configuration model means the active config is the
committed config. Use show configuration to view committed state. See
references/cli-reference.md for architectural differences.
Step 2: Running vs Startup Comparison
Detect unsaved changes β running config that would be lost on reload.
[Cisco]
show archive config differences system:running-config nvram:startup-config
[JunOS]
show | compare rollback 0
[EOS]
show running-config diffs
Any differences indicate unsaved changes. Record the diff output and timestamp. Classify the age of unsaved changes β see Threshold Tables for severity. If changes are intentional (active maintenance), note the maintenance ticket.
Step 3: Config Archival
β οΈ WRITE β Back up the current configuration with timestamped naming.
[Cisco]
copy running-config tftp://[server]/[hostname]-YYYYMMDD-HHMM.cfg
[JunOS]
request system configuration save /var/tmp/[hostname]-YYYYMMDD-HHMM.conf
[EOS]
copy running-config flash:[hostname]-YYYYMMDD-HHMM.cfg
Use consistent naming: {hostname}-{YYYYMMDD}-{HHMM}.cfg. Verify the backup
was written successfully by checking file size and comparing a hash of the
backup against the running config. Maintain a minimum of 3 archived configs per
device for rollback options.
Step 4: Golden Config Baseline
Retrieve the golden (intended-state) configuration for this device role. Golden configs are maintained per device role (e.g., access-switch, core-router, WAN-edge) and contain all mandatory configuration sections.
If no golden config exists yet, establish one: 1. Start from a known-compliant device config 2. Remove device-specific values (hostnames, IPs, interface descriptions) 3. Keep all compliance-mandated sections (AAA, NTP, logging, SNMP, ACLs) 4. Document the golden config version and approval date
For comparison, normalize both configs before diffing β see
references/drift-detection.md for normalization rules.
Step 5: Drift Detection
Compare current config against the golden baseline section by section.
Partition the configuration into logical sections for structured comparison:
| Section | Cisco Examples | JunOS Examples | EOS Examples |
|---------|---------------|----------------|--------------|
| Routing | router bgp, router ospf | protocols | router bgp, router ospf |
| Switching | spanning-tree, vlan | vlans, protocols rstp | spanning-tree, vlan |
| Security | access-list, line vty | firewall, system login | ip access-list, management |
| Management | logging, ntp, snmp | system syslog, system ntp | logging, ntp, snmp-server |
| Services | ip dhcp, ip nat | forwarding-options | ip dhcp, ip nat |
For each section, identify additions, deletions, and modifications compared to the baseline. Classify each difference by severity β see Threshold Tables.
Step 6: Compliance Validation
Check for required and forbidden configuration patterns.
Required patterns (must be present):
Forbidden patterns (must be absent):
username admin password admin)transport input telnet, no ip http secure-server)Reference references/drift-detection.md for full compliance rule definitions
with vendor-specific pattern matching.
Step 7: Remediation Guidance
β οΈ WRITE β Address drift findings based on severity classification.
For Critical drift (routing, security sections):
1. Verify if the change was authorized (check change tickets)
2. If unauthorized, prepare a rollback to the last known-good config
3. [Cisco] configure replace flash:[backup].cfg force
4. [JunOS] rollback [n] then commit
5. [EOS] configure replace flash:[backup].cfg
For Warning drift (management plane, logging): 1. Document the deviation in the drift report 2. Schedule remediation during the next maintenance window 3. Apply missing configuration elements incrementally
For Info drift (cosmetic β descriptions, banners, comments): 1. Log the deviation for tracking 2. Remediate opportunistically during scheduled maintenance
After any remediation, re-run Steps 1β2 to confirm the config matches the intended state and save the corrected running config to startup.
Threshold Tables
Drift Severity by Config Section
| Config Section | Severity | Rationale | |---------------|----------|-----------| | Routing (BGP, OSPF, static) | Critical | Direct traffic impact, potential outage | | Security (ACLs, AAA, CoPP) | Critical | Exposure to unauthorized access | | Switching (STP, VLANs) | High | Loop risk, VLAN leakage | | Management (logging, NTP, SNMP) | Warning | Operational visibility loss | | Services (DHCP, NAT) | Warning | Service-level impact, no network-wide risk | | Cosmetic (descriptions, banners) | Info | No operational impact |
Unsaved Change Age
| Age | Severity | Action | |-----|----------|--------| | < 1 hour | Info | Likely active maintenance β verify with operator | | 1β4 hours | Warning | Check if maintenance window is active | | 4β24 hours | High | Likely forgotten save β prompt operator to save or revert | | > 24 hours | Critical | Unsaved changes at high risk of loss β immediate save or revert |
Config Archive Freshness
| Last Archive | Status | Action | |-------------|--------|--------| | < 7 days | Current | No action needed | | 7β30 days | Stale | Schedule archive refresh | | 30β90 days | Warning | Archive before any changes | | > 90 days | Critical | Immediate archive required |
Decision Trees
Drift Detected
Drift found between running config and golden baseline
βββ Classify section
β βββ Routing / Security β Critical
β βββ Switching β High
β βββ Management / Services β Warning
β βββ Cosmetic β Info
β
βββ Check authorization
β βββ Change ticket exists for this device/window?
β β βββ Yes β Authorized drift
β β β βββ Update golden baseline if change is permanent
β β β βββ Document as accepted deviation if temporary
β β βββ No β Unauthorized drift
β β βββ Critical/High β Escalate and prepare rollback
β β βββ Warning/Info β Document and schedule remediation
β βββ Cannot determine β Treat as unauthorized, notify operator
β
βββ Remediation path
βββ Rollback available? (archived config within freshness threshold)
β βββ Yes β Apply config replace (Step 7)
β βββ No β Manual remediation required
βββ Post-remediation β Re-run Steps 1β6 to confirm compliance
Running β Startup
Running config differs from startup config
βββ Maintenance window active?
β βββ Yes β Expected β changes in progress
β β βββ Remind operator to save when maintenance completes
β βββ No β Unexpected unsaved changes
β βββ Age < 1 hour β Possible recent change, check with operator
β βββ Age 1β24 hours β Likely forgotten save
β β βββ Prompt: save to startup or revert to startup config
β βββ Age > 24 hours β Critical risk
β βββ Immediate action: save or revert, then archive
β
βββ Cannot determine age
βββ Check last config change timestamp
βββ [Cisco] show running-config | include Last config
βββ [JunOS] show system commit
βββ [EOS] show running-config | include Last modified
Compliance Violation
Required pattern missing or forbidden pattern present
βββ Classify violation severity
β βββ Security (AAA missing, default creds, telnet) β Critical
β βββ Logging (syslog missing, NTP missing) β Warning
β βββ Best practice (banner missing) β Info
β
βββ Auto-remediation candidate?
β βββ Additive fix (add NTP server, add logging host) β Yes
β β βββ Generate remediation config snippet
β β βββ Apply during maintenance window (Step 7)
β βββ Removal required (remove telnet, remove default creds) β Yes with caution
β β βββ Verify no dependencies before removing
β βββ Structural change (enable AAA, reconfigure SNMP) β No β manual review
β βββ Create change request for manual implementation
β
βββ Document in compliance report with violation details
Report Template
CONFIGURATION MANAGEMENT REPORT
=================================
Device: [hostname]
Vendor: [Cisco | JunOS | EOS]
Device Role: [access-switch | core-router | WAN-edge | ...]
Check Time: [timestamp]
Performed By: [operator/agent]
Golden Config Version: [version/date]SAVED STATE:
Running vs Startup: [Match | Differs]
Unsaved change age: [duration or N/A]
Last archive date: [date]
Archive freshness: [Current | Stale | Warning | Critical] DRIFT SUMMARY:
Sections checked: [n]
Deviations found: [n]
- Critical: [n] | High: [n] | Warning: [n] | Info: [n]DRIFT FINDINGS:
1. [Severity] [Section] β [Description]
Golden: [expected config line/block]
Current: [actual config line/block]
Authorization: [ticket# | Unauthorized | Unknown]
Action: [Rollback | Schedule fix | Accept | Update baseline]
COMPLIANCE STATUS:
Required patterns: [n/total] present
Forbidden patterns: [n] found
Violations:
1. [Severity] [Rule] β [detail]REMEDIATION ACTIONS:
[Prioritized action list with target maintenance window] NEXT CHECK: [CRITICAL: 4hr | HIGH: 8hr | WARNING: 24hr | HEALTHY: 7d]
Troubleshooting
Config Diff Shows False Positives
Diffs include generated lines (timestamps, certificate hashes, build
information) that change between captures but are not real drift. Normalize
configs before comparison by stripping timestamps, build strings, and
auto-generated comments. See references/drift-detection.md for normalization
patterns per vendor.
JunOS Candidate Config Confusion
JunOS uses a candidate-commit model. show configuration displays committed
(active) config. Uncommitted candidate changes appear only with show |
compare. If drift analysis shows differences between a JunOS device and its
golden config, verify that no uncommitted candidate changes are pending β
uncommitted changes do not affect the running device but will take effect on
next commit.
Archive Transfer Failures
Config export to remote servers may fail due to: ACL on the device blocking
outbound SCP/TFTP, DNS resolution failure for server hostname, authentication
failure on SCP, or insufficient flash space for local copy. Test connectivity
with ping first, verify SCP credentials, and check available flash space with
dir flash: (Cisco/EOS) or file list /var/tmp/ (JunOS).
Large Config Diff Overwhelms Analysis
Configs exceeding 10,000 lines produce diffs that are difficult to analyze holistically. Break the comparison into the section categories from Step 5 and analyze one section at a time. Prioritize sections by severity tier from the Threshold Tables. For structured configs (JunOS set-format, EOS section mode), sort lines before diffing to reduce positional noise.
Compliance Rule Vendor Variations
The same security requirement maps to different config syntax per vendor. For
example, disabling telnet: Cisco uses transport input ssh on VTY lines, JunOS
uses delete system services telnet, and EOS uses no management telnet.
Reference references/drift-detection.md for vendor-specific compliance
patterns to avoid false positives or missed violations.
β‘ When to Use
βοΈ Configuration
π Tips & Best Practices
Config Diff Shows False Positives
Diffs include generated lines (timestamps, certificate hashes, build
information) that change between captures but are not real drift. Normalize
configs before comparison by stripping timestamps, build strings, and
auto-generated comments. See references/drift-detection.md for normalization
patterns per vendor.
JunOS Candidate Config Confusion
JunOS uses a candidate-commit model. show configuration displays committed
(active) config. Uncommitted candidate changes appear only with show |
compare. If drift analysis shows differences between a JunOS device and its
golden config, verify that no uncommitted candidate changes are pending β
uncommitted changes do not affect the running device but will take effect on
next commit.
Archive Transfer Failures
Config export to remote servers may fail due to: ACL on the device blocking
outbound SCP/TFTP, DNS resolution failure for server hostname, authentication
failure on SCP, or insufficient flash space for local copy. Test connectivity
with ping first, verify SCP credentials, and check available flash space with
dir flash: (Cisco/EOS) or file list /var/tmp/ (JunOS).
Large Config Diff Overwhelms Analysis
Configs exceeding 10,000 lines produce diffs that are difficult to analyze holistically. Break the comparison into the section categories from Step 5 and analyze one section at a time. Prioritize sections by severity tier from the Threshold Tables. For structured configs (JunOS set-format, EOS section mode), sort lines before diffing to reduce positional noise.
Compliance Rule Vendor Variations
The same security requirement maps to different config syntax per vendor. For
example, disabling telnet: Cisco uses transport input ssh on VTY lines, JunOS
uses delete system services telnet, and EOS uses no management telnet.
Reference references/drift-detection.md for vendor-specific compliance
patterns to avoid false positives or missed violations.