Skip to content

Latest commit

 

History

History
166 lines (114 loc) · 5.95 KB

File metadata and controls

166 lines (114 loc) · 5.95 KB

ProxSecure — Implementierungslog (MSP Demo / Production)

Chronologische Dokumentation der Arbeiten an ProxSecure für den Live-Stack auf docker-main (LXC CT 100) mit Proxmox-Host station-2.
Stand: 15. Juni 2026.


Infrastruktur (Referenz)

Komponente Adresse / ID
ProxSecure Dashboard http://192.168.2.115/
Proxmox VE (station-2) 192.168.2.50
Deploy-Pfad /opt/proxsecure auf CT 100
Jira Cloud Projekt SUP (Beispiel-Tickets SUP-2 … SUP-13)

Secrets (API-Keys, Tokens, Passwörter) liegen nur in /opt/proxsecure/.env auf dem Server — nicht im Git-Repository.


Phase 1 — Compliance-Mappings korrigiert (Juni 2026)

Ziel: Falsche ISO 27001:2022 / BSI IT-Grundschutz 2023 / NIS2 Art. 21 Zuordnungen bereinigen.

Änderung Dateien
14 Audit-Checks mit verifizierten Mappings backend/app/core/audit_engine.py
NIS2-Feld im Datenmodell backend/app/models/check.py
Mapping-Tabelle docs/COMPLIANCE_MAPPING.md
NIS2-Badges UI + PDF-Spalte Frontend CheckResultCard, RemediationBlock, report_service.py

Neue Checks u. a.: management_ui_restricted, security_updates_current, rbac_least_privilege, backup_encryption.


Phase 2 — Jira-Tickets & PDF-Reports (Juni 2026)

Feature Endpoint / UI
Bulk-Tickets für alle FAILs POST /api/v1/audit/nodes/{node_id}/tickets
PDF Download + Preview GET /api/v1/audit/nodes/{node_id}/report
UI AuditDetailView.jsx — Buttons „Create Jira Tickets“, „Download Report“, PDF-Modal

Deduplizierung: offene Tickets pro check_id werden nicht doppelt angelegt.


Phase 3 — Operations / Ansible / Break-Glass (Juni 2026)

Komponente Beschreibung
Ansible-Service backend/app/services/ansible_service.py — Playbook-Wrapper, Inventory, Handler
SSH-Key Setup scripts/setup-ansible-ssh-docker-main.sh
Break-Glass POST /operations/break-glass, GET /operations/break-glass/status
Live-Ansible POST /operations/ansible/run — verknüpft mit Jira-Tickets
Production Compose docker-compose.prod.yml — Postgres, CheckMK, Alert-Webhook, Nginx

Behoben: Host-Key-Fehler, falsches Ansible-Inventar, fehlender Request-Import (502).


Phase 4 — Automation-Modi & How-to UI (Juni 2026)

Drei Fix-Typen für MSP-Operatoren:

Modus Badge Bedeutung
auto Ansible Voll per Playbook
assisted Teilweise Ansible + manuelle Schritte
manual Manuell Nur How-to (z. B. 2FA, PBS-Verschlüsselung)
Datei Zweck
frontend/src/utils/automationModes.js Labels, Hints, resolveRemediationMeta()
AutomationModeBadge.jsx, AutomationLegend.jsx, RemediationHowTo.jsx UI-Komponenten
Audit-Tabelle Spalte Fix + Legende
Operations Ticket-Buttons nach Modus, Ansible blockiert bei manual (HTTP 422)
PDF Roadmap Fix-Typ + How-to-Schritte

Phase 5 — Live-Remediation Sweep (15. Juni 2026)

Break-Glass freigeschaltet; Ansible live gegen 192.168.2.50 ausgeführt.

Ticket Check Ansible-Ergebnis
SUP-2 ssh_root_login Erfolg
SUP-6 syslog_forwarding Erfolg
SUP-7 snmp_configured Erfolg (assisted)
SUP-8 privileged_access_logging Erfolg
SUP-12 rbac_least_privilege Erfolg (User proxsecure-admin@pve)
INC-E7DE1E backup_schedule Erfolg (Cron)
SUP-4 backup_retention Bereits früher resolved

Manuell offen: SUP-5 (two_factor_enabled), SUP-13 (backup_encryption).

Erkenntnis: Ansible änderte den Host, aber der Audit-Score blieb zunächst bei 28 % — Collector las nur API mit eingeschränktem Token und ohne SSH.


Phase 6 — API-Token + SSH-Audit-Collector (15. Juni 2026)

6a) Proxmox API-Token (PVEAuditor)

Script: scripts/setup-proxmox-audit-token.sh

  • ACL PVEAuditor auf / für {PROXMOX_USER}!proxsecure-audit
  • Wird beim Deploy via deploy-docker-main.sh aufgerufen
  • Ermöglicht Lesen von Backup-Jobs, Usern, Firewall, VMs über die API

6b) SSH-Audit-Enrichment

Datei Zweck
backend/app/services/proxmox_ssh_collector.py SSH + pvesh auf dem PVE-Host
proxmox_real.py Merge API + SSH-Fakten
customer_service.py Fix: Tenant-Pfad nutzt jetzt auch SSH-Enrichment
AUDIT_SSH_ENRICHMENT_ENABLED Env-Flag (default true)

SSH liest u. a.: sshd_config, rsyslog-Forward, sudo-Audit, SNMP, Cron-Backup, User/2FA via pvesh, apt-upgradable.

Ergebnis nach Phase 6

Metrik Vorher Nachher
Compliance-Score (station-2) 28 % 71 % (10/14 PASS)
Noch FAIL 10 4 (two_factor_enabled, backup_encryption, vm_network_segmentation, vm_resource_limits)

Deploy-Workflow

# Vollständiges Deploy auf docker-main
./scripts/deploy-docker-main.sh

# Nur Env-Keys patchen (ohne Secrets zu überschreiben)
./scripts/patch-env-docker-main.sh AUDIT_SSH_ENRICHMENT_ENABLED=true

# Ansible-SSH-Key + authorized_keys auf Proxmox
./scripts/setup-ansible-ssh-docker-main.sh

# Proxmox API-Token ACL
./scripts/setup-proxmox-audit-token.sh

Nach Backend-Rebuild: docker compose restart nginx (sonst ggf. 502).


Demo-Script (Interview)

  1. Audit öffnen → Compliance-Score und FAIL-Liste
  2. Create Jira Tickets (all FAILs) → SUP-Tickets in Jira
  3. Auto-Ticket (z. B. Backup) → Operations → Break-Glass → Run Ansible → Ticket resolved
  4. Manuell-Ticket (2FA) → How-to anzeigen — kein Ansible
  5. PDF-Report herunterladen — Roadmap mit Fix-Typen

Nächste sinnvolle Schritte

  • VM-Firewall / Resource-Limits per Ansible oder PVE-API (2 verbleibende FAILs)
  • 2FA und PBS-Verschlüsselung manuell in Proxmox UI
  • Optional: dedizierten Audit-User statt cursor@pam