🛡️ 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.

📦 Package Available

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.

Installation

Add the crate to your Cargo.toml or run via CLI:

Terminal
cargo add cybervault-sdk --features full

Or install with minimal footprint:

Cargo.toml
[dependencies]
cybervault-sdk = { version = "0.8.2", features = ["threat-scanner", "reqwest"] }

Quick Start

Initialize the client and run a baseline threat assessment:

Rust
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

Rust
// 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.

Rust
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);
        }
    }
}
⚠️ Beta Notice

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

Feedback & Issues

Found a bug or have a feature request? We actively maintain this SDK on GitHub.

Generated for CyberVault Rust SDK v0.8.2-beta | Back to Dashboard