微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🔧

网络配置合规守护专家

Config Management · v1.0.0
入口已确认,内容待校验 文件树里有 SKILL.md,但正文还没采回,frontmatter 未核对。
专业技能 安全 A 级 作者 vahagn-madatyan 公开目录收录
717 下载 0 安装 3.3k 收藏 24 浏览

简介

面向Cisco/Juniper/Arista多厂商网络设备的配置基线管理技能,实现运行态与启动态差异检测、黄金配置比对及合规性验证,保障网络变更可追溯与安全性。

原始描述

Configuration backup, drift detection, and golden config validation across Cisco IOS-XE/NX-OS, Juniper JunOS, and Arista EOS. Covers running vs startup compa...

通过你的 Agent 添加

安装目录:config-management/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/config-management/
Codex CLI~/.codex/skills/config-management/
DeepSeek Harness~/.agents/skills/config-management/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

Configuration Management 是一款面向企业网络运维场景的专用技能,支持 Cisco IOS-XE/NX-OS、Juniper JunOS 和 Arista EOS 三大主流网络操作系统。其核心工作流程遵循"采集-比对-归档-检测-修复"的五阶闭环:

  1. 配置采集:通过 SSH 会话捕获设备的运行配置(running-config)与启动配置(startup-config),JunOS 平台需特别注意候选配置(candidate config)与已提交配置(committed config)的区分
  2. 运行态差异检测:自动比对运行配置与启动配置,识别未保存的变更,按变更时长(<1小时至>24小时)进行风险分级
  3. 配置归档:将当前配置按 {hostname}-{YYYYMMDD}-{HHMM}.cfg 格式备份至 TFTP/SCP/FTP 服务器或本地闪存,建议保留至少 3 个历史版本
  4. 黄金基线比对:按路由、交换、安全、管理、服务五大逻辑分区,逐段比对当前配置与角色化黄金配置(golden config)的差异
  5. 合规验证与修复:检查 AAA、NTP、syslog、SNMP 等强制安全要素的存在性,以及 telnet、默认凭证、SNMPv1 等禁忌配置的缺失性,并按 Critical/High/Warning/Info 四级 severity 执行差异化修复

显著优点

  • 多厂商统一抽象:通过 [Cisco]/[JunOS]/[EOS] 标签标注实现跨平台语法适配,降低多品牌异构网络的运维认知负担
  • 分级风险管控:建立完善的阈值表(Threshold Tables)体系,将配置漂移按业务影响面(路由/安全为 Critical,管理平面为 Warning,描述性变更为 Info)精准分级,避免告警风暴
  • 闭环治理能力:不仅检测问题,更提供从归档回滚(configure replace/rollback)到增量修复的完整决策树,支持 "检测-授权确认-修复-验证" 的标准化 SOP
  • 运营 hygiene 嵌入:支持按日/周周期执行的漂移检测任务,将配置合规检查融入日常运维节奏

潜在缺点与局限性

  • 网络可达性依赖:所有操作基于 SSH/console 访问,对于网络隔离区(DMZ)或故障态设备无法执行远程检测
  • 黄金配置维护成本:角色化黄金配置(access-switch/core-router/WAN-edge)需要持续人工维护以反映架构演进,配置基线老化会导致误报
  • 语义级漂移盲区:技能基于文本行级 diff 进行比对,对于配置逻辑等价但语法 reorder(如 ACL 条目顺序调换语义不变)会产生假阳性
  • JunOS 候选配置复杂性:JunOS 的 candidate-commit 模型使得未提交变更在 show configuration 中不可见,需额外执行 show | compare 检测,增加操作步骤
  • 大规模配置性能瓶颈:超过 10,000 行的配置文件会导致 diff 分析困难,需人工分段处理

适合的目标群体

  • 网络运维工程师(NetOps):负责日常配置变更、备份与合规检查的一线运维人员
  • 网络安全工程师:关注 AAA、管理平面安全、ACL 合规性的安全团队
  • 变更管理员:需要验证变更前后配置一致性、执行回滚决策的变更流程负责人
  • 合规审计人员:执行 PCI-DSS、SOX、等保等标准中网络配置审计条款的内审/外审团队

使用风险

  • 误操作风险(WRITE 标记步骤):Step 3(配置归档)和 Step 7(修复回滚)包含设备写操作,错误的 configure replace 或 rollback 执行可能导致服务中断,必须确认维护窗口与变更授权
  • 配置覆盖风险:归档过程中的传输失败(网络闪断、存储空间不足)可能导致备份不完整,需验证文件大小与哈希
  • 假阴性合规风险:依赖正则表达式匹配的配置验证可能遗漏变体语法(如 no ip http server vs ip http server 的缺省值差异),建议结合人工抽检
  • 依赖项风险:技能声明依赖 git-netops-mcp MCP 服务,若该服务不可用则基线版本管理与历史追溯功能受限
  • 权限提升风险:修复操作需 enable/configure 特权级别,凭证管理不当可能导致越权操作记录缺失

技能正文


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

  • Scheduled configuration compliance audit against golden baselines
  • Investigating suspected unauthorized configuration changes
  • Post-maintenance verification that running config was saved to startup
  • Validating configuration consistency across device groups or stacks
  • Checking that security-mandated patterns (AAA, NTP, logging) are present
  • Ensuring forbidden patterns (default credentials, telnet, SNMPv1) are absent
  • Building or refreshing a configuration archive before a change window
  • Periodic drift detection as part of operational hygiene (daily/weekly)

Prerequisites

  • SSH or console access to the device (read-only sufficient for assessment; enable/configure privilege required for remediation or archival steps)
  • A golden config baseline or previous archived config for comparison
  • Knowledge of organizational compliance requirements: required services (AAA, NTP, syslog), forbidden protocols (telnet, HTTP management, SNMPv1/v2c without ACL), and mandatory security features (ACLs, CoPP)
  • For archival: reachable SCP/TFTP/FTP server or local flash storage
  • Awareness of any active maintenance window that may explain expected drift

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):

  • AAA authentication configured and active
  • NTP synchronization to authorized time sources
  • Syslog forwarding to centralized logging servers
  • SNMP with ACL restrictions (no unrestricted community strings)
  • Management access restricted to SSH only (no telnet, no HTTP)

Forbidden patterns (must be absent):

  • Default credentials (e.g., username admin password admin)
  • Telnet or HTTP enabled for management (transport input telnet, no ip http secure-server)
  • SNMPv1/v2c without source ACL restriction
  • Unrestricted VTY access (no ACL applied to VTY lines)
  • DHCP snooping or ARP inspection disabled on access ports

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.

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

devopsnetworkingautomationsecuritycompliancebackendinfrastructure

同类 Skill