convez.ai
SkillDevOps & InfraestruturaIntermediário
aharwelik

NetGuard Config - Validador de Configs de Rede

aharwelik/netguard-config

Valida configs Cisco geradas por IA e gera rollback automático

Ver no GitHub
InicialPluginScore · de 0 a 100

Skill para validação offline de configurações de dispositivos de rede (Cisco IOS) geradas por IA, detectando erros de máscara de sub-rede, IPs duplicados, rotas inválidas e linhas perigosas. Gera automaticamente rollbacks seguros sem necessidade de acesso ao dispositivo, com suporte a receipts de proof-carrying-ops.

Instalação

$npx convez-ai aharwelik/netguard-config

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 5 meses
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Validação segura de configurações de rede geradas por LLM antes de aplicar em produção
  • Detecção de erros de endereçamento IP, rotas malformadas e configurações perigosas
  • Geração automática de comandos de rollback para reverter mudanças problemáticas

Veredito

Ferramenta especializada e bem-construída para um problema real: validação de configs de rede geradas por IA antes de tocar em dispositivos. Sem dependências externas, oferece verificações específicas e gera rollbacks seguros com ordem correta de aplicação. Essencial para times de NetDevOps que usam LLMs.

README

A tradução para o português deste README ainda está na fila.

netguard-config banner

netguard-config

Validate AI-generated network device configs before they touch a device. Catches wrong subnet masks, duplicate addresses, bad routes, and dangerous lines, then generates the rollback -- offline, no device required.

ci license: MIT python dependencies: none

Keywords: network automation, Cisco IOS, config validation, AI generated config, LLM network configuration, subnet mask, network engineer, NetDevOps, config linter, rollback, ACL, Claude Code skill, pre-change validation.


The problem

Cisco DevNet's guidance for engineers using LLMs is blunt: models produce configurations that are syntactically and semantically plausible but disconnected from reality, with wrong subnet masks or non-existent CLI commands, and you must analyze the output before applying it to a device. The safe pattern everyone converges on is context, plus validation, plus a human approval gate, with a saved rollback.

netguard-config is the validation-and-rollback half you can run with no device and no network access. Point it at a proposed config; it tells you what is wrong and how to back it out.

What it checks

  • IP addressing math: invalid subnet masks, an address that is actually the network or broadcast address of its subnet, and duplicate addresses across interfaces.
  • Static routes: malformed destinations, masks, or next-hops.
  • Dangerous lines: any-to-any permits, default SNMP communities, read-write SNMP, cleartext or weak or default passwords, telnet on the vty lines, insecure HTTP management.
  • Unrecognized commands: an advisory hint that a top-level command may be hallucinated (verify against the target platform).

What it produces

  • findings with severity (errors and high-severity dangers gate),
  • a generated rollback (the no forms that back the change out, with a safe apply order),
  • a proof-carrying-ops receipt: a config with an error produces a receipt pco verify quarantines.

Install

No dependencies. Python 3.10+.

git clone https://github.com/aharwelik/netguard-config
cd netguard-config

Use it

python -m netguard check examples/config.bad.txt --rollback

Sample (abridged):

netguard-config: BAD-RTR
  lines=19  interfaces=4  findings=11  gating=8

[HIGH] danger (line 3, BAD-RTR:global)
    enable password cisco
    cleartext enable password (use enable secret)
[ERROR] ip-address (line 8, BAD-RTR:interface:GigabitEthernet0/0)
    ip address 10.0.0.0 255.255.255.0
    10.0.0.0 is the network address of 10.0.0.0/24, cannot assign to an interface
[ERROR] duplicate-ip (...)
    10.0.0.1 already assigned on GigabitEthernet0/2

Exit code is 1 when any gating finding (error or high) is present, 0 when clean. Verify a config as a change receipt:

python -m netguard check proposed.txt --receipt | python -m pco verify -

Use it as a Claude Code skill

mkdir -p ~/.claude/skills/netguard-config
cp skill/SKILL.md ~/.claude/skills/netguard-config/SKILL.md

Then ask Claude to "validate this router config before I apply it."

Theory

This implements two invariants from the proof-carrying-ops model. Identity Normalization: every line is attributed to a canonical identity (device:interface:NAME or device:global), which is what makes duplicate-IP detection and blast-radius attribution exact. Reversibility: the tool generates a rollback for the proposed change and certifies, in the receipt, that a config with an addressing error or a gating danger is not safe to apply.

Honesty boundary

A heuristic linter with a curated command and danger set; not a full IOS parser or device simulator. It reduces the risk of applying a bad AI-generated config; it does not replace lab validation (pyATS) or human approval. The example configs use documentation-range addresses and placeholder secrets.

Design

Standard library only (ipaddress, re), tested on Python 3.10 through 3.13, no-emoji guard in CI.

Author

Anthony Harwelik -- aharwelik@gmail.com -- https://github.com/aharwelik

License

MIT. See LICENSE.

Ver o original no GitHub

Bom para

Relacionados