Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
93 changes: 31 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
```
Expand All @@ -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
Expand All @@ -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.
2 changes: 1 addition & 1 deletion frontend/src/components/ReportView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function ReportView({ report }: { report: CheckResponse }) {
<p className='mt-2'><strong>Risiko:</strong> {report.risk || 'Keine Risikobewertung verfügbar.'}</p>
{rpkiExplanation && <p className='mt-2 p-2 rounded bg-amber-50 border border-amber-200'><strong>RPKI-Hinweis:</strong> {String(rpkiExplanation)}</p>}
{extractedPrefixes.length > 0 && <p className='mt-2 text-sm'><strong>Sichtbare Prefixe:</strong> {extractedPrefixes.length}</p>}
{report.details?.demo_mode && <p className='mt-2 text-sm p-2 rounded border border-blue-200 bg-blue-50'><strong>Demo-Modus:</strong> Es werden feste Beispieldaten verwendet.</p>}
{report.details?.demo_mode && <p className='mt-2 text-sm p-3 rounded border border-blue-300 bg-blue-50 text-blue-900'><strong>Demo-Modus aktiv.</strong> Es werden feste Beispieldaten verwendet. Diese Ausgabe ist nicht für echte Routing-Bewertungen geeignet.</p>}

<h4 className='font-semibold mt-4'>Empfehlungen</h4>
{recs.length > 0 ? <ul className='list-disc pl-5'>{recs.map((r, i) => <li key={`${r}-${i}`}>{r}</li>)}</ul> : <p>Keine Empfehlungen verfügbar.</p>}
Expand Down
Loading