Communityコーディング&開発github.com

fortigate-config-review

Use when reviewing, auditing, or diffing a FortiGate .conf backup — checking for risky firewall policies, comparing two config backups for what changed between dates, or validating a config before pushing it to production.

fortigate-config-review とは?

fortigate-config-review is a Claude Code agent skill that use when reviewing, auditing, or diffing a FortiGate .conf backup — checking for risky firewall policies, comparing two config backups for what changed between dates, or validating a config before pushing it to production.

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/thiagopagani/fortigate-config-review/tree/HEAD/skills/fortigate-config-review

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

FortiGate Config Review

Overview

Reads a FortiGate CLI-style .conf backup (or two, to diff) and reports risk findings and changes in the same terms a senior Fortinet admin would flag during a change review. Not a replacement for FortiAnalyzer/FortiManager compliance scanning — it's a fast manual-review aid for one-off config checks.

When to Use

  • Before pushing a config change to a production FortiGate
  • Reviewing a .conf backup pulled from a site for the first time
  • "What changed between these two backups?" after an incident or scheduled maintenance
  • Onboarding a new site/client firewall and need a quick risk read

Safety rules (always)

  • Read-only. Never connect to a FortiGate, never run commands on a device, never edit or overwrite a .conf backup. This skill only reads files.
  • Redact before reading. Before opening any backup, run the bundled script (in scripts/ next to this SKILL.md):
    python scripts/redact.py <backup>.conf
    
    Then read only <backup>.redacted.conf. It masks admin/LDAP/RADIUS passwords, VPN PSKs, private keys, SNMP communities and other secret fields with <REDACTED>.
  • If the script exits with code 2, it found a secret stored in plain text (no ENC). Report that as an [ALTO] finding with the line numbers it printed — never quote the value.
  • If Python is unavailable, stop and tell the user; do not fall back to reading the raw backup.

Finding the right backup first

FortiGate backup filenames usually encode device, site, firmware and timestamp (e.g. FG100FTK00000000-CLIENTE01_MATRIZ_7-6_3704_202601011200.conf). Never trust file listing order or memory for "latest" — always ls -t *.conf (or sort by the timestamp embedded in the filename) to confirm which backup is actually newest before reviewing or diffing. If a project has its own governance doc (e.g. a CLAUDE.md naming a source-of-truth hierarchy), that doc wins over this default.

Review Checklist

Work through config firewall policy blocks first — that's where risk concentrates — then objects/admin.

CheckGrep patternWhy it matters
Broad allow rulesrcaddr "all" + dstaddr "all" + action accept in the same policy blockClassic any-any accept; should be scoped or justified in a comment
Logging off on an accept policyaction accept without a set logtraffic line (or set logtraffic disable)No audit trail if that path is ever abused
Service left wide openset service "ALL"Should name the actual ports/services needed
No default-deny visibleLast policy in config firewall policy is not a deny/dropImplicit-deny exists in FortiOS, but an explicit logged deny-all at the bottom is best practice for audit visibility
Admin access not restrictedconfig system admin entries without a set trusthost1 (or equivalent)Admin GUI/CLI reachable from anywhere
Orphaned address/group objectsObject defined in config firewall address/addrgrp but never referenced in any firewall policy blockDead config, audit noise, occasionally a sign of a removed rule that wasn't cleaned up
Firmware/build sanityHeader comment or #config-version= lineFlag if clearly outdated vs. the device's current known build
VPN phase1/phase2 proposalsconfig vpn ipsec phase1-interface / phase2-interfaceFlag weak proposals (DES, MD5, PFS disabled) if present

Diffing two backups

diff -u old.redacted.conf new.redacted.conf | grep -E '^[+-]' | grep -v '^[+-][+-][+-]'

Read the diff in blocks, not line-by-line — a single policy edit can span several lines (edit, set, next). Group consecutive +/- lines by the edit <id> or config <section> they fall under, then describe each changed block in one sentence: what policy/object, what changed, security-relevant or not.

Output format

Report findings grouped by severity, each with the exact config line quoted:

## Achados de risco
1. [ALTO] Política 12: srcaddr "all", dstaddr "all", service "ALL", accept, sem log — "edit 12" ... "set action accept" (sem "set logtraffic")
2. [MÉDIO] 3 objetos de endereço órfãos: OBJ-OLD-VPN-01, OBJ-TEST-TMP, OBJ-UNUSED-DC

## Diferenças entre backups (se aplicável)
1. Política 7: service alterado de "HTTPS" para "ALL" — alargamento de escopo, revisar

Common Mistakes

  • Treating ls default sort as "newest first" — it isn't; always confirm via timestamp.
  • Flagging every srcaddr "all" as critical without checking if dstaddr is also unscoped and action is accept — an "all" source to one specific internal host on one service is normal (e.g. inbound WAN rules).
  • Diffing without grouping by block — raw line diff on CLI config is noisy and easy to misread.

関連スキル