From 32441d8934dd7c60272bc0c62e6442563b3108e6 Mon Sep 17 00:00:00 2001 From: DeepZone Date: Tue, 19 May 2026 17:14:12 +0100 Subject: [PATCH] Prepare v0.1.0-alpha demo visibility and CI hardening --- .github/workflows/ci.yml | 6 +- README.md | 93 +++++++++----------------- frontend/src/components/ReportView.tsx | 2 +- 3 files changed, 37 insertions(+), 64 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d308d40..044e30d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,11 @@ jobs: - name: Install frontend deps run: | cd frontend - npm ci + if [ -f package-lock.json ]; then + npm ci + else + npm install + fi - name: Build frontend run: | cd frontend diff --git a/README.md b/README.md index 3745321..00d146c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ -# RouteForge v0.1 +# RouteForge v0.1.0-alpha RouteForge ist ein selfhosted, read-only Preflight- und Explainability-Tool für BGP/RPKI/RIPE-Daten. ## Was kann v0.1? - ASN Check (RIPEstat as-overview + announced-prefixes) - Prefix Check (routing-status, whois, optional rpki-validation mit Origin-AS) +- ASN-RPKI-Batchprüfung für sichtbare Prefixe - Ampelstatus: OK, WARNING, CRITICAL, UNKNOWN - Reports als JSON, Markdown, HTML - REST API, Web UI, Typer CLI @@ -26,50 +27,42 @@ Mit Hot Reload: docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build ``` -## API Beispiele -```bash -curl http://192.168.58.167:8000/health -curl -X POST http://192.168.58.167:8000/api/check/asn -H 'content-type: application/json' -d '{"asn":"AS3320"}' -curl -X POST http://192.168.58.167:8000/api/check/prefix -H 'content-type: application/json' -d '{"prefix":"193.0.22.0/23","origin_as":"AS3333"}' -``` +## Typische Nutzung - -### Prefix mit RPKI +### 1) Prefix gegen Origin-AS prüfen ```bash curl -X POST http://localhost:8000/api/check/prefix \ -H "Content-Type: application/json" \ -d '{"prefix":"193.0.6.0/24","origin_as":"AS3333"}' ``` -### Prefix ohne Origin-AS +### 2) ASN prüfen ```bash -curl -X POST http://localhost:8000/api/check/prefix \ +curl -X POST http://localhost:8000/api/check/asn \ -H "Content-Type: application/json" \ - -d '{"prefix":"193.0.6.0/24"}' + -d '{"asn":"AS3320"}' ``` -RouteForge bleibt strikt read-only und verändert weder ROAs noch RIPE-Objekte. - -## Tests ausführen - -Backend: +### 3) RPKI Batchprüfung für sichtbare Prefixe einer ASN ```bash -cd backend -pytest -q +curl -X POST http://localhost:8000/api/check/asn-rpki \ + -H "Content-Type: application/json" \ + -d '{"asn":"AS3320","limit":25}' ``` -Frontend: -```bash -cd frontend -npm run build -``` +## Statuswerte + +- **OK:** Keine akute Auffälligkeit im geprüften Kontext. +- **WARNING:** Prüfung war möglich, aber es gibt Hinweise wie fehlende ROA-Abdeckung oder unvollständige Daten. +- **CRITICAL:** Es wurde ein kritisches RPKI-Problem gefunden, zum Beispiel `invalid_asn` oder `invalid_length`. +- **UNKNOWN:** Die Bewertung konnte nicht zuverlässig durchgeführt werden, zum Beispiel wegen fehlender Daten oder API-Fehlern. ## Demo-Modus -RouteForge unterstützt einen Demo-Modus mit festen Beispieldaten für Präsentationen, Tests und Offline-Demos. +`ROUTEFORGE_DEMO_MODE=true` nutzt feste Beispieldaten und ist für Präsentationen, Tests und Offline-Demos gedacht. Der Demo-Modus darf nicht für echte Routing-Bewertungen verwendet werden. -Start per Umgebungsvariable: +Beispiel per Umgebungsvariable: ```bash ROUTEFORGE_DEMO_MODE=true docker compose up --build ``` @@ -79,10 +72,18 @@ Alternativ über `.env`: ROUTEFORGE_DEMO_MODE=true ``` -Beispiele: +## Tests ausführen + +Backend: ```bash -curl -X POST http://localhost:8000/api/check/asn -H "Content-Type: application/json" -d '{"asn":"AS3320"}' -curl -X POST http://localhost:8000/api/check/asn-rpki -H "Content-Type: application/json" -d '{"asn":"AS3320","limit":4}' +cd backend +pytest -q +``` + +Frontend: +```bash +cd frontend +npm run build ``` ## CLI Beispiele @@ -93,42 +94,10 @@ routeforge check-prefix 193.0.22.0/23 --origin-as AS3333 routeforge report 1 --format markdown ``` -## Debugging -```bash -docker compose logs -f backend -docker compose logs -f frontend - -curl http://192.168.58.167:8000/health - -curl -X POST http://192.168.58.167:8000/api/check/asn \ - -H "Content-Type: application/json" \ - -d '{"asn":"AS3320"}' - -curl -X POST http://192.168.58.167:8000/api/check/prefix \ - -H "Content-Type: application/json" \ - -d '{"prefix":"193.0.6.0/24","origin_as":"AS3333"}' -``` - ## Datenquellen - RIPEstat Data API: https://stat.ripe.net/docs/02.data-api - RPKI Validation Endpoint: https://stat.ripe.net/docs/data-api/api-endpoints/rpki-validation - RIPEstat Dokumentation: https://www.ripe.net/publications/documentation/ripestat-documentation/ ## Security Hinweis -RouteForge v0.1 ist vollständig read-only. - -## Roadmap -- v0.1: ASN/Prefix/RPKI Checks, Reports, Web UI, CLI -- v0.2: bessere RIPE DB/IRR Konsistenzchecks, mehr Routing-Sichtbarkeit, Report-Historie -- v0.3: RIPE Atlas Integration, aktive Messungen -- v0.4: optionaler FRR/BIRD Config Parser, weiterhin read-only - -## Warum liefert der ASN-Check nicht direkt RPKI? -RPKI bewertet keine ASN allein. RPKI bewertet immer konkrete Prefix-Origin-Paare. -Der ASN-Check zeigt deshalb zuerst ASN- und Routingdaten. Danach kann eine RPKI-Batchprüfung die sichtbaren Prefixe gegen die ASN als Origin prüfen. - -```bash -curl -X POST http://localhost:8000/api/check/asn-rpki \ - -H "Content-Type: application/json" \ - -d '{"asn":"AS3320","limit":25}' -``` +RouteForge v0.1.0-alpha ist vollständig read-only. diff --git a/frontend/src/components/ReportView.tsx b/frontend/src/components/ReportView.tsx index 5d44b6a..5efcc9c 100644 --- a/frontend/src/components/ReportView.tsx +++ b/frontend/src/components/ReportView.tsx @@ -24,7 +24,7 @@ export function ReportView({ report }: { report: CheckResponse }) {

Risiko: {report.risk || 'Keine Risikobewertung verfügbar.'}

{rpkiExplanation &&

RPKI-Hinweis: {String(rpkiExplanation)}

} {extractedPrefixes.length > 0 &&

Sichtbare Prefixe: {extractedPrefixes.length}

} - {report.details?.demo_mode &&

Demo-Modus: Es werden feste Beispieldaten verwendet.

} + {report.details?.demo_mode &&

Demo-Modus aktiv. Es werden feste Beispieldaten verwendet. Diese Ausgabe ist nicht für echte Routing-Bewertungen geeignet.

}

Empfehlungen

{recs.length > 0 ? :

Keine Empfehlungen verfügbar.

}