repowiseoisf/suricata

Architecture of oisf/suricata

oisf/suricata is 1,680 source files holding 33,027 symbols across 13 modules, written mainly in C, C++, Rust. The largest module is src, with 1,202 files, and 15 files are entry points into the dependency graph.

How suricata fits together

Live network traffic and analysis inputs such as signatures and protocol parsers enter the engine. The core work happens in the src directory, where the C Engine Core turns engine runtime events into detection and alert outcomes. The rust directory holds the Rust code, including application-layer protocol code such as rust/src/http2/http2.rs. The examples/lib/simple/main.c entry point shows how the engine is used from C, and examples/plugins/altemplate/src/lib.rs is a Rust plugin template. The ebpf directory contains C eBPF programs for filters and bypass behavior, and the scripts directory holds tooling that checks distribution rules and documentation keywords. Output consists of alerts, events and related NSM telemetry for operators and downstream automation.

Largest modules

  • src: 1,202 files and 303,407 lines of code
  • rust: 319 files and 107,077 lines of code
  • scripts: 23 files and 2,870 lines of code
  • qa: 22 files and 2,404 lines of code
  • examples: 18 files and 1,578 lines of code
  • plugins: 13 files and 3,728 lines of code
  • ebpf: 10 files and 1,935 lines of code
  • doc: 3 files and 144 lines of code

Languages

By file count: C 646 files, C++ 590 files, Rust 325 files, Shell 35 files, Python 18 files, Dockerfile 1 file.

Documentation

Repowise documents suricata in 3,355 pages generated from the source, 28 of them written explanations of the repository and its modules. Module guides include:

  • rust/src/bittorrent_dht: BitTorrent DHT Detection
  • src: C Engine Core
  • qa/coccinelle: Coccinelle Structure Flags

More on suricata: summary and FAQ, codebase overview, code health.

Related guide: Best dependency graph tools for monorepos