| Crates.io | cynapse |
| lib.rs | cynapse |
| version | 0.1.0 |
| created_at | 2025-10-16 10:36:00.810157+00 |
| updated_at | 2025-10-16 10:36:00.810157+00 |
| description | Real-time, memory-resident binary integrity verification for Rust applications |
| homepage | https://gitlab.com/TIVisionOSS/crates/cynapse |
| repository | https://gitlab.com/TIVisionOSS/crates/cynapse |
| max_upload_size | |
| id | 1885726 |
| size | 177,328 |
Real-time, memory-resident binary integrity verification for Rust applications.
Cynapse continuously validates executable memory segments to detect runtime injection, tampering, or in-memory patching — providing a self-defending layer for secure, high-assurance software.
Modern attacks often target live memory: code injection, API hooking, shellcode placement, or silent function patching. Cynapse is a Rust crate designed to detect and mitigate in-memory tampering at runtime.
It works by mapping the executable memory regions of a process, computing a Merkle-tree-based checksum baseline, and continuously verifying page integrity while your application runs. If any deviation is found, Cynapse can alert, self-heal, or terminate the process depending on configuration.
r-xp, .text, .plt, etc.) across Linux, Windows, and macOS.SIGSEGV, SIGTRAP, access violations).mmap, VirtualQuery, and /proc/self/maps.unsafe sections for direct memory access; fully audited and documented.Add Cynapse to your Cargo.toml:
[dependencies]
cynapse = "0.1"
For additional features:
[dependencies]
cynapse = { version = "0.1", features = ["forensics", "remote-attestation"] }
use cynapse::Monitor;
use std::time::Duration;
fn main() {
let mut monitor = Monitor::new()
.with_interval(Duration::from_secs(3))
.on_tamper(|segment, diff| {
eprintln!(
"[ALERT] Tampering detected in segment {:?}",
segment
);
});
monitor.start();
// Your application logic continues...
loop {
std::thread::sleep(Duration::from_secs(1));
}
}
use cynapse::{Monitor, TamperResponse, WhitelistPolicy};
use std::time::Duration;
fn main() {
let monitor = Monitor::builder()
.interval(Duration::from_secs(2))
.enable_merkle_trees(true)
.adaptive_sampling(true)
.whitelist_jit_regions(WhitelistPolicy::ByPattern(vec![
".jit".to_string(),
".v8".to_string(),
]))
.enable_forensics(true)
.on_tamper(|segment, diff| {
log::error!("Integrity violation: {:?}", segment);
TamperResponse::Alert
})
.build()
.expect("Failed to initialize monitor");
monitor.start();
}
| Threat Type | Detected | Mitigated | Notes |
|---|---|---|---|
| Code Injection / Patching | ✅ | ✅ | Detected via page checksum mismatch |
| Inline Hooking | ✅ | ⚠️ | May detect depending on page granularity |
| DLL / SO Injection | ✅ | ✅ | Identified by new executable mappings |
| JIT / Self-modifying Code | ⚙️ | ⚙️ | Allowed if whitelisted |
| ROP / Shellcode | ✅ | ✅ | Detected through execution region tampering |
| Memory Scraping | ❌ | ❌ | Cynapse is defensive, not concealment-oriented |
| TOCTOU Attacks | ⚠️ | ⚠️ | Limited by sampling interval |
| Feature | Description | Default |
|---|---|---|
blake3-hash |
Use BLAKE3 hashing algorithm | ✅ |
sha256-hash |
Use SHA-256 hashing algorithm | ❌ |
merkle |
Enable Merkle tree optimization | ❌ |
forensics |
Enable forensic snapshot capabilities | ❌ |
remote-attestation |
Enable cryptographic attestation proofs | ❌ |
kernel-assist |
Enable kernel-level monitoring (Linux eBPF) | ❌ |
| Platform | Status | Notes |
|---|---|---|
| Linux | ✅ | Full support via /proc/self/maps |
| Windows | ✅ | Full support via VirtualQuery |
| macOS | ✅ | Full support via Mach kernel APIs |
# Clone the repository
git clone https://gitlab.com/TIVisionOSS/crates/cynapse.git
cd cynapse
# Run tests
cargo test
# Run with features
cargo test --all-features
# Run benchmarks
cargo bench
# Build documentation
cargo doc --no-deps --open
# Run examples
cargo run --example self_protect
Dual-licensed under Apache-2.0 OR MIT — choose either.
Developed for the Rust security ecosystem by Tonmoy Infrastructure & Vision OSS.
Contributions are welcome! Please see our CONTRIBUTING.md for guidelines.
For security-sensitive issues, please refer to our Security Policy for responsible disclosure procedures.
Built with ❤️ for the Rust security community.