From c2dbcf588c0bb25734ccea7e03dfb5687aa9aeb9 Mon Sep 17 00:00:00 2001 From: Patrick Di Fazio Date: Sat, 10 Jan 2026 20:00:33 +0100 Subject: [PATCH] added iprep to the dashboard, fixed bugs --- .gitignore | 2 +- config.yaml | 4 +- docker-compose.yaml | 6 -- src/database.py | 1 + src/exports/malicious_ips.txt | 1 - src/templates/dashboard_template.py | 153 ++++++++++++++++++++-------- 6 files changed, 112 insertions(+), 55 deletions(-) delete mode 100644 src/exports/malicious_ips.txt diff --git a/.gitignore b/.gitignore index 63ae0e9..ecc3154 100644 --- a/.gitignore +++ b/.gitignore @@ -78,4 +78,4 @@ data/ personal-values.yaml #exports dir (keeping .gitkeep so we have the dir) -/exports/* \ No newline at end of file +/exports/* diff --git a/config.yaml b/config.yaml index 52daa09..6c45617 100644 --- a/config.yaml +++ b/config.yaml @@ -1,7 +1,7 @@ # Krawl Honeypot Configuration server: - port: 5000 + port: 1234 delay: 100 # Response delay in milliseconds timezone: null # e.g., "America/New_York", "Europe/Paris" or null for system default @@ -23,7 +23,7 @@ canary: dashboard: # if set to "null" this will Auto-generates random path if not set # can be set to "/dashboard" or similar <-- note this MUST include a forward slash - secret_path: dashboard + secret_path: super-secret-dashboard-path api: server_url: null diff --git a/docker-compose.yaml b/docker-compose.yaml index 08bcec9..d8ea198 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -16,9 +16,3 @@ services: environment: - CONFIG_LOCATION=config.yaml restart: unless-stopped - healthcheck: - test: ["CMD", "python3", "-c", "import requests; requests.get('http://localhost:5000')"] - interval: 30s - timeout: 5s - retries: 3 - start_period: 10s diff --git a/src/database.py b/src/database.py index 5c96828..59d7072 100644 --- a/src/database.py +++ b/src/database.py @@ -578,6 +578,7 @@ class DatabaseManager: 'city': stat.city, 'asn': stat.asn, 'asn_org': stat.asn_org, + 'list_on': stat.list_on or {}, 'reputation_score': stat.reputation_score, 'reputation_source': stat.reputation_source, 'analyzed_metrics': stat.analyzed_metrics or {}, diff --git a/src/exports/malicious_ips.txt b/src/exports/malicious_ips.txt deleted file mode 100644 index 7b9ad53..0000000 --- a/src/exports/malicious_ips.txt +++ /dev/null @@ -1 +0,0 @@ -127.0.0.1 diff --git a/src/templates/dashboard_template.py b/src/templates/dashboard_template.py index 4e7005c..4c5a77a 100644 --- a/src/templates/dashboard_template.py +++ b/src/templates/dashboard_template.py @@ -410,6 +410,12 @@ def generate_dashboard(stats: dict, timezone: str = 'UTC', dashboard_path: str = color: #58a6ff; font-size: 13px; font-weight: 600; + }} + .timeline-header {{ + display: flex; + justify-content: space-between; + align-items: center; + gap: 10px; margin-bottom: 10px; }} .timeline {{ @@ -470,6 +476,56 @@ def generate_dashboard(stats: dict, timezone: str = 'UTC', dashboard_path: str = color: #8b949e; margin: 0 7px; }} + .reputation-container {{ + margin-top: 15px; + padding-top: 15px; + border-top: 1px solid #30363d; + }} + .reputation-title {{ + color: #58a6ff; + font-size: 13px; + font-weight: 600; + }} + .reputation-badges {{ + display: flex; + flex-wrap: wrap; + gap: 6px; + align-items: center; + }} + .reputation-badge {{ + display: inline-flex; + align-items: center; + gap: 4px; + padding: 4px 8px; + background: #161b22; + border: 1px solid #f851494d; + border-radius: 4px; + font-size: 11px; + color: #f85149; + text-decoration: none; + transition: all 0.2s; + }} + .reputation-badge:hover {{ + background: #1c2128; + border-color: #f85149; + }} + .reputation-badge-icon {{ + font-size: 12px; + }} + .reputation-clean {{ + display: inline-flex; + align-items: center; + gap: 6px; + padding: 4px 10px; + background: #161b22; + border: 1px solid #3fb9504d; + border-radius: 4px; + font-size: 11px; + color: #3fb950; + }} + .reputation-clean-icon {{ + font-size: 13px; + }} @@ -627,11 +683,9 @@ def generate_dashboard(stats: dict, timezone: str = 'UTC', dashboard_path: str =