563 lines
16 KiB
Markdown
563 lines
16 KiB
Markdown
# CC24-Hub
|
||
|
||
Ein kuratiertes Verzeichnis für digitale Forensik- und Incident-Response-Tools mit KI-gestützten Empfehlungen, entwickelt für die Seminargruppe CC24-w1.
|
||
|
||
## 🎯 Projektübersicht
|
||
|
||
CC24-Hub bietet eine strukturierte Übersicht über bewährte DFIR-Tools, -Methoden und -Konzepte mit intelligenten Empfehlungsfunktionen. Das Projekt orientiert sich am NIST-Framework (SP 800-86) und kategorisiert nach forensischen Domänen und Untersuchungsphasen.
|
||
|
||
### Hauptfunktionen
|
||
|
||
- **KI-gestützte Empfehlungen**: Workflow- und Tool-Vorschläge basierend auf forensischen Szenarien
|
||
- **Drei Kategorien**: Software-Tools, forensische Methoden UND Grundlagenkonzepte
|
||
- **Matrix-Ansicht**: Visualisierung nach Domänen × Prozess-Phasen
|
||
- **Erweiterte Filter**: Suche nach Name, Tags, Domäne, Phase, Lizenz
|
||
- **CC24-Server Integration**: Direkte SSO-Links zu gehosteten Instanzen
|
||
- **Knowledgebase**: Erweiterte Dokumentation mit praktischen Erkenntnissen
|
||
- **Konzept-Verlinkung**: Automatische Verknüpfung zwischen Tools und Grundlagenkonzepten
|
||
- **Status-Monitoring**: Live-Überwachung verfügbarer Services
|
||
- **Responsive Design**: Dark/Light Mode, Mobile-optimiert
|
||
|
||
## 🛠️ Technischer Stack
|
||
|
||
- **Framework**: [Astro](https://astro.build/) mit Server-Side Rendering
|
||
- **Backend**: Node.js mit API-Routen für KI und Authentifizierung
|
||
- **Styling**: Vanilla CSS mit CSS Custom Properties
|
||
- **Datenformat**: YAML für Tool-/Methoden-/Konzept-Definitionen
|
||
- **KI-Integration**: Mistral AI über OpenAI-kompatible API
|
||
- **Authentifizierung**: OIDC (OpenID Connect) mit JWT-Sessions
|
||
- **Node.js**: >=18.0.0
|
||
|
||
## 🚀 Installation & Deployment
|
||
|
||
### Lokale Entwicklung
|
||
|
||
```bash
|
||
# Repository klonen
|
||
git clone https://git.cc24.dev/mstoeck3/cc24-hub.git
|
||
cd cc24-hub
|
||
|
||
# Dependencies installieren
|
||
npm install
|
||
|
||
# Development Server starten
|
||
npm run dev
|
||
```
|
||
|
||
Die Seite ist dann unter `http://localhost:4321` verfügbar.
|
||
|
||
### Produktions-Deployment
|
||
|
||
#### Voraussetzungen
|
||
|
||
- Ubuntu/Debian server
|
||
- Node.js 18+
|
||
- Nginx
|
||
- Domain
|
||
- SSL Zertifikat
|
||
|
||
#### Installationsschritte
|
||
|
||
##### 1. Vorbereitung
|
||
|
||
```bash
|
||
# Klonen des Repositorys
|
||
git clone https://git.cc24.dev/mstoeck3/cc24-hub
|
||
cd cc24-hub
|
||
|
||
# Abhängigkeiten installieren
|
||
npm install
|
||
|
||
# Production-Build anstoßen
|
||
npm run build
|
||
```
|
||
|
||
##### 2. Webroot vorbereiten
|
||
|
||
```bash
|
||
# Webroot erstellen und Berechtigungen setzen
|
||
sudo mkdir -p /var/www/cc24-hub
|
||
sudo chown -R $USER:$USER /var/www/cc24-hub
|
||
|
||
# Build in Webroot kopieren
|
||
sudo cp -r ./dist/* /var/www/cc24-hub/
|
||
sudo cp ./src/data/tools.yaml /var/www/cc24-hub/src/data/
|
||
sudo cp package.json /var/www/cc24-hub/
|
||
|
||
# Prod-Abhängigkeiten installieren
|
||
cd /var/www/cc24-hub
|
||
npm install --omit=dev
|
||
|
||
# Berechtigungen setzen
|
||
sudo chown -R www-data:www-data /var/www/cc24-hub
|
||
```
|
||
|
||
##### 3. Umgebungsvariablen setzen
|
||
|
||
Erstelle `/var/www/cc24-hub/.env`:
|
||
|
||
```bash
|
||
# AI Konfiguration
|
||
AI_API_ENDPOINT=https://llm.mikoshi.de # hier geeigneten Endpunkt setzen
|
||
AI_API_KEY=your_ai_api_key
|
||
AI_MODEL=mistral/mistral-small-latest # hier geeignetes KI-Modell wählen
|
||
|
||
# Authentifizierung ("false" setzen für Tests, oder wenn kostenlose KI verwendet wird)
|
||
AUTHENTICATION_NECESSARY=true
|
||
OIDC_ENDPOINT=https://cloud.cc24.dev
|
||
OIDC_CLIENT_ID=your_oidc_client_id
|
||
OIDC_CLIENT_SECRET=your_oidc_client_secret
|
||
AUTH_SECRET=your_super_secret_jwt_key_min_32_chars
|
||
|
||
# Public Configuration
|
||
PUBLIC_BASE_URL=https://your-domain.com # hier die URL setzen, mit der von außen zugegriffen wird
|
||
```
|
||
|
||
```bash
|
||
# .env sichern
|
||
sudo chmod 600 /var/www/cc24-hub/.env
|
||
sudo chown www-data:www-data /var/www/cc24-hub/.env
|
||
```
|
||
|
||
##### 4. Systemd-Service erstellen
|
||
|
||
Create `/etc/systemd/system/cc24-hub.service`:
|
||
|
||
```ini
|
||
[Unit]
|
||
Description=CC24-Hub DFIR Tool Directory
|
||
After=network.target
|
||
Wants=network.target
|
||
|
||
[Service]
|
||
Type=simple
|
||
User=www-data
|
||
Group=www-data
|
||
WorkingDirectory=/var/www/cc24-hub
|
||
ExecStart=/usr/bin/node server/entry.mjs
|
||
Restart=always
|
||
RestartSec=5
|
||
StartLimitInterval=60s
|
||
StartLimitBurst=3
|
||
|
||
# Environment
|
||
Environment=NODE_ENV=production
|
||
Environment=PORT=3000
|
||
|
||
# Security
|
||
NoNewPrivileges=true
|
||
PrivateTmp=true
|
||
ProtectSystem=strict
|
||
ReadWritePaths=/var/www/cc24-hub
|
||
|
||
# Logging
|
||
StandardOutput=journal
|
||
StandardError=journal
|
||
SyslogIdentifier=cc24-hub
|
||
|
||
[Install]
|
||
WantedBy=multi-user.target
|
||
```
|
||
|
||
##### 5. Nginx Reverse Proxy konfigurieren
|
||
|
||
Erstelle `/etc/nginx/sites-available/cc24-hub`:
|
||
|
||
```nginx
|
||
server {
|
||
listen 80;
|
||
server_name your-domain.com;
|
||
return 301 https://$server_name$request_uri;
|
||
}
|
||
|
||
server {
|
||
listen 443 ssl http2;
|
||
server_name your-domain.com;
|
||
|
||
# SSL Configuration (adjust paths for your certificates)
|
||
ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
|
||
ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;
|
||
|
||
# SSL Security
|
||
ssl_protocols TLSv1.2 TLSv1.3;
|
||
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384;
|
||
ssl_prefer_server_ciphers off;
|
||
|
||
# Security Headers
|
||
add_header X-Frame-Options DENY;
|
||
add_header X-Content-Type-Options nosniff;
|
||
add_header X-XSS-Protection "1; mode=block";
|
||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||
|
||
# Proxy to Node.js application
|
||
location / {
|
||
proxy_pass http://localhost:3000;
|
||
proxy_http_version 1.1;
|
||
proxy_set_header Upgrade $http_upgrade;
|
||
proxy_set_header Connection 'upgrade';
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
proxy_set_header X-Forwarded-Proto $scheme;
|
||
proxy_cache_bypass $http_upgrade;
|
||
proxy_read_timeout 300s;
|
||
proxy_connect_timeout 75s;
|
||
}
|
||
|
||
# Optional: Serve static assets directly (performance optimization)
|
||
location /_astro/ {
|
||
proxy_pass http://localhost:3000;
|
||
expires 1y;
|
||
add_header Cache-Control "public, immutable";
|
||
}
|
||
}
|
||
```
|
||
|
||
##### 6. Daemon starten und Autostart setzen
|
||
|
||
```bash
|
||
# Enable Nginx site
|
||
sudo ln -s /etc/nginx/sites-available/cc24-hub /etc/nginx/sites-enabled/
|
||
sudo nginx -t
|
||
sudo systemctl reload nginx
|
||
|
||
# Enable and start CC24-Hub service
|
||
sudo systemctl daemon-reload
|
||
sudo systemctl enable cc24-hub
|
||
sudo systemctl start cc24-hub
|
||
|
||
# Check status
|
||
sudo systemctl status cc24-hub
|
||
```
|
||
|
||
##### 7. Deployment verifizieren
|
||
|
||
```bash
|
||
# Check application logs
|
||
sudo journalctl -u cc24-hub -f
|
||
|
||
# Check if app is responding
|
||
curl http://localhost:3000
|
||
|
||
# Check external access
|
||
curl https://your-domain.com
|
||
```
|
||
|
||
#### OIDC Konfigurieren
|
||
|
||
Nextcloud OIDC Einstellungen (sollte auch mit anderen OIDC-Anwendungen klappen):
|
||
- **Redirect URI**: `https://your-domain.com/auth/callback`
|
||
- **Logout URI**: `https://your-domain.com`
|
||
|
||
## 🔧 Datenformat & Kategorien
|
||
|
||
Die CC24-Hub verwaltet drei Kategorien von Einträgen in `src/data/tools.yaml`:
|
||
|
||
### 1. Software-Tools
|
||
|
||
```yaml
|
||
tools:
|
||
- name: "Autopsy"
|
||
icon: "📦"
|
||
type: "software"
|
||
description: "Die führende Open-Source-Alternative zu kommerziellen Forensik-Suiten"
|
||
domains: ["incident-response", "law-enforcement"]
|
||
phases: ["examination", "analysis"]
|
||
platforms: ["Windows", "Linux"]
|
||
skillLevel: "intermediate"
|
||
accessType: "download"
|
||
url: "https://www.autopsy.com/"
|
||
projectUrl: "https://autopsy.cc24.dev" # CC24-Server URL (optional)
|
||
license: "Apache 2.0"
|
||
knowledgebase: true # Hat erweiterte Dokumentation
|
||
related_concepts: ["Hash Functions & Digital Signatures", "SQL Query Fundamentals"] # Verknüpfung zu Konzepten
|
||
tags: ["gui", "filesystem", "timeline-analysis"]
|
||
statusUrl: "https://status.example.com/badge/1/status" # Status-Badge URL (optional)
|
||
```
|
||
|
||
### 2. Forensische Methoden
|
||
|
||
```yaml
|
||
- name: "Live Memory Acquisition Procedure"
|
||
icon: "📋"
|
||
type: "method"
|
||
description: "Standardisiertes Verfahren zur forensisch korrekten Akquisition des Arbeitsspeichers"
|
||
domains: ["incident-response", "law-enforcement"]
|
||
phases: ["data-collection"]
|
||
platforms: [] # Methoden haben keine Plattformen
|
||
skillLevel: "advanced"
|
||
accessType: null
|
||
url: "https://www.nist.gov/publications/guide-integrating-forensic-techniques"
|
||
projectUrl: null
|
||
license: null
|
||
knowledgebase: false
|
||
related_concepts: null # Können optional Konzepte verknüpfen
|
||
tags: ["memory-acquisition", "volatile-evidence", "procedure"]
|
||
```
|
||
|
||
### 3. Grundlagenkonzepte (NEU)
|
||
|
||
```yaml
|
||
- name: "Regular Expressions (Regex)"
|
||
icon: "🔤"
|
||
type: "concept"
|
||
description: "Pattern matching language for searching, extracting, and manipulating text"
|
||
domains: ["incident-response", "malware-analysis"]
|
||
phases: ["examination", "analysis"]
|
||
platforms: [] # Konzepte haben keine Plattformen
|
||
skillLevel: "intermediate"
|
||
accessType: null
|
||
url: "https://regexr.com/"
|
||
projectUrl: null
|
||
license: null
|
||
knowledgebase: true # Erweiterte Erklärung in Knowledgebase
|
||
related_concepts: null # Konzepte verweisen nicht auf andere Konzepte
|
||
tags: ["pattern-matching", "text-processing", "log-analysis"]
|
||
```
|
||
|
||
### Verfügbare Kategorien
|
||
|
||
**Domänen:**
|
||
- `incident-response` - Incident Response & Breach-Untersuchung
|
||
- `law-enforcement` - Strafverfolgung & Kriminalermittlung
|
||
- `malware-analysis` - Malware-Analyse & Reverse Engineering
|
||
- `fraud-investigation` - Betrugs- & Finanzkriminalität
|
||
- `network-forensics` - Netzwerk-Forensik & Traffic-Analyse
|
||
- `mobile-forensics` - Mobile Geräte & App-Forensik
|
||
- `cloud-forensics` - Cloud & Virtuelle Umgebungen
|
||
- `ics-forensics` - Industrielle Kontrollsysteme (ICS/SCADA)
|
||
|
||
**Phasen (NIST SP 800-86):**
|
||
- `data-collection` - Datensammlung
|
||
- `examination` - Auswertung
|
||
- `analysis` - Analyse
|
||
- `reporting` - Bericht & Präsentation
|
||
|
||
**Domain-agnostic Kategorien:**
|
||
- `collaboration-general` - Übergreifend & Kollaboration
|
||
- `specific-os` - Betriebssysteme
|
||
|
||
## 📚 Knowledgebase-System
|
||
|
||
### Erweiterte Dokumentation erstellen
|
||
|
||
Die Knowledgebase bietet detaillierte Artikel für Tools, Methoden und Konzepte. So erstellen Sie neue Einträge:
|
||
|
||
#### 1. Knowledgebase-Flag setzen
|
||
|
||
Setzen Sie in `src/data/tools.yaml` das Flag:
|
||
```yaml
|
||
knowledgebase: true
|
||
```
|
||
|
||
#### 2. Artikel-Datei erstellen
|
||
|
||
Erstellen Sie eine Markdown-Datei in `src/content/knowledgebase/`:
|
||
|
||
**Dateiname-Schema:** `[tool-name-slug].md`
|
||
|
||
**Beispiel:** `src/content/knowledgebase/autopsy.md`
|
||
|
||
```markdown
|
||
---
|
||
title: "Autopsy - Umfassende Forensik-Suite"
|
||
tool_name: "Autopsy"
|
||
description: "Detaillierte Anleitung und Best Practices für Autopsy"
|
||
last_updated: 2024-01-15
|
||
author: "CC24-Team"
|
||
difficulty: "intermediate"
|
||
categories: ["filesystem-analysis", "timeline-analysis"]
|
||
tags: ["gui", "windows", "linux", "open-source"]
|
||
sections:
|
||
overview: true
|
||
installation: true
|
||
configuration: true
|
||
usage_examples: true
|
||
best_practices: true
|
||
troubleshooting: true
|
||
advanced_topics: false
|
||
review_status: "published"
|
||
---
|
||
|
||
# Übersicht
|
||
|
||
Autopsy ist eine grafische Benutzeroberfläche für The Sleuth Kit (TSK) und bietet...
|
||
|
||
## Installation
|
||
|
||
### Windows
|
||
1. Download der neuesten Version von [autopsy.com](https://www.autopsy.com/)
|
||
2. Ausführung des Installers mit Administratorrechten
|
||
3. ...
|
||
|
||
## Konfiguration
|
||
|
||
### Grundeinstellungen
|
||
- Arbeitsverzeichnis festlegen
|
||
- Hash-Algorithmen auswählen
|
||
- ...
|
||
|
||
## Verwendungsbeispiele
|
||
|
||
### Fall 1: Gelöschte Dateien wiederherstellen
|
||
1. Neuen Fall erstellen
|
||
2. Image hinzufügen
|
||
3. ...
|
||
|
||
## Best Practices
|
||
|
||
- Immer Hash-Verifikation durchführen
|
||
- Regelmäßige Backups der Case-Datenbank
|
||
- ...
|
||
|
||
## Troubleshooting
|
||
|
||
### Problem: Autopsy startet nicht
|
||
**Lösung:** Java-Version überprüfen...
|
||
|
||
### Problem: Langsame Performance
|
||
**Lösung:** RAM-Zuteilung erhöhen...
|
||
|
||
## Weiterführende Themen
|
||
|
||
- Integration mit externen Tools
|
||
- Custom Modules entwickeln
|
||
- ...
|
||
```
|
||
|
||
#### 3. Schema-Validierung
|
||
|
||
Das System validiert automatisch folgende Felder:
|
||
|
||
**Pflichtfelder:**
|
||
- `title`: Anzeigename des Artikels
|
||
- `tool_name`: Exakter Name aus tools.yaml
|
||
- `description`: Kurze Beschreibung
|
||
- `last_updated`: Datum der letzten Aktualisierung
|
||
- `difficulty`: `novice|beginner|intermediate|advanced|expert`
|
||
|
||
**Optionale Felder:**
|
||
- `author`: Standard "CC24-Team"
|
||
- `categories`: Array von Kategorien
|
||
- `tags`: Array von Tags
|
||
- `sections`: Welche Abschnitte enthalten sind
|
||
- `review_status`: `draft|review|published` (Standard: `published`)
|
||
|
||
#### 4. Automatische Verlinkung
|
||
|
||
- Artikel sind automatisch über `/knowledgebase/[tool-slug]` erreichbar
|
||
- Links werden automatisch in Tool-Details angezeigt
|
||
- Suchfunktion indiziert Artikel-Inhalte
|
||
|
||
### Konzept-Verlinkung
|
||
|
||
Tools können mit Grundlagenkonzepten verknüpft werden:
|
||
|
||
```yaml
|
||
# Tool-Definition
|
||
- name: "Autopsy"
|
||
related_concepts: ["Hash Functions & Digital Signatures", "SQL Query Fundamentals"]
|
||
|
||
# Konzept-Definition
|
||
- name: "Hash Functions & Digital Signatures"
|
||
type: "concept"
|
||
description: "Cryptographic principles for data integrity verification"
|
||
```
|
||
|
||
Die KI-Empfehlungen nutzen diese Verlinkungen für Hintergrundwissen-Empfehlungen.
|
||
|
||
## 🤖 KI-Integration
|
||
|
||
### Workflow-Empfehlungen
|
||
Beschreibung forensischer Szenarien für maßgeschneiderte Workflows mit phasenbasierten Tool-Empfehlungen und Prioritätsbewertung.
|
||
|
||
### Tool-spezifische Empfehlungen
|
||
Konkrete Tool-Vorschläge für spezifische Probleme mit detaillierten Begründungen, Implementierungsansätzen und Vor-/Nachteilen.
|
||
|
||
### Konzept-Integration
|
||
Die KI berücksichtigt automatisch verknüpfte Grundlagenkonzepte und empfiehlt relevantes Hintergrundwissen.
|
||
|
||
**API-Endpunkt:** `/api/ai/query`
|
||
- **Rate Limiting**: 10 Anfragen pro Minute pro Benutzer
|
||
- **Modi**: `workflow` (Szenario-basiert) oder `tool` (Problem-spezifisch)
|
||
- **Authentifizierung**: Optional konfigurierbar via `AUTHENTICATION_NECESSARY`
|
||
|
||
## 🔐 Authentifizierung
|
||
|
||
OIDC-Integration mit JWT-Sessions:
|
||
- **6 Stunden Gültigkeit**
|
||
- **HTTP-Only Cookies** mit CSRF-Schutz
|
||
- **Nextcloud/Keycloak kompatibel**
|
||
|
||
**Relevante Dateien:**
|
||
- `src/utils/auth.ts` - Kern-Authentifizierungslogik
|
||
- `src/pages/api/auth/` - Auth-API-Endpunkte
|
||
|
||
## 📁 Datei-Referenz
|
||
|
||
### Wichtige Konfigurationsdateien
|
||
- `src/data/tools.yaml` - Hauptdatenbank für Tools, Methoden und Konzepte
|
||
- `src/content/config.ts` - Schema für Knowledgebase-Artikel
|
||
- `src/utils/dataService.js` - Datenverarbeitungslogik
|
||
- `src/styles/global.css` - Zentrale Stylesheet-Definitionen
|
||
|
||
### Content-Verzeichnisse
|
||
- `src/content/knowledgebase/` - Knowledgebase-Artikel (Markdown)
|
||
- `src/components/` - Wiederverwendbare UI-Komponenten
|
||
- `src/pages/api/` - Backend-API-Endpunkte
|
||
|
||
## 🤝 Beitragen
|
||
|
||
### Tool/Methode/Konzept hinzufügen
|
||
|
||
**Option 1: Direkte YAML-Bearbeitung**
|
||
1. Fork des Repositories erstellen
|
||
2. `src/data/tools.yaml` bearbeiten
|
||
3. Bei Bedarf Knowledgebase-Artikel erstellen
|
||
4. Pull Request mit Beschreibung erstellen
|
||
|
||
**Option 2: Web-Editor verwenden**
|
||
1. YAML-Editor öffnen (`/dfir_yaml_editor.html`)
|
||
2. Eintrag hinzufügen (Tool/Methode/Konzept)
|
||
3. YAML exportieren und in Pull Request einreichen
|
||
|
||
### Knowledgebase-Artikel erweitern
|
||
|
||
1. Tool in `tools.yaml` identifizieren
|
||
2. `knowledgebase: true` setzen
|
||
3. Artikel in `src/content/knowledgebase/[slug].md` erstellen
|
||
4. Schema-Validierung beachten
|
||
5. Pull Request einreichen
|
||
|
||
### Korrekturen & Verbesserungen
|
||
|
||
- Bug Reports und Feature Requests über Issues melden
|
||
- Code-Beiträge über Pull Requests willkommen
|
||
- Dokumentation und Übersetzungen erwünscht
|
||
|
||
## 🐛 Troubleshooting
|
||
|
||
**KI-Empfehlungen funktionieren nicht:**
|
||
- `.env` Datei korrekt konfiguriert?
|
||
- `AUTHENTICATION_NECESSARY=false` für Tests setzen
|
||
- API-Endpoint erreichbar?
|
||
|
||
**Authentifizierung schlägt fehl:**
|
||
- OIDC-Endpoints korrekt?
|
||
- Redirect-URIs im OIDC-Provider registriert?
|
||
- `AUTH_SECRET` mindestens 32 Zeichen?
|
||
|
||
**Knowledgebase-Artikel werden nicht angezeigt:**
|
||
- `knowledgebase: true` in tools.yaml gesetzt?
|
||
- Markdown-Datei existiert in `src/content/knowledgebase/`?
|
||
- Schema-Validierung erfolgreich?
|
||
|
||
**Logs prüfen:**
|
||
```bash
|
||
# Anwendungs-Logs
|
||
sudo journalctl -u cc24-hub -f
|
||
|
||
# Development-Modus
|
||
npm run dev
|
||
```
|