diff --git a/infra/debug-dashboard/.env.example b/infra/debug-dashboard/.env.example index df441f1..d2884e5 100644 --- a/infra/debug-dashboard/.env.example +++ b/infra/debug-dashboard/.env.example @@ -3,6 +3,4 @@ DB_PORT=5432 DB_NAME=ocsentinel DB_USER=ocsentinel_debug DB_PASSWORD=replace-with-server-generated-password -DASHBOARD_USER=ocsentinel-debug -DASHBOARD_PASSWORD=replace-with-server-generated-password DASHBOARD_CSRF_SECRET=replace-with-server-generated-secret diff --git a/infra/debug-dashboard/app.py b/infra/debug-dashboard/app.py index 9d16e52..f1b13f6 100644 --- a/infra/debug-dashboard/app.py +++ b/infra/debug-dashboard/app.py @@ -2,10 +2,9 @@ import hashlib import hmac import json import os -from functools import wraps import psycopg -from flask import Flask, Response, abort, redirect, render_template, request, url_for +from flask import Flask, abort, redirect, render_template, request, url_for app = Flask(__name__) @@ -22,20 +21,6 @@ def db_connection(): ) -def requires_auth(view): - @wraps(view) - def wrapped(*args, **kwargs): - auth = __import__("flask").request.authorization - expected_user = os.environ["DASHBOARD_USER"] - expected_password = os.environ["DASHBOARD_PASSWORD"] - valid = auth and hmac.compare_digest(auth.username or "", expected_user) and hmac.compare_digest(auth.password or "", expected_password) - if not valid: - return Response("Authentication required", 401, {"WWW-Authenticate": 'Basic realm="OCSentinel Debug"'}) - return view(*args, **kwargs) - - return wrapped - - def csrf_token(): secret = os.environ["DASHBOARD_CSRF_SECRET"].encode("utf-8") return hmac.new(secret, b"recipient-rules", hashlib.sha256).hexdigest() @@ -48,7 +33,6 @@ def require_csrf(): @app.get("/") -@requires_auth def overview(): with db_connection() as connection, connection.cursor() as cursor: cursor.execute("SELECT * FROM ocsentinel.organization_summary") @@ -85,7 +69,6 @@ def overview(): @app.get("/device/") -@requires_auth def device(machine_name): with db_connection() as connection, connection.cursor() as cursor: cursor.execute( @@ -108,7 +91,6 @@ def device(machine_name): @app.get("/reports") -@requires_auth def reports(): with db_connection() as connection, connection.cursor() as cursor: cursor.execute( @@ -126,7 +108,6 @@ def reports(): @app.get("/reports/") -@requires_auth def weekly_report(report_id): with db_connection() as connection, connection.cursor() as cursor: cursor.execute( @@ -147,7 +128,6 @@ def weekly_report(report_id): @app.get("/recipients") -@requires_auth def recipients(): with db_connection() as connection, connection.cursor() as cursor: cursor.execute( @@ -173,7 +153,6 @@ def recipients(): @app.post("/recipients") -@requires_auth def add_recipient(): require_csrf() organization_id = request.form.get("organization_id", "").strip() @@ -198,7 +177,6 @@ def add_recipient(): @app.post("/recipients//toggle") -@requires_auth def toggle_recipient(rule_id): require_csrf() with db_connection() as connection, connection.cursor() as cursor: @@ -211,7 +189,6 @@ def toggle_recipient(rule_id): @app.post("/recipients//delete") -@requires_auth def delete_recipient(rule_id): require_csrf() with db_connection() as connection, connection.cursor() as cursor: diff --git a/infra/debug-dashboard/templates/base.html b/infra/debug-dashboard/templates/base.html index 19ce49d..ed95589 100644 --- a/infra/debug-dashboard/templates/base.html +++ b/infra/debug-dashboard/templates/base.html @@ -3,13 +3,12 @@ - {% block title %}OCSentinel Debug{% endblock %} + {% block title %}OC Sentinel{% endblock %}
- OC Sentinel - +
{% block content %}{% endblock %}
diff --git a/infra/debug-dashboard/templates/device.html b/infra/debug-dashboard/templates/device.html index e3a079e..4113041 100644 --- a/infra/debug-dashboard/templates/device.html +++ b/infra/debug-dashboard/templates/device.html @@ -1,7 +1,7 @@ {% extends "base.html" %} -{% block title %}{{ report[0] }} - OCSentinel{% endblock %} +{% block title %}{{ report[0] }} - OC Sentinel{% endblock %} {% block content %} -

Geraetedetails

{{ report[0] }}

{{ report[6] }} | Letzte Datenmeldung: {{ report[5] }}

+

{{ report[0] }}

{{ report[6] }}
Ereignisse{{ report[8] }}
Quell-IPs{{ report[9] }}
CVEs{{ report[10] }}
Kritische CVEs{{ report[11] }}
-

Technische Details

Signierter Sicherheitsbericht

Unveraenderte Rohdaten zur Nachvollziehbarkeit und Fehleranalyse.

{{ payload_pretty }}
+
{{ payload_pretty }}
{% endblock %} diff --git a/infra/debug-dashboard/templates/overview.html b/infra/debug-dashboard/templates/overview.html index b8f5930..d2678cc 100644 --- a/infra/debug-dashboard/templates/overview.html +++ b/infra/debug-dashboard/templates/overview.html @@ -1,28 +1,21 @@ {% extends "base.html" %} {% block content %} -
-

OCSentinel Sicherheitszentrale

-

OfficeCom Sentinal Übersicht

-

Aktuelle Auswertung aller signierten Sicherheitsberichte aus den betreuten Organisationen.

-
Zentraler Ueberblick ueber Geraete, Ereignisse und Handlungsbedarf
-
-
-

Aktuelle Lage

{% if summary[2] %}Kritische Ereignisse erfordern Aufmerksamkeit.{% elif summary[1] %}Hinweise vorhanden - bitte auffaellige Geraete pruefen.{% else %}Keine kritischen Auffaelligkeiten gemeldet.{% endif %}
+
{% if summary[2] %}Kritische Ereignisse{% elif summary[1] %}Hinweise vorhanden{% else %}Keine kritischen Auffaelligkeiten{% endif %}
{% if summary[2] %}KRITISCH{% elif summary[1] %}PRUEFEN{% else %}STABIL{% endif %}
-
Geraete mit Bericht{{ summary[0] }}
+
Geraete{{ summary[0] }}
Warnungen{{ summary[1] }}
-
Kritische Geraete{{ summary[2] }}
-
Erkannte Ereignisse{{ summary[3] }}
-
Letzte Datenmeldung{{ summary[7] or 'noch keine Daten' }}
+
Kritisch{{ summary[2] }}
+
Ereignisse{{ summary[3] }}
+
Letzte Meldung{{ summary[7] or '-' }}
{% if alerts %}
-

Handlungsbedarf

Auffaellige Geraete

Diese Geraete haben zuletzt Warnungen oder kritische Sicherheitsereignisse gemeldet.

+

Auffaellige Geraete

{% for alert in alerts %} @@ -31,13 +24,11 @@ {% endfor %}
-{% else %} -

Handlungsbedarf

Keine auffaelligen Geraete

Die zuletzt eingegangenen Berichte enthalten keine Warnungen oder kritischen Ereignisse.

{% endif %}
-

Berichtsbestand

Aktuelle Geraetestatus

Jede Zeile zeigt den letzten erfolgreich uebermittelten OCSentinel-Bericht eines Geraets.

+

Geraetestatus

- {% for row in reports %}{% else %}{% endfor %}
GeraetOrganisationStatusEreignisseQuell-IPsEmpfangen
{{ row[0] }}{{ row[1] or '-' }}{{ row[3] }}{{ row[4] }}{{ row[5] }}{{ row[2] or '-' }}
Noch keine Geraeteberichte vorhanden.
+ {% for row in reports %}
{{ row[0] }}{{ row[1] or '-' }}{{ row[3] }}{{ row[4] }}{{ row[5] }}{{ row[2] or '-' }}{% else %}Keine Geraeteberichte.{% endfor %}
{% endblock %} diff --git a/infra/debug-dashboard/templates/recipients.html b/infra/debug-dashboard/templates/recipients.html index 5bc18f5..d46d23a 100644 --- a/infra/debug-dashboard/templates/recipients.html +++ b/infra/debug-dashboard/templates/recipients.html @@ -1,19 +1,17 @@ {% extends "base.html" %} -{% block title %}Berichtsempfaenger - OCSentinel{% endblock %} +{% block title %}Empfaenger - OC Sentinel{% endblock %} {% block content %} -

Wochenberichte

Berichtsempfaenger

Diese Regeln bestimmen, wer den Wochenbericht einer Organisation per E-Mail erhaelt.

- -

Neue Regel

Empfaenger hinzufuegen

+

Empfaenger hinzufuegen

- +
-

Aktive Regeln

E-Mail-Verteiler

"Alle Organisationen" wird zu jedem organisationsspezifischen Verteiler hinzugefuegt.

+

E-Mail-Verteiler

-{% for rule in rules %}{% else %}{% endfor %} +{% for rule in rules %}{% else %}{% endfor %}
OrganisationE-Mail-AdresseStatusAktion
{{ rule[2] }}{{ rule[3] }}{{ 'aktiv' if rule[4] else 'pausiert' }}
Noch keine Empfaengerregeln angelegt.
{{ rule[2] }}{{ rule[3] }}{{ 'aktiv' if rule[4] else 'pausiert' }}
Keine Empfaengerregeln.
{% endblock %} diff --git a/infra/debug-dashboard/templates/reports.html b/infra/debug-dashboard/templates/reports.html index 8e508a5..d1b5894 100644 --- a/infra/debug-dashboard/templates/reports.html +++ b/infra/debug-dashboard/templates/reports.html @@ -1,8 +1,7 @@ {% extends "base.html" %} -{% block title %}Wochenberichte - OCSentinel Debug{% endblock %} +{% block title %}Berichte - OC Sentinel{% endblock %} {% block content %} -

Archiv

Wochenberichte

Je Organisation automatisch durch n8n erzeugt.

-{% for row in reports %}{% else %}{% endfor %} +{% for row in reports %}{% else %}{% endfor %}
OrganisationZeitraumGeraeteWarnungKritischEventsErstellt
{{ row[1] }}{{ row[2] }} bis {{ row[3] }}{{ row[5] }}{{ row[6] }}{{ row[7] }}{{ row[8] }}{{ row[4] }}
Noch keine Wochenberichte erzeugt.
{{ row[1] }}{{ row[2] }} bis {{ row[3] }}{{ row[5] }}{{ row[6] }}{{ row[7] }}{{ row[8] }}{{ row[4] }}
Keine Wochenberichte.
{% endblock %}