Communitygithub.com

네트워크 설정 검증

라우터 및 스위치 설정을 배포 전에 검토하여 위험한 명령어, 중복 주소, 서브넷 중복, 유령 참조, 관리 평면 위험 및 IOS 스타일 보안 위생 상태를 점검합니다.

네트워크 설정 검증란 무엇인가요?

이 스킬은 네트워크 설정을 배포 전에 검증하여 다운타임 및 보안 위험을 사전에 방지합니다. Cisco IOS 및 IOS-XE 스타일의 설정 스니펫을 대상으로 하며, 정규 표현식 기반의 경고를 제공합니다. 중복 IP 주소, 서브넷 중복, 위험한 명령어(reload, erase, format 등), VTY 접근 제어, SNMP 및 SSH 보안 설정, ACL/route-map/prefix-list의 유령 참조 등을 체계적으로 점검합니다. Python 코드 예제와 함께 제공되어 네트워크 자동화 파이프라인(Netmiko, NAPALM, Ansible 등)에 통합하기 쉽습니다. 최종 승인은 네트워크 엔지니어가 의도와 플랫폼 구문, 롤백 절차를 검토해야 합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/network-config-validation

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

네트워크 설정 검증은(는) 무엇을 하나요?

변경 윈도우 전 또는 자동화 실행이 프로덕션 장비에 닿기 전에 네트워크 설정을 검토할 때 이 스킬을 사용하세요.

사용 시기

  • Cisco IOS 또는 IOS-XE 스타일 스니펫을 배포 전에 검토할 때
  • 스크립트나 템플릿에서 생성된 설정을 감사할 때
  • 위험한 명령어, 중복 IP 주소, 서브넷 중복을 찾을 때
  • ACL, route-map, prefix-list, line 정책이 참조되었으나 정의되지 않은 경우를 확인할 때
  • 네트워크 자동화를 위한 경량 사전 점검 스크립트를 구축할 때

작동 방식

설정 검증을 완전한 파서가 아닌 계층적 증거로 취급하세요. 정규 표현식 검사는 사전 점검 경고에 유용하지만, 최종 승인은 여전히 네트워크 엔지니어가 의도, 플랫폼 구문, 롤백 단계를 검토해야 합니다.

다음 순서로 검증하세요:

  1. 파괴적 명령어
  2. 자격 증명 및 관리 평면 노출
  3. 중복 주소 및 서브넷 중복
  4. ACL, route-map, prefix-list 및 인터페이스에 대한 유령 참조
  5. NTP, 타임스탬프, 원격 로깅, 배너 등의 운영 위생

위험한 명령어 감지

import re

DANGEROUS_PATTERNS: list[tuple[re.Pattern[str], str]] = [
    (re.compile(r"\breload\b", re.I), "재시작으로 인한 다운타임 발생"),
    (re.compile(r"\berase\s+(startup|nvram|flash)", re.I), "영구 저장소 삭제"),
    (re.compile(r"\bformat\b", re.I), "장치 파일 시스템 포맷"),
    (re.compile(r"\bno\s+router\s+(bgp|ospf|eigrp)\b", re.I), "라우팅 프로세스 제거"),
    (re.compile(r"\bno\s+interface\s+\S+", re.I), "인터페이스 설정 제거"),
    (re.compile(r"\baaa\s+new-model\b", re.I), "인증 동작 변경"),
    (re.compile(r"\bcrypto\s+key\s+(zeroize|generate)\b", re.I), "장치 SSH 키 변경"),
]

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

중복 IP 및 서브넷 중복

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

관리 평면 검사

액세스 클래스 검사가 관련 없는 줄로 확장되지 않도록 VTY 블록을 섹션별로 파싱합니다.

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가 Telnet을 허용합니다. SSH만 필요합니다.")
        if not re.search(r"\baccess-class\s+\S+\s+in\b", block, re.I):
            issues.append("VTY 블록에 인바운드 access-class 소스 제한이 없습니다.")
        if not re.search(r"\bexec-timeout\s+\d+\s+\d+\b", block, re.I):
            issues.append("VTY 블록에 명시적인 exec-timeout이 없습니다.")
    return issues

보안 위생 검사

SECURITY_PATTERNS = [
    (re.compile(r"\bsnmp-server community\s+(public|private)\b", re.I),
     "기본 SNMP 커뮤니티가 설정됨"),
    (re.compile(r"\bsnmp-server community\s+\S+", re.I),
     "SNMPv2 커뮤니티 문자열이 설정됨. SNMPv3 authPriv를 권장"),
    (re.compile(r"\bip ssh version 1\b", re.I),
     "SSH 버전 1이 활성화됨"),
    (re.compile(r"\benable password\b", re.I),
     "enable password가 존재합니다. enable secret을 사용하세요"),
    (re.compile(r"\busername\s+\S+\s+password\b", re.I),
     "로컬 사용자가 password 대신 secret을 사용하지 않음"),
]

BEST_PRACTICE_PATTERNS = [
    (re.compile(r"\bntp server\b", re.I), "NTP 서버"),
    (re.compile(r"\bservice timestamps\b", re.I), "로그 타임스탬프"),
    (re.compile(r"\blogging\s+\S+", re.I), "로깅 대상 또는 버퍼"),
    (re.compile(r"\bsnmp-server group\s+\S+\s+v3\s+priv\b", re.I), "SNMPv3 authPriv 그룹"),
    (re.compile(r"\bbanner\s+(login|motd)\b", re.I), "로그인 배너"),
]

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"누락: {description}"
        for pattern, description in BEST_PRACTICE_PATTERNS
        if not pattern.search(config)
    ]

예제

변경 윈도우 사전 점검

  1. 붙여넣을 정확한 스니펫에 대해 위험 명령어 검사를 실행합니다.
  2. 전체 후보 설정에 대해 중복 IP 및 서브넷 중복 검사를 실행합니다.
  3. 참조된 모든 ACL, route-map, prefix-list가 존재하는지 확인합니다.
  4. 관리 평면 변경 전에 롤백 명령어와 아웃오브밴드 접근을 확인합니다.

자동화 사전 점검

Netmiko, NAPALM, Ansible 또는 벤더 API 자동화가 생성된 설정을 푸시하기 전에 검증을 차단 게이트로 사용하세요. 위험한 명령어와 자격 증명에 대해서는 폐쇄 실패(fail closed) 처리하고, 변경 범위를 벗어난 모범 사례 격차에 대해 경고합니다.

안티 패턴

  • 정규 표현식 검증을 장치 파서로 취급하는 행위
  • 드라이런 diff 없이 생성된 설정을 적용하는 행위
  • SNMPv2 커뮤니티 문자열을 모니터링 요구 사항으로 권장하는 행위
  • VTY 블록을 검사할 때 정규식이 의도치 않게 관련 없는 섹션에 걸쳐 확장되는 경우
  • 카운터나 로그를 읽지 않고 ACL을 비활성화하여 방화벽 동작을 테스트하는 행위

함께 보기

  • 에이전트: network-config-reviewer
  • 에이전트: network-troubleshooter
  • 스킬: network-interface-health

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

관련 스킬