/linux:network-config-validationfrom linux
Statically preflights router/switch IOS-style configs for dangerous commands, duplicate addresses, subnet overlaps, stale references, and management-plane exposure. Useful before deploying network changes.
Ships in linux. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Not applicable — this skill validates router/switch (IOS-style)
configuration text, not a Linux distribution's package or service state.
There is no Debian/Ubuntu-vs-RHEL-family split to state. The example Python
in this skill (standard library re, ipaddress, collections) runs
identically on either family if you choose to run it as a script on a Linux
control host; see
linux-bash-scripting
for that host's own conventions if you wrap this into a sk-*-style tool.
This skill is exempt from scripts/tests/check-distro-matrix.sh by naming
convention (it does not match the linux-* glob), deliberately, for the same
reason as its sibling skills in this category.
linux-server-hardening.cisco-ios-patterns directly.netmiko-ssh-automation, with this
skill as its pre-flight gate.| Artefact | Source | Required? | If absent |
|---|---|---|---|
| Candidate router or switch configuration | Change author or automation output | yes | Stop; there is nothing to preflight. |
| Target platform and intended change | Change request and operator | yes | Treat vendor-specific checks as NOT_ASSESSED. |
| Reference definitions and management constraints | Reviewed baseline or change record | when relevant | Report unresolved references and request the missing context. |
Treat config validation as layered evidence, not as a complete parser. Regex checks are useful for pre-flight warnings, but final approval still needs a network engineer to review intent, platform syntax, and rollback steps.
Validate in this order:
Destructive commands.
Credential and management-plane exposure.
Duplicate addresses and overlapping subnets.
Stale references to ACLs, route-maps, prefix-lists, and interfaces.
Operational hygiene such as NTP, timestamps, remote logging, and banners.
Separate hard findings from best-practice observations and record the exact line or section for each.
Return the candidate to a network engineer for syntax, intent, and rollback review before any push.
Stop when target syntax or change intent is unknown, or when a critical finding could affect management access. Recover by narrowing the assessment to checks supported by the supplied text and listing the gaps. Verify each finding against the candidate and its stated scope; a clean regex scan is not proof that the configuration is safe or valid.
import re
DANGEROUS_PATTERNS: list[tuple[re.Pattern[str], str]] = [
(re.compile(r"\breload\b", re.I), "reload causes downtime"),
(re.compile(r"\berase\s+(startup|nvram|flash)", re.I), "erases persistent storage"),
(re.compile(r"\bformat\b", re.I), "formats a device filesystem"),
(re.compile(r"\bno\s+router\s+(bgp|ospf|eigrp)\b", re.I), "removes a routing process"),
(re.compile(r"\bno\s+interface\s+\S+", re.I), "removes interface configuration"),
(re.compile(r"\baaa\s+new-model\b", re.I), "changes authentication behavior"),
(re.compile(r"\bcrypto\s+key\s+(zeroize|generate)\b", re.I), "changes device SSH keys"),
]
def find_dangerous_commands(lines: list[str]) -> list[dict[str, str | int]]:
findings = []
for line_number, line in enumerate(lines, start=1):
stripped = line.strip()
for pattern, reason in DANGEROUS_PATTERNS:
if pattern.search(stripped):
findings.append({
"line": line_number,
"command": stripped,
"reason": reason,
})
return findings
This is the router/switch analogue of this engine's own
hooks/destructive-bash-gate.js — a mechanical pattern gate that catches the
class of command a change should never run silently, applied to config text
instead of shell commands.
import ipaddress
import re
from collections import Counter
IP_ADDRESS_RE = re.compile(
r"^\s*ip address\s+"
r"(?P<ip>\d{1,3}(?:\.\d{1,3}){3})\s+"
r"(?P<mask>\d{1,3}(?:\.\d{1,3}){3})\b",
re.I | re.M,
)
def extract_interfaces(config: str) -> list[dict[str, str]]:
results = []
current = None
for line in config.splitlines():
if line.startswith("interface "):
current = line.split(maxsplit=1)[1]
continue
match = IP_ADDRESS_RE.match(line)
if current and match:
ip = match.group("ip")
mask = match.group("mask")
network = ipaddress.ip_interface(f"{ip}/{mask}").network
results.append({"interface": current, "ip": ip, "network": str(network)})
return results
def find_duplicate_ips(config: str) -> list[str]:
ips = [entry["ip"] for entry in extract_interfaces(config)]
counts = Counter(ips)
return sorted(ip for ip, count in counts.items() if count > 1)
def find_subnet_overlaps(config: str) -> list[tuple[str, str]]:
networks = [ipaddress.ip_network(entry["network"]) for entry in extract_interfaces(config)]
overlaps = []
for index, left in enumerate(networks):
for right in networks[index + 1:]:
if left.overlaps(right):
overlaps.append((str(left), str(right)))
return overlaps
Parse VTY blocks by section so access-class checks do not spill across unrelated lines.
import re
def iter_blocks(config: str, starts_with: str) -> list[str]:
blocks = []
current: list[str] = []
for line in config.splitlines():
if line.startswith(starts_with):
if current:
blocks.append("\n".join(current))
current = [line]
continue
if current:
if line and not line.startswith(" "):
blocks.append("\n".join(current))
current = []
else:
current.append(line)
if current:
blocks.append("\n".join(current))
return blocks
def check_vty_blocks(config: str) -> list[str]:
issues = []
for block in iter_blocks(config, "line vty"):
if re.search(r"transport\s+input\s+.*telnet", block, re.I):
issues.append("VTY allows Telnet; require SSH only.")
if not re.search(r"\baccess-class\s+\S+\s+in\b", block, re.I):
issues.append("VTY block has no inbound access-class source restriction.")
if not re.search(r"\bexec-timeout\s+\d+\s+\d+\b", block, re.I):
issues.append("VTY block has no explicit exec-timeout.")
return issues
SECURITY_PATTERNS = [
(re.compile(r"\bsnmp-server community\s+(public|private)\b", re.I),
"default SNMP community configured"),
(re.compile(r"\bsnmp-server community\s+\S+", re.I),
"SNMPv2 community string configured; prefer SNMPv3 authPriv"),
(re.compile(r"\bip ssh version 1\b", re.I),
"SSH version 1 enabled"),
(re.compile(r"\benable password\b", re.I),
"enable password is present; use enable secret"),
(re.compile(r"\busername\s+\S+\s+password\b", re.I),
"local username uses password instead of secret"),
]
BEST_PRACTICE_PATTERNS = [
(re.compile(r"\bntp server\b", re.I), "NTP server"),
(re.compile(r"\bservice timestamps\b", re.I), "log timestamps"),
(re.compile(r"\blogging\s+\S+", re.I), "logging destination or buffer"),
(re.compile(r"\bsnmp-server group\s+\S+\s+v3\s+priv\b", re.I), "SNMPv3 authPriv group"),
(re.compile(r"\bbanner\s+(login|motd)\b", re.I), "login banner"),
]
def check_security(config: str) -> list[str]:
return [message for pattern, message in SECURITY_PATTERNS if pattern.search(config)]
def check_missing_hygiene(config: str) -> list[str]:
return [
f"Missing {description}"
for pattern, description in BEST_PRACTICE_PATTERNS
if not pattern.search(config)
]
| Artefact | Consumer | Acceptance condition |
|---|---|---|
| Preflight findings with line or section references | Network engineer | Dangerous patterns, overlaps, references, and management exposure are separated. |
| Scope and limitation note | Change owner | Platform assumptions and non-parser limitations are explicit. |
| Category | Artefact | Acceptance condition |
|---|---|---|
| Correctness | Candidate and check results | Each finding points to the supplied configuration and check performed. |
| Release readiness | Reviewer and unresolved-gap record | A clean scan is not represented as device validation or approval. |
This skill is read-only. It may inspect supplied configuration or run an authorised local preflight script; it must not connect to, change, or save device configuration. Deployment requires a separate approved workflow.
Without complete configuration, platform context, or reference definitions,
report only supported static findings and mark omitted checks NOT_ASSESSED.
Do not infer that a missing line or reference is safe.
| Condition | Action | Wrong-choice failure |
|---|---|---|
| Candidate and target scope are available | Run layered static checks and cite findings | Missing scope can make a pattern check misleading. |
| A dangerous command or management exposure is found | Block the preflight and escalate for review | A risky change may be pushed without control. |
| No pattern matches are found | Report only that configured checks found none | Regex checks cannot certify full syntax or behavior. |
Candidate snippet:
line vty 0 4
transport input telnet
Preflight result: flag Telnet as a management-plane risk and note that this
block has no visible inbound access-class or explicit exec-timeout. Do not
rewrite or push the candidate. Ask the network engineer to confirm the
intended remote-access policy and review the complete VTY configuration.
This finding is limited to the supplied snippet; the rest of the device state
is NOT_ASSESSED.
Security basis (checked 2026-09-27): Cisco's IOS XE Software Hardening
Guide
recommends SSH instead of clear-text protocols such as Telnet and describes
vty/tty access controls, including access-class and exec-timeout. The dated
portfolio record is chwezi-dev-engine/docs/source-registers/skills-engine-currentness-2026-09.json
(resolve the canonical engine checkout through the cross-engine router), source
cisco-ios-xe-hardening-2026-09-25, claim
claim-cisco-ios-xe-ssh-vty-hardening-2026-09-25. Recheck vendor guidance and target-
platform support before applying it to a live device.
Use validation as a blocking gate before Netmiko, NAPALM, Ansible, or vendor API automation pushes a generated config. Fail closed on dangerous commands and credentials. Warn on best-practice gaps that are outside the change scope.
cisco-ios-patterns — the config
vocabulary and change-window discipline this skill validates against.netmiko-ssh-automation — the
automation path this skill gates before a guarded push.linux-troubleshooting —
read-only OSI-layer diagnosis when a config passes validation but the
symptom persists.cisco-ios-patterns — device syntax and change-window review.netmiko-ssh-automation — guarded device access.linux-troubleshooting — host/network symptom diagnosis boundary.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
network-config, cisco-ios, preflight-validation, config-audit
45 skills in this plugin
/cisco-ios-patternsUse when reading or reviewing Cisco IOS/IOS-XE configuration, selecting read-only show commands, or planning and verifying bounded router or switch configuration work. Not for Linux host networking, bulk SSH automation, or config preflight parsing; route those to linux-network-admin, netmiko-ssh-automation, or network-config-validation./linux-access-controlUse when creating, revoking, or auditing Linux users, groups, SSH keys, sudo/wheel access, PAM settings, SELinux user mappings, or file permissions. Use linux-secrets for credential material and linux-server-hardening for broader host policy./linux-archive-integrityUse when creating, signing, encrypting, listing, comparing, or restoring metadata-preserving tar archives on Debian/Ubuntu or RHEL-family hosts. Covers ACLs, xattrs, incrementals, and verification; use linux-rsync-sync for file-tree mirrors./linux-auditd-rulesUse when inspecting, designing, testing, persisting, or querying auditd rules for forensic attribution on Debian/Ubuntu or RHEL-family hosts. Covers watches, syscalls, loss, and immutable mode; use linux-file-integrity for drift and linux-benchmark-scanning for scoring./linux-bash-scriptingUse when writing or reviewing portable sk-* Bash scripts for this engine, including common.sh primitives, flags, preview mode, and safety gates; use linux-repo-sync for Git-update behaviour and not for one-off commands./linux-benchmark-scanningUse when running read-only OpenSCAP or Lynis scans, selecting distro-matched profiles, interpreting failures, or drafting remediation on Debian/Ubuntu or RHEL-family hosts. Use linux-auditd-rules for attribution and linux-file-integrity for AIDE drift.npx claudepluginhub peterbamuhigire/linux-skills --plugin linuxOther plugins' skills for the same job