Refactor: Remove NFStream and flow identity utilities; introduce Tshark manager
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 11s

- Deleted flow_identity.py and nfstream_flow_worker.py as they are no longer needed.
- Removed nfstream_manager.py and its associated logic for managing NFStream workers.
- Added tshark_manager.py to manage tshark packet enrichment and matching.
- Updated setup_build_server.sh to include default environment variables for tshark.
- Implemented packet signature generation and enrichment logic in the new TsharkManager class.
This commit is contained in:
2026-03-07 19:51:29 +01:00
parent dfad09fa21
commit 22bb6b8526
11 changed files with 603 additions and 695 deletions

View File

@@ -11,6 +11,7 @@ BACKEND_DIR="$APP_DIR/backend"
BACKEND_SERVICE="mitm-backend"
NGINX_SITE="/etc/nginx/sites-available/mitm-webserver"
USER_ROOT="root"
BACKEND_ENV_FILE="$BACKEND_DIR/.env"
GITEA_RUNNER_URL="https://gitea.malmert.de//api/v1/repos/marcus/mitm-webserver/actions/runners/register"
RUNNER_TOKEN="cThC2xmAZWaOAqRRMENuVVTJckxaHiJxVGx2NCQY"
@@ -24,11 +25,11 @@ PYTHON_VERSION="3" # aktuelle Python 3 Version
# -----------------------------
echo "==> Update & Upgrade"
apt update && apt upgrade -y
apt install -y git curl build-essential nginx python3 python3-pip python3-venv unzip wget python3-dev \
DEBIAN_FRONTEND=noninteractive apt install -y git curl build-essential nginx python3 python3-pip python3-venv unzip wget python3-dev \
libpcap-dev autoconf automake libtool pkg-config libjson-c-dev gettext flex bison libnuma-dev \
libpcre2-dev libmaxminddb-dev librrd-dev python3-bpfcc bpfcc-tools linux-headers-generic \
libpcre2-dev libmaxminddb-dev librrd-dev python3-bpfcc bpfcc-tools linux-headers-generic tshark \
clang llvm libelf-dev libbpf-dev iproute2
apt install -y linux-headers-$(uname -r) || apt install -y linux-headers-generic
DEBIAN_FRONTEND=noninteractive apt install -y linux-headers-$(uname -r) || DEBIAN_FRONTEND=noninteractive apt install -y linux-headers-generic
# -----------------------------
# Node.js installieren (LTS)
@@ -70,6 +71,19 @@ cd "$BACKEND_DIR"
pip install -r requirements.txt
deactivate
# -----------------------------
# Backend Environment Defaults
# -----------------------------
echo "==> Write backend environment defaults"
cat >"$BACKEND_ENV_FILE" <<EOL
BACKEND_TSHARK_ENABLED=true
BACKEND_TSHARK_DISPLAY_FILTER=http or tls or dns
BACKEND_TSHARK_CACHE_TTL_SECONDS=5.0
BACKEND_TSHARK_MATCH_WINDOW_MS=1500
BACKEND_TSHARK_READER_JOIN_TIMEOUT_SECONDS=2.0
BACKEND_TSHARK_PROCESS_STOP_TIMEOUT_SECONDS=3.0
EOL
# -----------------------------
# Systemd Service für Backend
# -----------------------------