๐ง Stixflayer ๐ฆ
Rust-native STIX 2.1 engine. One spec-compliant core, consumed by many.
Performance ๐โก
stixflayer uses a single Rust core for validation and serialization, so you get native Rust throughput from every language binding.
| Operation | stix2-validator |
stixflayer |
speedup |
|---|---|---|---|
Parse + validate apt1 bundle |
~47 ms | ~1.6 ms | ~30ร ๐๏ธ๐จ |
Parse + validate poisonivy bundle |
~99 ms | ~2.3 ms | ~40ร ๐๏ธ๐จ |
| Operation | stix2 |
stixflayer |
speedup |
|---|---|---|---|
Serialize apt1 bundle back to JSON |
~0.6 ms | ~0.06 ms | ~10ร ๐๏ธ๐จ |
Serialize poisonivy bundle back to JSON |
~1.0 ms | ~0.09 ms | ~12ร ๐๏ธ๐จ |
See benchmarks/BENCHMARKING.md for
the harness, fixtures, and how to reproduce the numbers.
Credits ๐
Stixflayer is deeply indebted to OASIS CTI's cti-rust-stix, the official STIX 2.1 reference implementation in Rust. This project's object model, validation behavior, and pattern grammar all build on that foundation โ it is the starting point from which the stixflayer engine grew, and we are grateful for the rigor and generosity of that work.
We also benchmark against, and owe a debt of comparison to, cti-stix-validator, the industry-standard Python validator.
Why another STIX library? ๐ค
- One engine, no validation gaps ๐: Most STIX libraries are reimplemented per-language, which creates subtle interoperability bugs โ the same document can be valid in one language and rejected in another. stixflayer solves this by shipping a single Rust core into every supported language: data validates the same way everywhere.
- Battle-tested, but faster โ๏ธ: Built from the official OASIS reference
implementation, with full parity (and then some) against the industry-standard
cti-stix-validator. Same trusted spec compliance, rewritten in Rust for speed, correctness, and interoperability. - Stricter where it matters ๐ง: Actively improves on
stix2validatorby enforcing rules it skips โ rejecting empty bundles, invalid vocabulary values, and incorrect SCO UUIDv5 hashes.
Languages ๐
| Language | Status | Binding |
|---|---|---|
| Rust | โ๏ธ๐ First release coming soon | Native |
| Python | ๐๐ First release coming soon | Native (pyo3) |
| TypeScript | ๐ง๐ ๏ธ Next up | napi.rs |
| Go, Java, and more | ๐งช๐ ๏ธ Planned | WASM + Extism |
Python and Rust ship first; TypeScript is next. Native bindings mean native Rust performance when validating STIX ๐ฆพ
Quick Start ๐ก๏ธ
The published packages are coming soon. Until then, install from source:
Examples
๐ Full documentation is coming soon. Until then, here are the most common things you can do with the Python bindings today.
Parse and validate a STIX bundle:
=
# number of objects
# live Python wrappers, not raw dicts
Build an SDO:
=
Catch structured validation errors:
# [{'kind': 'missing_property', 'message': "...", 'property': 'name'}]
Validate a STIX pattern:
Serialize back to JSON:
=
Structure ๐ฐ
rust/ Core engine (Rust crate + pyo3 bindings + derive macros)
src/ Python package (stixflayer)
tests/ Python test suite
benchmarks/ Speed benchmarks vs stix2-validator (see BENCHMARKING.md)
testdata/ STIX fixtures used by tests and benchmarks
Development ๐ ๏ธ
Python quality gates:
Rust quality gates:
Type stubs policy: the public entry points (stixflayer/__init__.pyi,
stixflayer/stixflayer.pyi) are fully typed so IDEs and type checkers resolve
the whole public API. Stubs cover the public surface only โ we don't maintain
.pyi files for internals. When the compiled surface changes, update the
stubs in the same change.
License ๐
BSD-3-Clause. Community-driven, in the spirit of STIX interoperability. โ๏ธ๐ก๏ธ