test backend codec ndpi
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 1m40s
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 1m40s
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import asyncio
|
||||
import base64
|
||||
import json
|
||||
import logging
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
@@ -83,8 +84,16 @@ class DatabasePool:
|
||||
src_port,
|
||||
dst_port,
|
||||
length,
|
||||
raw
|
||||
) VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12)
|
||||
raw,
|
||||
app_protocol,
|
||||
app_master_protocol,
|
||||
app_category,
|
||||
app_confidence,
|
||||
app_hostname,
|
||||
app_is_encrypted,
|
||||
app_risk_score,
|
||||
dpi_metadata
|
||||
) VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20::jsonb)
|
||||
RETURNING id, timestamp
|
||||
""",
|
||||
pkt_info["iface"],
|
||||
@@ -99,6 +108,14 @@ class DatabasePool:
|
||||
pkt_info.get("dst_port"),
|
||||
pkt_info["length"],
|
||||
pkt_info["raw"],
|
||||
pkt_info.get("app_protocol"),
|
||||
pkt_info.get("app_master_protocol"),
|
||||
pkt_info.get("app_category"),
|
||||
pkt_info.get("app_confidence"),
|
||||
pkt_info.get("app_hostname"),
|
||||
pkt_info.get("app_is_encrypted"),
|
||||
pkt_info.get("app_risk_score"),
|
||||
json.dumps(pkt_info.get("dpi_metadata")) if pkt_info.get("dpi_metadata") is not None else None,
|
||||
)
|
||||
except Exception:
|
||||
logger.exception("DB insert failed")
|
||||
|
||||
Reference in New Issue
Block a user