Skip to content
Projets

À propos

Scripts Python permettant de convertir les règles de pare-feu de PfSense et OPNSense en une représentation graphique des flux.

Sécurité et confidentialité

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
0
in 7 days
+3
in 15 days
+5
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

PyFRC2G - Unified Firewall Rules to Graph Converter

Convert firewall rules into graphical flow diagrams, audit and compliance reports. Read the rules live through the API or from a backup / configuration file, then get the flows as graphs, a risk score, the audit findings, the changes since the last run and ready-to-send PDF / HTML / Excel / CSV reports.

Firewall Live (API) Backup / configuration file
pfSense ✅ REST API package config.xml
OPNsense ✅ config.xml
nfSensei ✅ read-only API key running.yaml of a backup (or the whole backup archive), JSON / YAML configuration
FortiGate configuration file (.conf)
iptables iptables-save -c
nftables nft -j list ruleset
Stormshield (experimental) ConfigFiles archive (.zip / .tar.gz)

The format of a file is detected automatically. In the web application, a firewall with an API is added once and analysed on a schedule; a backup file is uploaded and kept as its own firewall.

pfSense Example OPNSense Example

🖼️ Overview

Dashboard: score per firewall, environments Firewall page: score over time, findings, rules
Dashboard Firewall overview
Audit findings and accepted risks Accepted risks: approval, renewal, expiry
Audit and accepted risks Accepted risks
Flow graph (zones) Zone matrix
Graphs Zone matrix
Compare two analyses or two firewalls Global search
Compare Search
Remediation follow-up Compliance (ISO 27001, CIS, NIS2, PCI DSS...)
Remediation Compliance
Change review: validate or reject rule changes Executive report: one page for managers
Change review Executive report
Cleanup plan: expired temporary rules, broad rules History of the accepted-risk decisions
Cleanup plan History
Accounts and account review Interactive HTML report
Users HTML report

📦 Repository content

Folder Package What it is
engine/ pyfrc2g The engine and the command line tool: parsers, audit, change report, compliance policy, risk score, zone matrix, graphs, PDF / HTML / Excel / CSV reports, CISO Assistant upload. Everything you need without a web interface.
web/ pyfrc2g-web The web application (Flask), which uses the engine: dashboard per environment, charts and graphs per firewall, API firewalls and uploaded files, four roles with per-firewall scopes, optional OpenID Connect sign-in and two-factor authentication, accepted risks with approval, renewal, history and expiry, validation of the rule changes, temporary rules, remediation tracking, executive report, trends, rule review, cleanup plan, rule simulation, flow search, global search, compliance mapping, REST API and Prometheus metrics, alerts and scheduled reports by email, SIEM export, encrypted backups, data encrypted in SQLite.

Full documentation: engine/README.md and web/README.md. How the analysis works and how to read the results (risk score, findings, accepted risks, reports, CISO Assistant): HOW_IT_WORKS.md (also shown in the web application, page How it works).

🚀 Quick start

Command line (engine)

git clone https://github.com/olivierb46/PyFRC2G.git
cd PyFRC2G/engine
pip install .                        # Graphviz must be installed on the system
pyfrc2g --backup config.xml          # a backup file: reports in results/<firewall>/
pyfrc2g                              # API mode (pfSense, OPNsense, nfSensei): firewalls set in .env / config.py

Without cloning: pip install "pyfrc2g @ git+https://github.com/olivierb46/PyFRC2G.git#subdirectory=engine". Docker image of the command line: see engine/Dockerfile.

Web application

git clone https://github.com/olivierb46/PyFRC2G.git
cd PyFRC2G/web
cp .env.example .env                 # set PYFRC2G_REDIS_PASSWORD; put the TLS certificate in nginx/certs/
docker compose up -d --build         # https://localhost/ (nginx and Redis start with it)

The web application runs with Docker only (prerequisites: a TLS certificate and a Redis password, see web/README.md); the engine and its command line also install with pip (above). Then add an API firewall (Administration > API firewalls) or upload a backup file (Configuration files).

📄 License

MIT, see LICENSE.

Explorer des projets similaires

Chargement…