poc4 wit rust

This commit is contained in:
Mateusz Gruszczyński
2026-08-16 15:34:53 +02:00
parent e5d344622e
commit 40474cdc59
29 changed files with 2692 additions and 159 deletions
+18 -1
View File
@@ -37,6 +37,12 @@ class Config:
tzsp_port: int
tap_name: str
tap_mtu: int
tzsp_receiver_bin: str
tzsp_telemetry_socket: str
tzsp_rcvbuf_bytes: int
tzsp_batch_size: int
tzsp_queue_mb: int
tzsp_datagram_bytes: int
suricata_config: str
suricata_output_config: str
suricata_home_net: str
@@ -111,6 +117,12 @@ class Config:
tzsp_port=_int("TZSP_PORT", 37008),
tap_name=os.getenv("TAP_NAME", "suritap0"),
tap_mtu=_int("TAP_MTU", 9000),
tzsp_receiver_bin=os.getenv("TZSP_RECEIVER_BIN", "/usr/local/bin/mikrosuricata-tzsp"),
tzsp_telemetry_socket=os.getenv("TZSP_TELEMETRY_SOCKET", "/run/mikrosuricata/tzsp-telemetry.sock"),
tzsp_rcvbuf_bytes=max(1024 * 1024, _int("TZSP_RCVBUF_BYTES", 32 * 1024 * 1024)),
tzsp_batch_size=max(1, min(1024, _int("TZSP_BATCH_SIZE", 256))),
tzsp_queue_mb=max(8, min(512, _int("TZSP_QUEUE_MB", 64))),
tzsp_datagram_bytes=max(2048, min(65535, _int("TZSP_DATAGRAM_BYTES", 12288))),
suricata_config=os.getenv("SURICATA_CONFIG", "/etc/suricata/suricata.yaml"),
suricata_output_config=os.getenv(
"SURICATA_OUTPUT_CONFIG", "/opt/ids/suricata/ids-output.yaml"
@@ -150,7 +162,7 @@ class Config:
db_path=os.getenv("DB_PATH", "/data/ids.db"),
eve_path=os.getenv("EVE_PATH", "/data/logs/suricata/eve.json"),
suricata_log_max_mb=_int("SURICATA_LOG_MAX_MB", 512),
forensic_pcap_mode=_choice("FORENSIC_PCAP_MODE", "blocks", {"blocks", "alerts", "all", "off"}),
forensic_pcap_mode=_choice("FORENSIC_PCAP_MODE", "alerts", {"blocks", "alerts", "all", "off"}),
forensic_pcap_window_seconds=max(5, _int("FORENSIC_PCAP_WINDOW_SECONDS", 60)),
forensic_pcap_memory_mb=max(1, _int("FORENSIC_PCAP_MEMORY_MB", 64)),
forensic_pcap_max_files=max(1, _int("FORENSIC_PCAP_MAX_FILES", 32)),
@@ -213,6 +225,11 @@ class Config:
"tzsp_port": self.tzsp_port,
"tap_name": self.tap_name,
"tap_mtu": self.tap_mtu,
"tzsp_receiver_engine": "rust",
"tzsp_rcvbuf_bytes": self.tzsp_rcvbuf_bytes,
"tzsp_batch_size": self.tzsp_batch_size,
"tzsp_queue_mb": self.tzsp_queue_mb,
"tzsp_datagram_bytes": self.tzsp_datagram_bytes,
"suricata_home_net": self.suricata_home_net,
"suricata_extra_rules_glob": self.suricata_extra_rules_glob,
"web_port": self.web_port,