🛡️ Rust SDK v0.8.2-beta
Official Rust client for the CyberVault Security Platform. Async-first, zero-allocation threat scanning, and full compliance workflow support.
The crate is published on crates.io as cybervault-sdk. Requires Rust 1.75+.
Overview
The CyberVault Rust SDK provides a type-safe, async-first interface to our entire security ecosystem. It's designed for high-performance threat ingestion, real-time incident response, and automated compliance reporting directly from your Rust applications.
- ⚡ Async-first with full
tokioandasync-stdsupport - 🔒 Zero-trust auth with automatic token rotation & mTLS
- 📊 Streaming endpoints for real-time threat feeds via websockets
- 🧩 Modular features - only include what you need to reduce binary size
Installation
Add the crate to your Cargo.toml or run via CLI:
cargo add cybervault-sdk --features full
Or install with minimal footprint:
[dependencies]
cybervault-sdk = { version = "0.8.2", features = ["threat-scanner", "reqwest"] }
Quick Start
Initialize the client and run a baseline threat assessment:
use cybervault_sdk::{Client, Auth, Config};
use std::env;
#[tokio::main]async fn main() -> Result<(), cybervault_sdk::Error> {
// Load credentials from environment
let api_key = env::var("CYBERVAULT_API_KEY")
.expect("CYBERVAULT_API_KEY must be set");
let client = Client::new(Config::default()
.auth(Auth::from_api_key(api_key)))
.await?;
// Run a quick threat scan on your network
let report = client
.threats()
.scan("10.0.0.0/24")
.depth(ScanDepth::Deep)
.send()
.await?;
println!("Found {} critical threats", report.critical_count());
Ok(())
}
Core API Reference
The SDK is split into three primary modules. Each is opt-in via Cargo features.
| Module | Feature Flag | Description |
|---|---|---|
ThreatClient |
threat-scanner |
Network scanning, signature matching, AI threat classification |
IncidentAPI |
incident-response |
Breach containment, forensic logs, automated playbooks |
ComplianceClient |
compliance |
SOC 2, ISO 27001, GDPR audit trails & auto-remediation |
ThreatClient Usage
// Stream real-time threat alerts via WebSockets
let mut stream = client
.threats()
.subscribe(AlertLevel::High)
.await?;
while let Some(alert) = stream.next().await {
println!("[{}] {} - {}",
alert.timestamp(),
alert.severity(),
alert.summary()
);
// Auto-contain if ransomware signature detected
if alert.matches_pattern("ransomware.*") {
client.incidents().auto_contain(alert.source_ip).await;
}
}
Error Handling
All SDK methods return the unified cybervault_sdk::Error enum, which implements std::error::Error and Send + Sync + 'static.
match client.threats().scan("example.com").await {
Ok(report) => println!("Scan complete"),
Err(e) => {
if e.is_timeout() {
// Retry logic
} else if e.is_auth_failed() {
// Rotate credentials
} else {
eprintln!("SDK Error: {}", e);
}
}
}
Version 0.8.x is pre-1.0. Breaking changes may occur between minor releases. We recommend using version constraints like "^0.8.0" and monitoring the changelog.
Beta Notes & Roadmap
- ✅ Async streaming threat feeds
- ✅ Full mTLS & zero-trust auth
- 🔄 In Progress: Offline threat signature caching
- 📅 Q3 2025: Native WebAssembly target for browser-side scanning
- 📅 Q4 2025: 1.0 Stable Release
Feedback & Issues
Found a bug or have a feature request? We actively maintain this SDK on GitHub.
- 🐛 Report Issues: github.com/cybervault/sdk-rust/issues
- 💬 Discussions: github.com/cybervault/sdk-rust/discussions
- 📖 Full Docs: docs.cybervault.dev/rust