security/policyanalyzer: new plugin, read-only firewall policy analysis with optional local AI
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 8/100
調査の方向性
This is a proposal for a large third-party plugin, not a scoped change to the repository, and the maintainers have not yet answered whether any part should be accepted. Read the linked repository igortoledo007/opnsense-policyanalyzer and the maintainer questions about a small first plugin and translation domains. Done means a maintainer decision on scope and packaging, not a code change.
索引モデルが issue の本文から書いたものです。
説明
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
- I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
- I have searched the existing issues, open and closed, and I'm convinced that mine is new.
- When the request is meant for an existing plugin, I've added its name to the title.
Is your feature request related to a problem? Please describe.
Hi, before going any further I'd like your feedback on a larger plugin. Our community is crucial in shaping the ongoing development of our open-source OPNsense® software products.
A firewall rule set grows over the years and it becomes hard to tell which rules still matter, which ones are shadowed or too broad, what is actually exposed, and what the blocked traffic means. The data is all in OPNsense (rules and counters, the filter log, Suricata, Unbound, Kea), but there is no place that puts it together and explains it.
Describe the solution you'd like
What it is
Policy Analyzer (branded "Max Cyber IA" in the GUI) is a plugin under Firewall › Policy Analyzer. Source, install guide and tests: https://github.com/igortoledo007/opnsense-policyanalyzer
| Page | What you get |
|---|---|
| Analysis | findings on the rule set: shadowed, redundant, unused or too broad rules, risky exposures, with evidence and a suggested fix |
| Incidents | blocked and suspicious traffic grouped into scored incidents with a timeline |
| Anomalies | beaconing, DNS tunnels and bypass, new domains and devices, outbound volume, internal scans |
| Posture | hardening checks of the firewall itself, with a score per category |
| Devices | passive inventory of local devices (DHCP, ARP/NDP, flows), vendor and risk hints |
| Vulnerabilities | exposed services matched against CVE data (NVD, CISA KEV, EPSS, OSV), opt-in |
| AI Console | questions in plain language, answered from read-only evidence |
| Reports | daily/weekly PDF reports and alerts by e-mail |
Design rules:
- Read only by default. The analysis never changes rules. The only optional action is a quarantine (an External alias + one floating block rule), and every change follows simulate → apply → revert with an action history.
- AI is optional and can stay local. An assistant installs Ollama in a FreeBSD jail without Internet access; a server in the LAN or the Anthropic API can be used instead. Data is anonymized before it goes to a remote provider.
- Uses what OPNsense already has: rules and counters, the filter log, Suricata
eve.json, Unbound reporting, Kea, Insight/NetFlow, Monit's SMTP settings and the GeoIP aliases (the user's own MaxMind key; no GeoIP data is shipped). - Python standard library only, no extra packages. About 950 unit tests run without a firewall on synthetic data.
- Languages: the GUI and the PDF/e-mail reports are available in the 20 OPNsense languages. The GUI uses its own gettext domain (
PolicyAnalyzer) with the core catalogue as fallback, so the core catalogue is never touched and strings the core already translates keep the core translation. PDFs embed the default theme font for Latin, Greek and Cyrillic scripts; Chinese, Japanese, Korean and Persian PDFs fall back to English (OPNsense ships no font for them) while the e-mail keeps the language. The translations were made with AI assistance and reviewed; corrections from native speakers are welcome.
Questions
- The code base is large (Python ~55k lines, plus GUI). I know big initial code bases can't be reviewed. Would a small first plugin make sense, for example only the read-only rule analysis (Analysis page, no AI, no quarantine), with the rest staying in my repository or coming later in parts?
- Or is it better kept as a third-party plugin in its own repository? In that case, is there a recommended way to make it discoverable to users?
- For translations of a plugin outside the official repository: is a separate gettext domain the right approach, or is there a way to contribute the strings to opnsense/lang?
I'm happy to maintain whatever part is accepted. Maintainer: igortoledo007 (please reach me here on GitHub).
Describe alternatives you've considered
- Separate tools outside the firewall (log shippers, SIEM): heavier, and the rule analysis needs the live configuration and counters.
- Proposing parts to core: the analysis is optional and opinionated, so a plugin keeps it out of the way of users who don't want it.
Additional context
AI disclosure
Developed with AI assistance: Claude (Anthropic), a mix of the Fable 5.2 and Opus 5.5 models. I reviewed and tested it on my own OPNsense 26.7.9 firewall.
Screenshots
Taken on my own firewall running OPNsense 26.7.9 (Forja theme from #5921); addresses, host and device names are blurred.
- Analysis
- Incidents
- Anomalies
- Posture
- Devices
- AI Console
- AI setup
- 主要言語
- PHP
- スター
- 1.2k
- フォーク
- 932
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 22
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
opnsense/plugins のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
www/squid: configctl proxy stop returns before Squid exits, so stop+start (e.g. Monit restart) failsオープンsupport
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
opnsense/plugins#5983 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
net/haproxy: IPv6 literal in real server "Source address" generates an invalid `source` directive対応中かも @fraenki が 6 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
opnsense/plugins#5973 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[dns/ddclient] Support hiding unused standard fields per service (optional_hiding)対応中かも @bringha1 が 9 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
opnsense/plugins の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Automattic/blocks-engine#7881 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
iruzen-dono/workless#117 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
magicsunday/webtrees-docker#285 ·
メンテナーはふだん 1 日以内に返信
-
area/tests type/bug when/soon
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
WP-CLI 3.0 fixes the cron lock and core download bugs described in the handbook対応中かも @mayankmajeji が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
WordPress/hosting-handbook#521 ·