redborder-vortex is a high-performance, native Rust stream processing and telemetry pipeline engine with an embedded Python (pyo3) plugin runtime for redBorder NG clusters.
It directly processes declarative pipeline configurations (pipelines.yml and .conf pipeline stages) with an ultra-low memory footprint (~40 MB RSS vs. 1–4 GB on JVM runtimes) and zero JVM dependencies, achieving >200,000 events/sec per worker thread.
- Declarative Pipeline Engine & DSL Support:
- Directly loads pipeline definitions (
pipelines.yml) and executesinput {},filter {}, andoutput {}stages from configured.conffiles (10_input_*.conf,20_filter_*.conf,30_output_*.conf). - Full expression evaluator supporting nested conditionals (
if,else if,else), comparisons (==,!=,=~,!~,<,>,<=,>=), membership checks (in,not in), boolean logic (and,or,!), and[a][b][c]bracket field path resolution.
- Directly loads pipeline definitions (
- Multi-Cluster & Multi-Partition Coordination:
- Kafka Consumer Groups: Each pipeline acts as a coordinated Kafka consumer group (
group_idper pipeline), automatically balancing partition assignments across allredborder-vortexnodes in the cluster and rebalancing on node failover. - 2-Tier L1 + L2 Shared State Store: Combines a lock-free in-memory L1 cache (
DashMap) for sub-microsecond hot reads with an asynchronous L2 Redis cluster backend (redis::aio::ConnectionManager) so enrichments learned on one node/partition (e.g., RADIUS sessions, NMSP/CMX wireless location, MAC vendor mappings) are immediately available across all cluster nodes. - Distributed
rbwindowSingleton Leader Lock: Uses an atomic Redis lease (SET rb:vortex:lock:rbwindow:<sensor_id> <node_id> NX EX 30) so only the elected leader node emits periodic time-window events for a given sensor, failing over automatically within the lease TTL if the leader goes down.
- Kafka Consumer Groups: Each pipeline acts as a coordinated Kafka consumer group (
- Native Rust Filters & Embedded Python (
pyo3) Plugin SDK:- All core telemetry filters (
mutate,cidr,geoip,grok,fingerprint,drop) and custom redBorder plugins (macscrambling,macvendorsenrich,netflowenrich,radius,nmsp,location,mobility,apstate,intrusion,device_enrichment,druid_metrics,threat_intelligence,incident_enrichment) are compiled natively into Rust. - Custom
ruby { path => ... }orpython { path => ... }scripts (such asmalware,ips, andtrap) are transparently executed by an embedded Python 3 runtime viapyo3with zero-copy access toPyEventand the 2-tierPyStateStore.
- All core telemetry filters (
- Live IPC Socket & Telemetry (
redborder-monitorstyle):- Exposes a non-blocking Unix Domain Socket (
/run/redborder-vortex/redborder-vortex.sock) and CLI flags (-t/--status,-r/--reset) to inspect real-time per-pipeline throughput, event counters, drop counts, L1/L2 cache hit rates, and cluster leader state.
- Exposes a non-blocking Unix Domain Socket (
+---------------------------------------------------+
| Kafka Cluster |
| rb_flow, rb_sflow, rb_radius, rb_nmsp, rb_state |
+-------------------------+-------------------------+
|
Consumer Group Rebalance| (Partition Assignment)
+-------------------------v-------------------------+
| redborder-vortex |
| |
Unix Domain Socket | +---------------------------------------------+ |
/var/run/redborder- | | Tokio Async Pipeline Workers (per pipeline) | |
vortex.sock <-----+--> 10_input -> 20_filter (AST) -> 30_output | |
(status / reset) | +---------+-------------------------+---------+ |
| | | |
| +---------v---------+ +---------v---------+ |
| | Native Rust | | Embedded Python | |
| | Filter Engine | | Runtime (PyO3) | |
| +---------+---------+ +---------+---------+ |
| | | |
| +---------v-------------------------v---------+ |
| | L1 Cache (In-Memory DashMap) | |
| | Sub-microsecond reads & TTL expiration | |
| +----------------------+----------------------+ |
+-------------------------|-------------------------+
| L2 Read-Through / Write-Through
| + Distributed Leader Locks
+-------------------------v-------------------------+
| Redis Cluster (L2) |
| Shared Wireless / RADIUS / Flow State & Locks |
+---------------------------------------------------+
redborder-vortex uses a global daemon configuration file (/etc/redborder-vortex/config.yml) along with the standard Logstash pipeline definitions (/etc/logstash/pipelines.yml).
# redborder-vortex configuration
node_id: "auto"
pipelines_yml: "/etc/logstash/pipelines.yml"
socket_path: "/run/redborder-vortex/redborder-vortex.sock"
redis_url: "redis://127.0.0.1:6379"
python_plugins_dir: "/usr/share/redborder-vortex/plugins"
log_level: "info"
# NMSP In-Engine Triangulation (Weighted Centroid Localization without Cisco MSE/CMX)
nmsp.triangulation: false
nmsp.triangulation_min_aps: 2-
Wireless Triangulation Options:
-
nmsp.triangulation(or envVORTEX_NMSP_TRIANGULATION): Enables native multi-AP client triangulation using Weighted Centroid Localization ($w_i = 10^{\frac{\text{RSSI}_i}{20}}$ ) across APs on the same floor (default:false). -
nmsp.triangulation_min_aps(or envVORTEX_NMSP_TRIANGULATION_MIN_APS): Minimum distinct APs required on the primary floor to triangulate (default:2). When fewer APs hear the client, coordinates fall back to the primary AP location.
-
redborder-vortex reads standard Logstash pipelines.yml entries (supporting wildcard globs in path.config):
- pipeline.id: netflow
path.config: "/etc/logstash/pipelines/netflow/*.conf"
pipeline.workers: 2
pipeline.batch.size: 125
- pipeline.id: sflow
path.config: "/etc/logstash/pipelines/sflow/*.conf"
pipeline.workers: 1
- pipeline.id: rbwindow
path.config: "/etc/logstash/pipelines/rbwindow/*.conf"
pipeline.workers: 1mutate:rename,replace,add_field,remove_field,convert(integer,float,string,boolean),gsub,lowercase,uppercase,strip,split,join,merge,copy,add_tag,remove_tag.cidr: IPv4 and IPv6 CIDR block matching (address,network,network_path) withadd_field/add_tagactions.geoip: Real MaxMind.mmdbdatabase reader (maxminddb) forCityandASNlookups, with automatic fallback:- City mode: populates
[target][country_code2],[target][country_name],[target][continent_code], and[target][city_name]. - ASN mode: populates
[target][as_org]and[target][asn]. - Database resolution:
- Explicit
database => "/path/to/custom.mmdb"parameter if provided. - Environment variables
GEOIP_CITY_DB,GEOIP_ASN_DB, orGEOIP_DB. - Standard system paths:
/var/lib/GeoIP/,/usr/share/GeoIP/,/etc/logstash/(GeoLite2-City.mmdb,GeoLite2-ASN.mmdb). - Safe fallback for offline development / test environments without installed
.mmdbfiles.
- Explicit
- City mode: populates
grok: Regular expression & named pattern extraction (%{SYNTAX:SEMANTIC}).fingerprint: Deterministic hashing (SHA1,SHA256,MD5,MURMUR3) over source fields into a target field (including@metadatafor Kafka partitioning).drop: Immediate or percentage-based event dropping.json: Parse JSON strings into nested structured objects or merge keys into root event (source,target). Adds_jsonparsefailureon invalid syntax.
-
macscrambling: HMAC-SHA256 MAC address anonymization preserving the 24-bit OUI vendor prefix. -
macvendorsenrich: IEEE OUI database lookup enriching client and AP MAC vendor names. -
netflowenrich: Bidirectional NetFlow / IPFIX normalization, RFC1918 locality classification, IANA protocol resolution, and L1/L2 wireless session correlation. -
radius: Parses RADIUS Accounting (Start,Interim-Update,Stop) packets and updates shared L1/L2 client identity state (username,calling_station_id,framed_ip_address). -
nmsp: Cisco CMX / NMSP wireless telemetry enrichment (dot11_status, RSSI quality, configurableclient_profileconfidence thresholds:soft_rssi,medium_rssi, and native in-engine multi-AP Wi-Fi client triangulation via Weighted Centroid Localization without Cisco MSE/CMX hardware). -
mobility: Client movement, dwelling time, and session lifecycle tracking acrosscampus,building,floor, andzonehierarchies with configurable timers (consolidation_timer,expiration_timer,dwell_timer), continuous static device tracking (staticset to0whendwell_time <= max_dwell_timeand1whendwell_time > max_dwell_time), and sliding TTL cache policies (visitor_ttldefault 24h,probe_ttldefault 2h for unconsolidated probe MACs) to prevent memory bloat while maintaining seamless dwell history. -
location/apstate: PostgreSQL nested-set spatial hierarchy enrichment and AP operational tracking backed by the L1/L2StateStore. SeeFILTER.mdfor full configuration reference. -
intrusion: Enriches IPS / Intrusion events from the shared L1/L2StateStore(sensor-psql,wlc-psql,nmsp-measure,nmsp-info,radius,location,dwell, and-historicalfallbacks). -
device_enrichment: Dual-mode ($O(1)$) network device metadata enrichment (device_id,device_name,device_role) by endpoint asset IP/MAC (mode => "endpoint") or sensor association (mode => "sensor"), with configurable fallback, replacing static multi-thousand-line conditional rules. -
druid_metrics/threat_intelligence/incident_enrichment: Real-time telemetry normalization and IOC matching.
Custom Python plugins live in /usr/share/redborder-vortex/plugins/ (such as malware.py, ips.py, and trap.py) and implement register(params) and filter(event, state):
def register(params: dict) -> None:
# Optional one-time plugin initialization
pass
def filter(event, state=None) -> bool:
"""
Mutate `event` in-place. Return True to keep the event, or False to drop it.
`event` provides:
- event.get("[field][subfield]") -> Any
- event.set("[field][subfield]", value) -> None
- event.remove("[field]") -> Any
- event.tag("tag_name") -> None
- event.to_dict() / event.from_dict(dict)
`state` (optional PyStateStore) provides:
- state.get(namespace, key) -> Any
- state.set(namespace, key, value, ttl_secs) -> None
"""
msg_type = event.get("[type]")
if msg_type == "raw_counter":
return False # Drop event
event.set("[enrichment][processed_by]", "vortex-python")
return TrueVortex achieves seamless linear horizontal scaling across multiple nodes without race conditions or memory bloat by partitioning stateful mobility streams by client_mac.
Intermediate mobility topics (rb_location and rb_mobility) feeding stateful filters are automatically keyed by client_mac. Kafka's standard partitioner hashes all events for a given device into the same partition, guaranteeing that the exact same Vortex cluster node processes that device's lifecycle.
- Traffic topics (
rb_flow,rb_sflow, etc.): Remain unkeyed (round-robin) across all nodes. - Mobility state: Strictly localized to the node consuming that partition, eliminating concurrent write-write races and Redis Pub/Sub flooding.
Topic names and key fields are fully configurable:
- In Pipeline Output Block (
output { kafka { ... } }):message_key => "%{client_mac}": Explicit template interpolation.auto_key_topics => ["custom_location_topic"]: List of topics to automatically key by MAC.auto_key_field => "sensor_mac": Custom field to use for auto-keying (default:"client_mac").
- In Global Daemon Config (
/etc/redborder-vortex/config.ymlorpath.settings):kafka.auto_key_mac_topics: - "rb_location" - "rb_mobility" - "custom_tenant_location"
- Via Environment Variable:
export VORTEX_KAFKA_AUTO_KEY_MAC_TOPICS="rb_location,rb_mobility,custom_topic"
# Run daemon with default configuration (/etc/redborder-vortex/config.yml)
redborder-vortex
# Run daemon with explicit config file or pipeline settings directory
redborder-vortex -c /etc/redborder-vortex/config.yml
redborder-vortex --path.settings /etc/logstash
# Validate pipelines.yml and all .conf files, then exit
redborder-vortex --config.test_and_exit --path.settings /etc/logstash
# Query live status of the running daemon via Unix socket
redborder-vortex -t
redborder-vortex --status
# Reset live pipeline counters via Unix socket
redborder-vortex -r
redborder-vortex --reset
# Check cluster node identity, Redis L2 connectivity, and L1/L2 cache stats
redborder-vortex --cluster-status
# Run built-in single-core pipeline throughput benchmark
redborder-vortex --benchmarkNote on
--benchmarkvs Production Daemon:
- Production Daemon: Dynamically parses
/etc/logstash/pipelines.ymland all.confpipeline definitions generated by Chef, connecting to live Kafka and Redis clusters.--benchmark: A self-contained diagnostic tool that runs 50,000 synthetic events through representative in-memory NetFlow, sFlow, and Vault filter pipelines to benchmark raw throughput on developer or test machines without requiring installed/etc/logstashfiles, Kafka brokers, or Redis nodes.
Like redborder-monitor, external scripts or monitoring agents can query /run/redborder-vortex/redborder-vortex.sock directly over a Unix domain stream socket using plain-text commands (status, stats, or reset):
$ echo "stats" | nc -U /run/redborder-vortex/redborder-vortex.sockExample JSON response:
{
"node_id": "rb-node-01",
"uptime_secs": 8420,
"redis_connected": true,
"l1_hits": 1482910,
"l2_hits": 4219,
"misses": 312,
"pipelines": {
"netflow": {
"events_in": 942100,
"events_out": 941850,
"events_dropped": 250,
"errors": 0,
"workers": 2
},
"sflow": {
"events_in": 128400,
"events_out": 120110,
"events_dropped": 8290,
"errors": 0,
"workers": 1
}
}
}- Rust toolchain (
cargo,rustc>= 1.75) python3-devel(libpython3.9on EL9) /python3-dev(Debian/Ubuntu)openssl-devel/libssl-dev,libcurl-devel/libcurl4-openssl-dev,cmake,gcc,gcc-c++,makemockandrpm-build(for building the EL9 RPM package)
# Build release binary
make
# Run full unit and end-to-end test suite
make tests
# Run pipeline throughput benchmark
cargo run --release -- --benchmarkThe repository includes a standard redBorder packaging/rpm setup that vendors all Rust crates offline and builds a clean EL9 RPM inside a mock chroot (rocky+epel-9-x86_64):
# Build SRPM and binary RPM via mock
make rpm
# or directly:
make -C packaging/rpm rpmResulting packages are placed in packaging/rpm/pkgs/:
packaging/rpm/pkgs/redborder-vortex-<version>-1.el9.rb.src.rpmpackaging/rpm/pkgs/redborder-vortex-<version>-1.el9.rb.x86_64.rpm