Content is user-generated and unverified.

Variants Security Suite - Technical Architecture Specification

Version: 1.1.0
Status: Enhanced with Real-World Threat Analysis
Target Platform: Windows 10/11 (x64), Linux (kernel 5.15+)
Last Updated: 2026-01-17


Table of Contents

  1. Executive Summary
  2. System Architecture
  3. Component Specifications
  4. Security Model
  5. API Contracts
  6. Performance Requirements
  7. Deployment Strategy
  8. Testing & Quality Assurance
  9. Risk Mitigation
  10. Appendix
  11. Competitive Analysis

1. Executive Summary

1.1 Project Overview

Variants is a next-generation endpoint security suite employing kernel-level debugging (DBG), Abstract Syntax Tree (AST) analysis, SAT constraint solving, and cloud-powered threat intelligence. The system provides superior threat prevention through:

  • Kernel Debugging Mode: Direct kernel interrupt interception for driver-level attack prevention
  • Copy-on-Write (CoW) Isolation: Transaction-based file system protection with instant rollback
  • AST + SAT Analysis: Deep semantic understanding of malware behavior without signature dependency
  • Cloud Threat Intelligence: Real-time 0-day detection via distributed feature extraction and vector similarity search
  • Recovery OS: Bootable forensic and repair environment with SAT-based integrity verification

1.2 Core Components

ComponentPurposePlatform
VariantsTerminalSecEndpoint protection agentWindows, Linux
VariantsThreatCloudCloud analysis & threat intelligenceCloudflare Workers + DO PostgreSQL
VariantsRecoveryOSEmergency recovery environmentArch Linux (bootable)

1.3 Competitive Advantages

  • Industry-First DBG-based Driver Conflict Resolution: Kernel debugging to prevent and resolve driver conflicts at interrupt level
  • Academic-Grade Analysis: LLVM lifting + O3 optimization + Triton symbolic execution + Satellite SAT solver
  • Perfect Rollback: CoW + MVCC transaction system ensures zero data loss from malware
  • Offline-Capable: Full detection and prevention without cloud dependency
  • Open Core: Engine open-source (Rust), driver closed-source for security

2. System Architecture

2.1 High-Level Architecture

┌─────────────────────────────────────────────────────────────────┐
│                          User Space                              │
├─────────────────────────────────────────────────────────────────┤
│  ┌──────────────────┐         ┌─────────────────────────────┐  │
│  │  Variants UI     │◄────────┤  Protected Applications     │  │
│  │  (Tauri + Vite)  │         │  (Monitored via DBG)        │  │
│  └────────┬─────────┘         └──────────────┬──────────────┘  │
│           │                                    │                 │
│           │ IPC                                │ All I/O         │
│           ▼                                    ▼                 │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │         Variants Engine (User-mode Service)              │   │
│  │  - AST Analysis Coordinator                              │   │
│  │  - Cloud Sync Manager                                    │   │
│  │  - YARA Rule Engine                                      │   │
│  │  - User Prompt Handler                                   │   │
│  └────────┬──────────────────────────────────────────────┬──┘   │
│           │                                               │      │
└───────────┼───────────────────────────────────────────────┼──────┘
            │ IOCTL                                         │ HTTPS
┌───────────▼───────────────────────────────────────────────┼──────┐
│                        Kernel Space                        │      │
├────────────────────────────────────────────────────────────┤      │
│  ┌───────────────────────────────────────────────────┐    │      │
│  │  Variants Kernel Driver (variants.sys)             │    │      │
│  │  ┌─────────────────┐  ┌────────────────────────┐  │    │      │
│  │  │ DBG Session Mgr │  │ CoW File System Filter │  │    │      │
│  │  │ (Kernel Debug)  │  │ (Minifilter FltMgr)    │  │    │      │
│  │  └────────┬────────┘  └──────────┬─────────────┘  │    │      │
│  │           │                      │                 │    │      │
│  │           │    ┌─────────────────▼──────────────┐  │    │      │
│  │           │    │  MVCC Transaction Manager      │  │    │      │
│  │           │    │  - Shadow Buffer Pool          │  │    │      │
│  │           │    │  - Async Commit Queue          │  │    │      │
│  │           │    └────────────────────────────────┘  │    │      │
│  │           │                                         │    │      │
│  │  ┌────────▼─────────────────────────────────────┐  │    │      │
│  │  │  Interrupt & Syscall Interceptor              │  │    │      │
│  │  │  - INT 13h Hook (MBR/GPT Protection)          │  │    │      │
│  │  │  - IRP_MJ_* Hooks (File/Registry/Network)     │  │    │      │
│  │  │  - PsSetLoadImageNotifyRoutine (Driver Load)  │  │    │      │
│  │  └────────────────────────────────────────────────┘  │    │      │
│  └───────────────────────────────────────────────────────┘    │      │
└────────────────────────────────────────────────────────────────┘      │
                                                                         │
            ┌────────────────────────────────────────────────────────────┘
            │
┌───────────▼──────────────────────────────────────────────────────┐
│                   VariantsThreatCloud                             │
│                  (Cloudflare Infrastructure)                      │
├───────────────────────────────────────────────────────────────────┤
│  ┌────────────────────┐       ┌──────────────────────────────┐   │
│  │ Workers (Hono.js)  │◄──────┤ Durable Objects              │   │
│  │ - File Upload API  │       │ - Analysis Session Manager   │   │
│  │ - Query Endpoint   │       │ - Real-time Event Aggregator │   │
│  │ - Rule Sync API    │       └──────────────┬───────────────┘   │
│  └─────────┬──────────┘                      │                   │
│            │                                 │                   │
│            ▼                                 ▼                   │
│  ┌───────────────────────────────────────────────────────────┐  │
│  │      PostgreSQL (DigitalOcean Managed)                     │  │
│  │  - malware_signatures (LSH indexed)                        │  │
│  │  - clean_signatures                                        │  │
│  │  - threat_events (time-series)                             │  │
│  │  - endpoint_registry                                       │  │
│  └───────────────────────────────────────────────────────────┘  │
└───────────────────────────────────────────────────────────────────┘

2.2 Data Flow

2.2.1 File Execution Flow (Primary Path)

1. User double-clicks suspicious.exe
   ↓
2. Kernel intercepts CreateProcess → PsSetCreateProcessNotifyRoutineEx callback
   ↓
3. DBG Session Manager attaches kernel debug session to new process
   ↓
4. CoW Filter creates shadow buffer for process isolation
   ↓
5. Process executes, all I/O intercepted:
   - File writes → Shadow buffer
   - Registry sets → Shadow registry
   - Network sends → Captured for analysis
   ↓
6. [PARALLEL] User-mode engine triggered:
   - Extract executable to temp location
   - LLVM lift binary to IR
   - Run O3 optimization passes
   - Triton symbolic execution on critical paths
   - Generate 400-dim behavior vector
   ↓
7. [ASYNC] Cloud query:
   - Upload behavior vector + AST hash
   - PostgreSQL LSH similarity search
   - YARA rule matching
   - Return threat score (0.0-1.0)
   ↓
8. [DECISION POINT]
   - Score < 0.3: Allow, commit shadow buffer on exit
   - Score 0.3-0.7: Freeze process, prompt user (blue overlay + modal)
   - Score > 0.7: Immediate freeze, full-screen Turnstile verification
   ↓
9. If malicious confirmed:
   - Terminate process tree
   - Discard shadow buffer (MVCC rollback)
   - Upload full execution trace to ThreatCloud
   ↓
10. If benign:
    - Commit shadow buffer to disk
    - Upload clean signature to ThreatCloud

2.2.2 Driver Load Flow (Boot & Runtime)

Boot-time (ELAM):
1. UEFI Secure Boot → VariantsBootGuard.efi
   ↓
2. Enumerate all BOOT_START drivers queued for load
   ↓
3. For each driver:
   - Verify signature (EV certificate)
   - Check certificate revocation (OCSP - cached offline)
   - Compute SHA256 hash
   - Match against local whitelist
   ↓
4. Unknown driver found:
   - Block load
   - Log to recovery partition
   - (Cannot upload - no network yet)
   ↓
5. If all drivers trusted → Boot continues

Runtime:
1. NtLoadDriver syscall intercepted
   ↓
2. DBG freezes caller process
   ↓
3. Extract driver binary
   ↓
4. [LOCAL] Static analysis:
   - PE header validation
   - Import table inspection (suspicious APIs?)
   - Entropy calculation (packed?)
   ↓
5. [CLOUD] Upload driver hash + metadata
   - Check ThreatCloud certificate database
   - Query for known malicious drivers
   ↓
6. Decision:
   - Trusted cert + clean hash → Allow
   - Unknown → Prompt user with driver details
   - Malicious → Block + alert

2.3 Component Communication

2.3.1 Kernel ↔ User-mode

Protocol: Fast IOCTL via shared memory ring buffer

c
// Shared memory layout
struct VariantsSharedMemory {
    uint64_t magic;              // 0x5641524941544E53 ("VARIANTS")
    uint32_t kernel_write_index;
    uint32_t user_read_index;
    uint32_t user_write_index;
    uint32_t kernel_read_index;
    
    // Ring buffer for kernel → user events
    struct Event k2u_buffer[4096];
    
    // Ring buffer for user → kernel commands
    struct Command u2k_buffer[1024];
};

// Event types (kernel → user)
enum EventType {
    EVENT_PROCESS_START = 1,
    EVENT_FILE_WRITE = 2,
    EVENT_REGISTRY_SET = 3,
    EVENT_NETWORK_CONNECT = 4,
    EVENT_DRIVER_LOAD = 5,
    EVENT_THREAT_DETECTED = 6,
};

// Command types (user → kernel)
enum CommandType {
    CMD_ALLOW_PROCESS = 1,
    CMD_DENY_PROCESS = 2,
    CMD_FREEZE_PROCESS = 3,
    CMD_COMMIT_SHADOW = 4,
    CMD_ROLLBACK_SHADOW = 5,
};

2.3.2 Client ↔ ThreatCloud

Protocol: HTTPS REST + WebSocket (for real-time updates)

Endpoints:

  • POST /v1/analyze/file - Upload file for analysis
  • POST /v1/analyze/behavior - Submit behavior vector
  • GET /v1/rules/hot - Fetch hot YARA rules
  • POST /v1/report/clean - Report clean execution
  • POST /v1/report/threat - Report threat detection
  • WS /v1/stream - Real-time threat feed

Authentication: Ed25519 signature per request

Authorization: Variants-Sig v1,client=<client_id>,ts=<timestamp>,sig=<ed25519_sig>

3. Component Specifications

3.1 VariantsTerminalSec (Windows)

3.1.1 Kernel Driver (variants.sys)

Language: Rust (windows-kernel-rs)
Target: Kernel-Mode Driver Framework (KMDF)
Load Type: BOOT_START (for ELAM)

Key Modules:

DBG Session Manager
rust
pub struct DbgSessionManager {
    sessions: HashMap<ProcessId, KernelDebugSession>,
    global_breakpoints: Vec<BreakpointDescriptor>,
}

pub struct KernelDebugSession {
    pid: ProcessId,
    debug_handle: HANDLE,
    breakpoints: Vec<usize>,  // Addresses
    state: SessionState,
}

pub enum SessionState {
    Active,
    Frozen,      // User decision pending
    Terminated,
}

impl DbgSessionManager {
    /// Attach kernel debug session on process creation
    /// Called from PsSetCreateProcessNotifyRoutineEx callback
    pub unsafe fn attach_on_create(&mut self, process: PEPROCESS) -> Result<()>;
    
    /// Set breakpoint on critical syscalls (NtWriteFile, NtSetValueKey, etc.)
    pub unsafe fn set_syscall_breakpoints(&mut self, pid: ProcessId) -> Result<()>;
    
    /// Handle breakpoint hit (invoked by kernel debugger callback)
    pub unsafe fn on_breakpoint(&mut self, context: &CONTEXT, pid: ProcessId) -> Action;
    
    /// Freeze process (suspend all threads + remove from scheduler)
    pub unsafe fn freeze_process_tree(&mut self, pid: ProcessId) -> Result<()>;
    
    /// Force terminate process
    pub unsafe fn terminate_process(&mut self, pid: ProcessId) -> Result<()>;
}
CoW File System Filter
rust
pub struct CowFilter {
    shadow_buffers: HashMap<ProcessId, ShadowBuffer>,
    mvcc_manager: MvccTransactionManager,
}

pub struct ShadowBuffer {
    pid: ProcessId,
    file_shadows: HashMap<PathBuf, FileShadow>,
    registry_shadows: HashMap<RegistryKey, RegistryValue>,
    total_size_bytes: usize,
}

pub struct FileShadow {
    original_path: PathBuf,
    shadow_data: Vec<u8>,  // In-memory for files < 10MB
    shadow_file: Option<PathBuf>,  // On-disk cache for large files
    dirty_pages: BitVec,   // Page-level COW tracking
}

impl CowFilter {
    /// Minifilter pre-operation callback for IRP_MJ_CREATE
    pub unsafe extern "C" fn pre_create(
        data: PFLT_CALLBACK_DATA,
        flt_objects: PCFLT_RELATED_OBJECTS,
        completion_context: *mut PVOID,
    ) -> FLT_PREOP_CALLBACK_STATUS;
    
    /// Intercept file write
    pub unsafe extern "C" fn pre_write(
        data: PFLT_CALLBACK_DATA,
        flt_objects: PCFLT_RELATED_OBJECTS,
        completion_context: *mut PVOID,
    ) -> FLT_PREOP_CALLBACK_STATUS;
    
    /// Commit shadow buffer to disk (transaction commit)
    pub unsafe fn commit_shadow(&mut self, pid: ProcessId) -> Result<()>;
    
    /// Discard shadow buffer (transaction rollback)
    pub unsafe fn rollback_shadow(&mut self, pid: ProcessId) -> Result<()>;
}
MBR/GPT Protection
rust
pub struct PartitionTableProtector {
    protected_sectors: Vec<SectorRange>,
    original_int13_handler: Option<usize>,
}

impl PartitionTableProtector {
    /// Hook INT 13h BIOS interrupt
    pub unsafe fn hook_int13(&mut self) -> Result<()>;
    
    /// Hook IRP_MJ_WRITE for disk devices
    pub unsafe fn hook_disk_write(&mut self) -> Result<()>;
    
    /// Check if sector is critical (MBR, GPT, backup GPT)
    pub fn is_critical_sector(&self, sector: u64) -> bool;
    
    /// Validate write request against trusted tool list
    pub fn validate_partition_write(&self, caller_pid: ProcessId, sector: u64) -> Action;
}

pub enum Action {
    Allow,
    Deny,
    PromptUser,
}

3.1.2 User-Mode Engine

Language: Rust
Architecture: Multi-threaded async service

Key Components:

AST Analysis Engine
rust
pub struct AstAnalyzer {
    llvm_context: LLVMContext,
    triton_ctx: TritonContext,
    sat_solver: satellite_kit::Solver,
}

impl AstAnalyzer {
    /// Lift binary to LLVM IR
    pub async fn lift_binary(&self, binary_path: &Path) -> Result<Module>;
    
    /// Run O3 optimization passes
    pub async fn optimize_ir(&self, module: &mut Module) -> Result<()>;
    
    /// Symbolic execution on critical paths
    pub async fn symbolic_execute(&self, module: &Module) -> Result<ExecutionPaths>;
    
    /// Extract behavior vector (400 dimensions)
    pub async fn extract_features(&self, paths: &ExecutionPaths) -> Result<BehaviorVector>;
    
    /// SAT constraint solving for threat verification
    /// Example: Can this program damage MBR?
    pub async fn verify_threat_potential(&self, module: &Module) -> Result<ThreatScore>;
}

pub struct BehaviorVector {
    api_calls: Vec<f32>,           // 0-99: API call frequency
    cfg_features: Vec<f32>,        // 100-149: Control flow complexity
    data_flow: Vec<f32>,           // 150-199: Data flow patterns
    runtime_behavior: Vec<f32>,    // 200-299: Dynamic behavior
    static_features: Vec<f32>,     // 300-399: PE header, entropy, etc.
}
Cloud Sync Manager
rust
pub struct CloudSyncManager {
    client: reqwest::Client,
    endpoint: Url,
    client_id: Uuid,
    ed25519_keypair: Ed25519KeyPair,
    hot_rules: Arc<RwLock<Vec<YaraRule>>>,
}

impl CloudSyncManager {
    /// Upload behavior vector for analysis
    pub async fn analyze_behavior(&self, vector: &BehaviorVector) -> Result<ThreatScore>;
    
    /// Report clean execution
    pub async fn report_clean(&self, vector: &BehaviorVector, metadata: Metadata) -> Result<()>;
    
    /// Report threat detection
    pub async fn report_threat(&self, 
        vector: &BehaviorVector, 
        exec_trace: ExecutionTrace,
        iocs: Vec<IoC>
    ) -> Result<()>;
    
    /// Sync hot YARA rules (every 5 minutes)
    pub async fn sync_hot_rules(&self) -> Result<()>;
    
    /// Sign request with Ed25519
    fn sign_request(&self, body: &[u8], timestamp: u64) -> Signature;
}
User Prompt Handler
rust
pub enum PromptLevel {
    Standard,     // Blue overlay + modal
    Critical,     // Full-screen + Turnstile
    Emergency,    // System freeze + Turnstile
}

pub struct PromptHandler {
    ui_channel: UnboundedSender<PromptRequest>,
}

pub struct PromptRequest {
    level: PromptLevel,
    process_info: ProcessInfo,
    threat_details: ThreatDetails,
    response_tx: oneshot::Sender<UserDecision>,
}

pub enum UserDecision {
    Allow,
    Deny,
    Quarantine,  // Freeze + upload for analysis
}

impl PromptHandler {
    /// Standard prompt: Blue overlay on process window
    pub async fn prompt_standard(&self, req: PromptRequest) -> Result<UserDecision>;
    
    /// Critical prompt: Full-screen with Turnstile verification
    pub async fn prompt_critical(&self, req: PromptRequest) -> Result<UserDecision>;
    
    /// Emergency prompt: Freeze entire system
    pub async fn prompt_emergency(&self, req: PromptRequest) -> Result<UserDecision>;
}

3.1.3 UI Application (Tauri)

Tech Stack: Tauri 2.0 + Vite + React + shadcn/ui

Features:

  • Real-time threat monitoring dashboard
  • Process whitelist/blacklist management
  • Shadow buffer statistics
  • Cloud sync status
  • Threat event timeline
  • Settings panel

3.2 VariantsTerminalSec (Linux)

3.2.1 Kernel Module (variants.ko)

Language: Rust (rust-for-linux)
Target: Linux kernel 5.15+

Key Differences from Windows:

  • Use ptrace for process monitoring (no kernel-level DBG equivalent)
  • Hook syscalls via kprobe/kretprobe
  • eBPF for high-performance event filtering
  • Overlay filesystem for CoW (similar to Docker)

Module Structure:

rust
// variants-linux/src/lib.rs

#[no_mangle]
pub extern "C" fn init_module() -> i32 {
    // Register kprobes for syscalls
    register_kprobe("sys_execve", on_execve_enter);
    register_kprobe("sys_write", on_write_enter);
    register_kprobe("sys_open", on_open_enter);
    
    // Initialize OverlayFS for CoW
    init_overlay_manager();
    
    0
}

fn on_execve_enter(regs: &pt_regs) -> i32 {
    let filename = get_user_string(regs.rdi);
    let pid = current_pid();
    
    // Attach ptrace to new process
    attach_monitor(pid);
    
    // Create overlay mount for this process
    create_process_overlay(pid);
    
    0
}

3.2.2 User-mode Daemon

Similar to Windows, but with Linux-specific adjustments:

  • systemd service integration
  • D-Bus for UI communication
  • Wayland/X11 protocol for window overlay
  • TTY hijacking for console prompts

TTY Prompt Example:

variants: Suspicious activity detected from ./malware.elf (PID 1234)

Threat Details:
- Attempted to write to /boot/grub/grub.cfg
- Opened raw disk device /dev/sda
- Network connection to known C2 server (45.67.89.10)

[Y]es (allow) / [N]o (block) / [A]nalysis (upload to cloud): _

3.3 VariantsThreatCloud

3.3.1 Cloudflare Workers (Hono.js)

typescript
// workers/src/index.ts

import { Hono } from 'hono';
import { z } from 'zod';

const app = new Hono<{ Bindings: Env }>();

// Request schemas
const BehaviorVectorSchema = z.object({
  vector: z.array(z.number()).length(400),
  metadata: z.object({
    sha256: z.string(),
    pe_timestamp: z.number().optional(),
    file_size: z.number(),
  }),
});

app.post('/v1/analyze/behavior', async (c) => {
  const body = await c.req.json();
  const { vector, metadata } = BehaviorVectorSchema.parse(body);
  
  // Verify signature
  const sig = c.req.header('Authorization');
  if (!verifyEd25519Signature(sig, body, c.env.TRUSTED_CLIENTS)) {
    return c.json({ error: 'Invalid signature' }, 401);
  }
  
  // Query PostgreSQL with LSH
  const db = c.env.DB;
  const lshBuckets = computeLSH(vector);
  
  const candidates = await db.prepare(`
    SELECT signature_id, feature_vector, threat_family, severity
    FROM malware_signatures
    WHERE lsh_bucket IN (${lshBuckets.map(() => '?').join(',')})
    LIMIT 100
  `).bind(...lshBuckets).all();
  
  // Compute exact similarities in-memory
  const similarities = candidates.results.map(row => ({
    id: row.signature_id,
    similarity: cosineSimilarity(vector, row.feature_vector),
    family: row.threat_family,
    severity: row.severity,
  })).filter(s => s.similarity > 0.85)
    .sort((a, b) => b.similarity - a.similarity)
    .slice(0, 10);
  
  // Compute threat score
  const threatScore = computeThreatScore(similarities);
  
  return c.json({
    threat_score: threatScore,
    matches: similarities,
  });
});

app.post('/v1/report/clean', async (c) => {
  const { vector, metadata } = await c.req.json();
  
  const featureHash = sha256(JSON.stringify(vector));
  
  await c.env.DB.prepare(`
    INSERT INTO clean_signatures (feature_hash, feature_vector, metadata, hit_count)
    VALUES (?, ?, ?, 1)
    ON CONFLICT (feature_hash) 
    DO UPDATE SET hit_count = hit_count + 1, last_seen = NOW()
  `).bind(featureHash, JSON.stringify(vector), JSON.stringify(metadata)).run();
  
  return c.json({ ok: true });
});

export default app;

3.3.2 Durable Objects

typescript
// workers/src/analysis-session.ts

export class AnalysisSession extends DurableObject {
  async analyzeFile(fileData: ArrayBuffer, metadata: Metadata): Promise<AnalysisResult> {
    // 1. YARA scanning
    const yaraMatches = await this.yaraMatch(fileData);
    
    // 2. Static analysis
    const staticFeatures = extractStaticFeatures(fileData);
    
    // 3. Query threat database
    const dbMatches = await this.queryThreatDB(staticFeatures.hash);
    
    // 4. If unknown, queue for deep analysis
    if (dbMatches.length === 0 && staticFeatures.suspicious) {
      await this.queueDeepAnalysis(fileData, metadata);
    }
    
    return {
      threat_level: computeThreatLevel(yaraMatches, dbMatches, staticFeatures),
      details: { yaraMatches, dbMatches, staticFeatures },
    };
  }
  
  private async queueDeepAnalysis(fileData: ArrayBuffer, metadata: Metadata) {
    // Store in R2 for batch processing
    await this.env.R2_BUCKET.put(
      `pending-analysis/${metadata.sha256}`,
      fileData,
      { customMetadata: metadata }
    );
  }
}

3.3.3 PostgreSQL Schema

sql
-- malware_signatures table
CREATE TABLE malware_signatures (
  signature_id SERIAL PRIMARY KEY,
  signature_hash TEXT UNIQUE NOT NULL,
  feature_vector JSONB NOT NULL,  -- 400-dim vector
  lsh_bucket INTEGER[] NOT NULL,  -- LSH hash buckets for fast filtering
  threat_family TEXT,
  severity INTEGER CHECK (severity BETWEEN 1 AND 10),
  first_seen TIMESTAMP DEFAULT NOW(),
  last_seen TIMESTAMP DEFAULT NOW(),
  hit_count INTEGER DEFAULT 0,
  false_positive_rate FLOAT DEFAULT 0.0,
  
  -- Metadata
  api_calls TEXT[],
  iocs JSONB,
  yara_rules TEXT[]
);

-- Indexes
CREATE INDEX idx_lsh_bucket ON malware_signatures USING GIN (lsh_bucket);
CREATE INDEX idx_threat_family ON malware_signatures (threat_family);
CREATE INDEX idx_severity ON malware_signatures (severity DESC);

-- clean_signatures table
CREATE TABLE clean_signatures (
  id SERIAL PRIMARY KEY,
  feature_hash TEXT UNIQUE NOT NULL,
  feature_vector JSONB NOT NULL,
  metadata JSONB,
  hit_count INTEGER DEFAULT 0,
  first_seen TIMESTAMP DEFAULT NOW(),
  last_seen TIMESTAMP DEFAULT NOW()
);

CREATE INDEX idx_clean_hash ON clean_signatures (feature_hash);

-- threat_events (time-series)
CREATE TABLE threat_events (
  event_id BIGSERIAL PRIMARY KEY,
  client_id UUID NOT NULL,
  timestamp TIMESTAMP DEFAULT NOW(),
  event_type TEXT NOT NULL,
  threat_score FLOAT,
  process_name TEXT,
  process_pid INTEGER,
  file_hash TEXT,
  network_iocs JSONB,
  execution_trace JSONB
);

CREATE INDEX idx_client_time ON threat_events (client_id, timestamp DESC);
CREATE INDEX idx_threat_score ON threat_events (threat_score DESC) WHERE threat_score > 0.7;

-- endpoint_registry
CREATE TABLE endpoint_registry (
  client_id UUID PRIMARY KEY,
  hostname TEXT,
  os_version TEXT,
  variants_version TEXT,
  public_key_ed25519 TEXT NOT NULL,
  first_seen TIMESTAMP DEFAULT NOW(),
  last_heartbeat TIMESTAMP DEFAULT NOW(),
  status TEXT DEFAULT 'active'
);

-- Scheduled cleanup job (every 24h)
CREATE OR REPLACE FUNCTION evict_bad_signatures() RETURNS void AS $$
BEGIN
  -- Remove high false-positive rate signatures
  DELETE FROM malware_signatures WHERE false_positive_rate > 0.3;
  
  -- Remove signatures overlapping with clean signatures
  DELETE FROM malware_signatures m
  WHERE EXISTS (
    SELECT 1 FROM clean_signatures c
    WHERE (m.feature_vector::jsonb) = (c.feature_vector::jsonb)
  );
  
  -- Remove low-hit signatures older than 30 days
  DELETE FROM malware_signatures
  WHERE hit_count = 0 AND first_seen < NOW() - INTERVAL '30 days';
END;
$$ LANGUAGE plpgsql;

3.4 VariantsRecoveryOS

3.4.1 Base System

Distribution: Arch Linux (minimal)
Size Target: < 200MB ISO
Bootloader: GRUB2 (signed with MOK via Shim)

Included Components:

  • Linux kernel 6.x
  • systemd
  • BusyBox (fallback)
  • Filesystem tools (e2fsprogs, ntfs-3g, xfsprogs)
  • Network stack (for cloud verification)
  • Variants analysis tools

3.4.2 SAT Integrity Verifier

rust
// recovery-tools/src/sat_verifier.rs

use satellite_kit::Solver;

pub struct SystemIntegrityVerifier {
    solver: Solver,
}

impl SystemIntegrityVerifier {
    pub fn verify_mbr(&mut self, device: &Path) -> Result<bool> {
        let mbr = std::fs::read(device)?[..512].to_vec();
        
        // Encode MBR constraints as SAT problem
        let sig_valid = self.solver.bool_var();
        let part_valid = (0..4).map(|_| self.solver.bool_var()).collect::<Vec<_>>();
        let code_valid = self.solver.bool_var();
        
        // Constraint 1: Boot signature must be 0x55AA
        if u16::from_le_bytes([mbr[510], mbr[511]]) == 0x55AA {
            self.solver.add_clause(vec![sig_valid.positive_lit()]);
        } else {
            self.solver.add_clause(vec![sig_valid.negative_lit()]);
        }
        
        // Constraint 2: Partition table entries valid
        for (i, var) in part_valid.iter().enumerate() {
            let offset = 446 + i * 16;
            let entry = &mbr[offset..offset + 16];
            
            if self.is_valid_partition_entry(entry) {
                self.solver.add_clause(vec![var.positive_lit()]);
            } else {
                self.solver.add_clause(vec![var.negative_lit()]);
            }
        }
        
        // Constraint 3: Boot code reasonable (entropy check)
        let boot_code = &mbr[0..446];
        if self.is_reasonable_boot_code(boot_code) {
            self.solver.add_clause(vec![code_valid.positive_lit()]);
        } else {
            self.solver.add_clause(vec![code_valid.negative_lit()]);
        }
        
        // All constraints must be satisfied
        self.solver.add_clause(vec![sig_valid.positive_lit()]);
        for var in &part_valid {
            self.solver.add_clause(vec![var.positive_lit()]);
        }
        self.solver.add_clause(vec![code_valid.positive_lit()]);
        
        // Solve
        match self.solver.solve()? {
            SatResult::Sat(_) => Ok(true),
            SatResult::Unsat => Ok(false),
            _ => Err(anyhow!("Cannot determine MBR validity")),
        }
    }
    
    fn is_valid_partition_entry(&self, entry: &[u8]) -> bool {
        // Check partition type, CHS/LBA values, etc.
        let part_type = entry[4];
        if part_type == 0 {
            return true; // Empty entry is valid
        }
        
        let start_lba = u32::from_le_bytes(entry[8..12].try_into().unwrap());
        let num_sectors = u32::from_le_bytes(entry[12..16].try_into().unwrap());
        
        start_lba > 0 && num_sectors > 0
    }
    
    fn is_reasonable_boot_code(&self, code: &[u8]) -> bool {
        let all_zeros = code.iter().all(|&b| b == 0);
        let all_ff = code.iter().all(|&b| b == 0xFF);
        
        if all_zeros || all_ff {
            return false;
        }
        
        // Entropy check
        let entropy = calculate_entropy(code);
        entropy > 3.0 && entropy < 7.5
    }
}

3.4.3 Linux Rootkit Detection (Enhanced)

Strategy: Mount infected system in chroot jail, scan with isolated tools

bash
#!/bin/bash
# variants-recovery/linux-rootkit-deep-scan.sh

echo "=== Variants Linux Rootkit Scanner ==="

INFECTED_ROOT="/mnt/infected"
CLEAN_ROOT="/recovery/clean-debian"

# 1. Mount the infected system (read-only)
echo "[1] Mounting infected system..."
mount -o ro /dev/sda1 "$INFECTED_ROOT"

# 2. Setup chroot environment with clean tools
echo "[2] Setting up isolated scanning environment..."
mkdir -p "$INFECTED_ROOT/variants-scan"
mount --bind "$CLEAN_ROOT" "$INFECTED_ROOT/variants-scan/clean"

# 3. Run chrootkit from CLEAN environment
echo "[3] Running chrootkit scan..."
chroot "$INFECTED_ROOT/variants-scan/clean" /bin/bash -c "
    chrootkit -r $INFECTED_ROOT > /tmp/chrootkit-report.txt
"

# 4. Additional checks with static binaries
echo "[4] Running additional checks..."

# Check for replaced system commands
CRITICAL_BINS=(
    "/bin/ps"
    "/bin/netstat"
    "/usr/bin/ss"
    "/bin/ls"
    "/usr/bin/top"
    "/usr/bin/lsof"
)

for bin in "${CRITICAL_BINS[@]}"; do
    if [ -f "$INFECTED_ROOT$bin" ]; then
        # Compare with known-good hash
        ACTUAL_HASH=$(sha256sum "$INFECTED_ROOT$bin" | cut -d' ' -f1)
        EXPECTED_HASH=$(grep "$(basename $bin)" /recovery/hashes/debian-11.txt | cut -d' ' -f1)
        
        if [ "$ACTUAL_HASH" != "$EXPECTED_HASH" ]; then
            echo "  [!] TAMPERED: $bin"
            echo "      Expected: $EXPECTED_HASH"
            echo "      Actual:   $ACTUAL_HASH"
            
            # Upload to ThreatCloud
            cp "$INFECTED_ROOT$bin" "/tmp/suspicious-$(basename $bin)"
            ./variants-cloud-upload "/tmp/suspicious-$(basename $bin)"
        fi
    fi
done

# 5. Check for hidden systemd services (like tmuxinfo10b4e87d)
echo "[5] Scanning systemd services..."
find "$INFECTED_ROOT/etc/systemd/system" -name "*.service" | while read svc; do
    SERVICE_NAME=$(basename "$svc")
    
    # Check if service name is random/suspicious
    if [[ "$SERVICE_NAME" =~ ^[a-f0-9]{12,}\.service$ ]]; then
        echo "  [!] SUSPICIOUS SERVICE: $SERVICE_NAME"
        cat "$svc"
        
        # Extract ExecStart binary
        EXEC=$(grep "ExecStart=" "$svc" | cut -d'=' -f2 | awk '{print $1}')
        if [ -n "$EXEC" ]; then
            echo "      Analyzing binary: $EXEC"
            
            # Upload for analysis
            if [ -f "$INFECTED_ROOT$EXEC" ]; then
                cp "$INFECTED_ROOT$EXEC" "/tmp/suspicious-service-$(basename $EXEC)"
                ./variants-cloud-upload "/tmp/suspicious-service-$(basename $EXEC)"
            fi
        fi
    fi
done

# 6. Check for LD_PRELOAD hooks
echo "[6] Checking LD_PRELOAD..."
if [ -f "$INFECTED_ROOT/etc/ld.so.preload" ]; then
    echo "  [!] LD_PRELOAD FOUND (VERY SUSPICIOUS)"
    cat "$INFECTED_ROOT/etc/ld.so.preload"
    
    # Analyze preloaded libraries
    while read lib; do
        if [ -f "$INFECTED_ROOT$lib" ]; then
            echo "      Uploading: $lib"
            cp "$INFECTED_ROOT$lib" "/tmp/ld-preload-$(basename $lib)"
            ./variants-cloud-upload "/tmp/ld-preload-$(basename $lib)"
        fi
    done < "$INFECTED_ROOT/etc/ld.so.preload"
fi

# 7. Kernel module check
echo "[7] Checking kernel modules..."
MODULES_DIR="$INFECTED_ROOT/lib/modules/$(uname -r)/kernel"
if [ -d "$MODULES_DIR" ]; then
    find "$MODULES_DIR" -name "*.ko" | while read mod; do
        # Check signature
        if ! modinfo "$mod" | grep -q "sig_key.*Linux kernel"; then
            echo "  [!] UNSIGNED MODULE: $mod"
            
            # Upload
            cp "$mod" "/tmp/unsigned-$(basename $mod)"
            ./variants-cloud-upload "/tmp/unsigned-$(basename $mod)"
        fi
    done
fi

# 8. Check libc6 integrity (critical!)
echo "[8] Verifying libc6..."
LIBC_PATH=$(find "$INFECTED_ROOT/lib" -name "libc.so.6" | head -1)
if [ -n "$LIBC_PATH" ]; then
    LIBC_HASH=$(sha256sum "$LIBC_PATH" | cut -d' ' -f1)
    EXPECTED_LIBC=$(grep "libc.so.6" /recovery/hashes/debian-11.txt | cut -d' ' -f1)
    
    if [ "$LIBC_HASH" != "$EXPECTED_LIBC" ]; then
        echo "  [!] CRITICAL: libc6 IS INFECTED!"
        echo "      This is a severe rootkit infection"
        echo "      Uploading for analysis..."
        
        cp "$LIBC_PATH" "/tmp/infected-libc.so.6"
        ./variants-cloud-upload "/tmp/infected-libc.so.6"
    fi
fi

# 9. Generate report
echo "[9] Generating final report..."
cat > /tmp/linux-rootkit-report.json <<EOF
{
  "scan_date": "$(date -Iseconds)",
  "infected_system": "$INFECTED_ROOT",
  "chrootkit_findings": $(cat /tmp/chrootkit-report.txt | jq -Rs .),
  "tampered_binaries": [
$(find /tmp/suspicious-* 2>/dev/null | jq -Rs 'split("\n") | map(select(length > 0))')
  ],
  "suspicious_services": [
    // ... parsed from systemd scan
  ],
  "severity": "critical"
}
EOF

echo "[*] Scan complete. Report: /tmp/linux-rootkit-report.json"
echo ""
echo "Next steps:"
echo "  1. Review report"
echo "  2. Replace tampered binaries from clean backup"
echo "  3. Remove malicious systemd services"
echo "  4. Reinstall libc6 if infected"
echo "  5. Reboot and re-scan"

Cloud Integration:

rust
// variants-cloud-upload (static binary)
async fn upload_suspicious_file(path: &Path) -> Result<()> {
    let file_data = std::fs::read(path)?;
    let file_hash = sha256(&file_data);
    
    // Upload to ThreatCloud
    let client = reqwest::Client::new();
    let response = client.post("https://threatcloud.variants.security/v1/analyze/linux-sample")
        .header("Content-Type", "application/octet-stream")
        .header("X-File-Hash", &file_hash)
        .header("X-File-Name", path.file_name().unwrap().to_str().unwrap())
        .body(file_data)
        .send()
        .await?;
    
    let analysis: AnalysisResult = response.json().await?;
    
    println!("Analysis result:");
    println!("  Threat score: {}", analysis.threat_score);
    println!("  Family: {:?}", analysis.threat_family);
    
    Ok(())
}

4. Security Model

4.1 Threat Model

Adversary Capabilities:

  • Kernel-level rootkit with driver signing certificate
  • Advanced persistent threat (APT) with 0-day exploits
  • Ransomware with anti-analysis techniques
  • Fileless malware (PowerShell, WMI)
  • Supply chain attacks (compromised drivers)

Attack Vectors Defended:

  1. MBR/GPT overwrite - INT 13h hook + IRP_MJ_WRITE interception
  2. Driver-level rootkit - DBG-based driver load interception
  3. Process injection - DBG breakpoint on VirtualAllocEx/WriteProcessMemory
  4. Fileless attacks - PowerShell/WMI monitoring with DBG
  5. TrustedInstaller privilege escalation - Token duplication monitoring
  6. SSDT/IDT/GDT hooking - Periodic integrity checks
  7. Ransomware - CoW isolation prevents data loss
  8. Driver conflicts - Kernel debug priority resolution

4.2 Trust Boundaries

┌─────────────────────────────────────────────┐
│           Untrusted Zone                     │
│  - All user applications                     │
│  - Unknown drivers (pre-validation)          │
│  - Network input                             │
└──────────────┬──────────────────────────────┘
               │
               ▼ DBG Monitoring + CoW Isolation
┌──────────────────────────────────────────────┐
│        Monitored Zone                         │
│  - Applications under DBG session             │
│  - Shadow buffer environment                  │
└──────────────┬───────────────────────────────┘
               │
               ▼ Signature Verification
┌──────────────────────────────────────────────┐
│         Trusted Zone                          │
│  - Microsoft-signed binaries                  │
│  - ThreatCloud whitelisted certificates       │
│  - Variants components (self)                 │
└───────────────────────────────────────────────┘

4.3 Self-Protection Mechanisms

4.3.1 PowerShell Watchdog (Anti-Certificate-Blacklist)

Rationale: PowerShell is signed by Microsoft. Even advanced malware like Silver Fox won't blacklist Microsoft certificates (would break the entire OS).

powershell
# variants-watchdog.ps1
# This script runs continuously to monitor and restore Variants
# Signed by Microsoft, immune to certificate blacklisting

$ErrorActionPreference = "Stop"

function Test-VariantsHealth {
    # 1. Check if main service is running
    $service = Get-Service -Name "VariantsEngine" -ErrorAction SilentlyContinue
    if (-not $service -or $service.Status -ne "Running") {
        Write-Warning "VariantsEngine service not running!"
        return $false
    }
    
    # 2. Check if driver is loaded
    $driver = Get-WmiObject Win32_SystemDriver | Where-Object { $_.Name -eq "Variants" }
    if (-not $driver -or $driver.State -ne "Running") {
        Write-Warning "Variants driver not loaded!"
        return $false
    }
    
    # 3. Check communication channel
    $testFile = "$env:TEMP\variants-health-check.tmp"
    "test" | Out-File $testFile
    
    try {
        # Try to communicate with driver
        $result = & "$env:ProgramFiles\Variants\VariantsCLI.exe" test-comm
        if ($result -ne "OK") {
            Write-Warning "Driver communication failed!"
            return $false
        }
    } finally {
        Remove-Item $testFile -ErrorAction SilentlyContinue
    }
    
    return $true
}

function Restore-CodeIntegrityPolicy {
    # Check if certificate policies have been tampered
    $cipPath = "$env:SystemRoot\System32\CodeIntegrity\Active\cip"
    $backupPath = "$env:ProgramFiles\Variants\Backup\cip.backup"
    
    if (Test-Path $cipPath) {
        $currentHash = (Get-FileHash $cipPath -Algorithm SHA256).Hash
        $expectedHash = (Get-Content "$env:ProgramFiles\Variants\Backup\cip.hash")
        
        if ($currentHash -ne $expectedHash) {
            Write-Warning "CodeIntegrity policy TAMPERED! Restoring..."
            
            # Restore from backup
            Copy-Item $backupPath $cipPath -Force
            
            # Force policy reload
            & bcdedit /set {current} testsigning off
            & bcdedit /set {current} testsigning on
            
            Write-Host "Policy restored. System needs reboot."
            return $false
        }
    }
    
    return $true
}

function Trigger-EmergencyRecovery {
    param([string]$Reason)
    
    Write-Warning "=== EMERGENCY: Triggering Recovery OS ==="
    Write-Warning "Reason: $Reason"
    
    # 1. Set next boot to Recovery OS
    & bcdedit /set "{variants-recovery}" /d "Variants Recovery OS" /application bootsector
    & bcdedit /bootsequence "{variants-recovery}"
    
    # 2. Write emergency log
    $logPath = "C:\Windows\Temp\variants-emergency.log"
    @"
Timestamp: $(Get-Date -Format "yyyy-MM-dd HH:mm:ss")
Reason: $Reason
Watchdog PID: $PID
System Info: $(Get-WmiObject Win32_OperatingSystem | Select-Object Caption, Version, BuildNumber)
"@ | Out-File $logPath -Encoding UTF8
    
    # 3. Reboot immediately
    Write-Warning "System will reboot in 10 seconds..."
    Start-Sleep -Seconds 10
    Restart-Computer -Force
}

# Main monitoring loop
Write-Host "Variants PowerShell Watchdog started (PID: $PID)"
Write-Host "Monitoring interval: 5 seconds"

while ($true) {
    try {
        # Health check
        $healthy = Test-VariantsHealth
        
        if (-not $healthy) {
            Write-Warning "Health check FAILED!"
            
            # Try to restart service
            Write-Host "Attempting to restart VariantsEngine service..."
            Restart-Service -Name "VariantsEngine" -ErrorAction Stop
            
            Start-Sleep -Seconds 5
            
            # Check again
            if (-not (Test-VariantsHealth)) {
                # Still failed - emergency recovery
                Trigger-EmergencyRecovery "Service restart failed"
            }
        }
        
        # Certificate policy check
        $policyOK = Restore-CodeIntegrityPolicy
        if (-not $policyOK) {
            Trigger-EmergencyRecovery "Certificate policy tampered and restore requires reboot"
        }
        
    } catch {
        Write-Error "Watchdog error: $_"
        # Continue monitoring even if error occurs
    }
    
    Start-Sleep -Seconds 5
}

Deployment:

  • Runs as scheduled task with SYSTEM privileges
  • Multiple instances for redundancy (if one killed, others detect)
  • Hidden from Task Manager (runs as background service host)

4.3.2 Kernel Debugger Mode (kd) Enhanced Protection

Why kd > Driver: Kernel debugger has higher privilege than drivers, can intercept driver load before it happens.

rust
// variants-kd-monitor/src/lib.rs
// Runs as kernel debugger extension

use windbg::*;

pub struct KdMonitor {
    breakpoints: Vec<Breakpoint>,
    protected_drivers: HashSet<String>,
}

impl KdMonitor {
    pub unsafe fn initialize(&mut self) -> Result<()> {
        // 1. Set breakpoint on nt!IopLoadDriver
        self.set_breakpoint(
            "nt!IopLoadDriver",
            Self::on_driver_load_attempt
        );
        
        // 2. Set breakpoint on nt!NtTerminateProcess
        self.set_breakpoint(
            "nt!NtTerminateProcess", 
            Self::on_process_terminate_attempt
        );
        
        // 3. Set breakpoint on nt!ZwSetValueKey (registry protection)
        self.set_breakpoint(
            "nt!ZwSetValueKey",
            Self::on_registry_write_attempt
        );
        
        // 4. Monitor SSDT modifications
        self.monitor_ssdt_integrity();
        
        Ok(())
    }
    
    unsafe fn on_driver_load_attempt(&mut self, regs: &Registers) -> DebugAction {
        // RCX = PDRIVER_OBJECT (first argument)
        let driver_object = regs.rcx as PDRIVER_OBJECT;
        
        // Get driver path from RegistryPath
        let registry_path = (*driver_object).DriverExtension.ServiceKeyName;
        let driver_name = extract_driver_name(&registry_path);
        
        log::info!("Driver load attempt: {}", driver_name);
        
        // Check if this is a suspicious driver
        if self.is_suspicious_driver(&driver_name) {
            log::warn!("Blocking suspicious driver: {}", driver_name);
            
            // Modify return value to STATUS_ACCESS_DENIED
            regs.rax = STATUS_ACCESS_DENIED as u64;
            
            // Skip the actual load
            return DebugAction::Skip;
        }
        
        // Check if malware is trying to unload Variants driver
        if driver_name.contains("Variants") {
            log::critical!("Attempt to unload Variants driver detected!");
            
            // Deny and trigger emergency
            self.trigger_emergency_response();
            return DebugAction::Skip;
        }
        
        DebugAction::Continue
    }
    
    unsafe fn on_process_terminate_attempt(&mut self, regs: &Registers) -> DebugAction {
        // RCX = ProcessHandle
        let process_handle = regs.rcx as HANDLE;
        
        // Get process ID from handle
        let pid = handle_to_pid(process_handle);
        
        // Check if it's Variants process
        if self.is_variants_process(pid) {
            log::critical!("Malware attempting to terminate Variants! PID: {}", pid);
            
            // Get caller process
            let caller_pid = current_process_id();
            log::critical!("Attacker PID: {}", caller_pid);
            
            // Reverse attack: terminate the attacker
            terminate_process(caller_pid);
            
            // Deny the termination
            regs.rax = STATUS_ACCESS_DENIED as u64;
            return DebugAction::Skip;
        }
        
        DebugAction::Continue
    }
    
    unsafe fn on_registry_write_attempt(&mut self, regs: &Registers) -> DebugAction {
        // Check if writing to CodeIntegrity policy
        let key_handle = regs.rcx as HANDLE;
        let key_path = handle_to_registry_path(key_handle);
        
        if key_path.contains("CodeIntegrity") || key_path.contains("Policies") {
            log::warn!("Registry write to security policy: {}", key_path);
            
            // Allow only trusted processes (Microsoft signed)
            let caller = current_process();
            if !is_microsoft_signed(caller) {
                log::critical!("Unsigned process attempting policy modification!");
                
                regs.rax = STATUS_ACCESS_DENIED as u64;
                return DebugAction::Skip;
            }
        }
        
        DebugAction::Continue
    }
    
    fn monitor_ssdt_integrity(&mut self) {
        // Get SSDT base address
        let ssdt_base = find_ssdt_base();
        
        // Hash the SSDT
        let expected_hash = self.calculate_ssdt_hash(ssdt_base);
        
        // Periodic check (every second)
        std::thread::spawn(move || {
            loop {
                let current_hash = calculate_ssdt_hash(ssdt_base);
                
                if current_hash != expected_hash {
                    log::critical!("SSDT HOOKED! Triggering emergency response!");
                    trigger_emergency_response();
                }
                
                std::thread::sleep(Duration::from_secs(1));
            }
        });
    }
}

Advantages over driver-only approach:

  • Can intercept driver load before it happens (not just notify)
  • Can modify function return values (deny malicious operations)
  • Can reverse-attack (terminate attacking process)
  • Higher privilege than PatchGuard

4.3.3 Driver Self-Protection

rust
// Register process protection
unsafe {
    ObRegisterCallbacks(
        &callback_registration,
        &mut registration_handle,
    );
}

// Callback implementation
unsafe extern "C" fn pre_open_process(
    registration_context: PVOID,
    info: POB_PRE_OPERATION_INFORMATION,
) -> OB_PREOP_CALLBACK_STATUS {
    let target_process = info.Object as PEPROCESS;
    
    // Check if target is Variants process
    if is_variants_process(target_process) {
        // Strip dangerous access rights
        if info.Parameters.CreateHandleInformation.DesiredAccess & PROCESS_TERMINATE != 0 {
            info.Parameters.CreateHandleInformation.DesiredAccess &= !PROCESS_TERMINATE;
        }
        if info.Parameters.CreateHandleInformation.DesiredAccess & PROCESS_VM_WRITE != 0 {
            info.Parameters.CreateHandleInformation.DesiredAccess &= !PROCESS_VM_WRITE;
        }
    }
    
    OB_PREOP_SUCCESS
}

4.3.2 Tampering Detection

rust
// Periodic integrity check (every 60 seconds)
async fn integrity_check_loop() {
    loop {
        // 1. Verify driver code section
        let driver_base = get_driver_base_address();
        let code_section = read_code_section(driver_base);
        let current_hash = sha256(&code_section);
        
        if current_hash != EXPECTED_CODE_HASH {
            log::critical!("Driver code section tampered!");
            trigger_emergency_recovery();
        }
        
        // 2. Verify DBG session integrity
        for (pid, session) in dbg_manager.sessions.iter() {
            if !session.is_valid() {
                log::critical!("DBG session {} compromised!", pid);
                reattach_dbg_session(*pid);
            }
        }
        
        tokio::time::sleep(Duration::from_secs(60)).await;
    }
}

4.4 Privacy Considerations

Data Minimization:

  • Only behavior vectors uploaded to cloud (not binaries)
  • Execution traces sanitized (remove user paths, replace with hash)
  • Network IPs obfuscated (only ASN + country)

User Control:

  • Opt-out of cloud analysis (local-only mode)
  • View all data before upload
  • One-click data deletion from ThreatCloud

5. API Contracts

5.1 Kernel ↔ User-mode IOCTL

c
// variants-shared/include/ioctl.h

#define VARIANTS_DEVICE_NAME L"\\Device\\Variants"
#define VARIANTS_SYMLINK_NAME L"\\??\\Variants"

// IOCTL codes
#define IOCTL_VARIANTS_ATTACH_DBG       CTL_CODE(FILE_DEVICE_UNKNOWN, 0x800, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_VARIANTS_DETACH_DBG       CTL_CODE(FILE_DEVICE_UNKNOWN, 0x801, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_VARIANTS_FREEZE_PROCESS   CTL_CODE(FILE_DEVICE_UNKNOWN, 0x802, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_VARIANTS_COMMIT_SHADOW    CTL_CODE(FILE_DEVICE_UNKNOWN, 0x803, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_VARIANTS_ROLLBACK_SHADOW  CTL_CODE(FILE_DEVICE_UNKNOWN, 0x804, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_VARIANTS_GET_EVENT        CTL_CODE(FILE_DEVICE_UNKNOWN, 0x805, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)

// Structures
typedef struct _VARIANTS_ATTACH_DBG_REQUEST {
    ULONG ProcessId;
    BOOLEAN AttachAllThreads;
} VARIANTS_ATTACH_DBG_REQUEST, *PVARIANTS_ATTACH_DBG_REQUEST;

typedef struct _VARIANTS_EVENT {
    ULONGLONG Timestamp;
    ULONG EventType;
    ULONG ProcessId;
    ULONG ThreadId;
    union {
        struct {
            WCHAR FilePath[260];
            ULONGLONG Offset;
            ULONG Length;
        } FileWrite;
        
        struct {
            WCHAR KeyPath[260];
            WCHAR ValueName[128];
        } RegistrySet;
        
        struct {
            ULONG IpAddress;
            USHORT Port;
        } NetworkConnect;
    } Data;
} VARIANTS_EVENT, *PVARIANTS_EVENT;

5.2 ThreatCloud REST API

Base URL: https://threatcloud.variants.security/v1

5.2.1 Authentication

All requests must include Ed25519 signature:

Authorization: Variants-Sig v1,client=<uuid>,ts=<unix_timestamp>,sig=<hex_signature>

Signature computed as:

sig = ed25519_sign(private_key, sha256(body + timestamp))

5.2.2 Endpoints

POST /analyze/behavior

Request:

json
{
  "vector": [0.12, 0.45, ...],  // 400 floats
  "metadata": {
    "sha256": "abc123...",
    "file_size": 1024000,
    "pe_timestamp": 1705449600,
    "client_version": "1.0.0"
  }
}

Response:

json
{
  "threat_score": 0.85,
  "matches": [
    {
      "signature_id": 12345,
      "similarity": 0.92,
      "threat_family": "Ransomware.WannaCry",
      "severity": 9
    }
  ],
  "recommended_action": "block"
}

POST /report/threat

Request:

json
{
  "vector": [...],
  "execution_trace": {
    "syscalls": ["NtWriteFile", "NtSetValueKey", ...],
    "network_iocs": ["45.67.89.10:8080"],
    "file_operations": [
      {"path": "C:\\Users\\<REDACTED>\\Documents\\file.txt", "op": "write"}
    ]
  },
  "detection_method": "ast_analysis",
  "confidence": 0.95
}

Response:

json
{
  "threat_id": "THR-2026-01234",
  "acknowledgement": "Threat recorded and signature extracted",
  "signature_id": 67890
}

GET /rules/hot

Query params:

  • client_version: Client version for compatibility
  • last_update: Unix timestamp of last sync

Response:

json
{
  "rules": [
    {
      "rule_id": "YR-2026-001",
      "yara_rule": "rule SilverFox { strings: $a = { E8 ?? ?? ?? ?? 83 C4 04 } condition: $a }",
      "priority": "critical",
      "created_at": 1705449600
    }
  ],
  "next_update_in": 300
}

6. Performance Requirements

6.1 Latency Targets

OperationTargetAcceptableUnacceptable
Process start overhead< 50ms< 100ms> 200ms
File write (< 1MB)< 10ms< 20ms> 50ms
Registry operation< 5ms< 10ms> 20ms
Cloud query (behavior vector)< 100ms< 200ms> 500ms
AST analysis (10MB binary)< 10s< 20s> 60s
User prompt response time< 2s< 5s> 10s

6.2 Resource Utilization

Windows Driver:

  • Memory: < 100MB resident
  • CPU: < 5% idle, < 15% under load
  • Disk I/O: Minimal (CoW async flush)

User-mode Engine:

  • Memory: < 200MB resident, < 500MB peak (during AST analysis)
  • CPU: < 10% background, < 40% during analysis
  • Threads: 8-16 worker threads

ThreatCloud:

  • Worker response time: p95 < 100ms
  • PostgreSQL query time: p95 < 50ms
  • Durable Object analysis: < 5s per file

6.3 Scalability

Client-side:

  • Support 1000+ concurrent monitored processes
  • Handle 10,000 events/sec from kernel
  • Shadow buffer pool: 5-10GB max

Cloud-side:

  • 100,000 active endpoints
  • 1,000,000 queries/day
  • 10TB threat signature database

7. Deployment Strategy

7.1 Installation Flow (Windows)

1. User downloads VariantsSetup.exe (signed with EV certificate)
   ↓
2. Installer checks prerequisites:
   - Windows 10 1809+ or Windows 11
   - TPM 2.0 (optional but recommended)
   - 8GB RAM, 10GB free disk
   ↓
3. Install driver:
   - Copy variants.sys to %SystemRoot%\System32\drivers
   - Register service (sc create Variants ...)
   - Set BOOT_START for ELAM
   ↓
4. Install user-mode components:
   - Engine service (VariantsEngine.exe)
   - UI app (VariantsUI.exe)
   - Recovery tools to hidden partition
   ↓
5. Enable kernel debug mode:
   - bcdedit /debug on
   - bcdedit /dbgsettings local
   - Prompt user to reboot
   ↓
6. [After reboot] First-time setup:
   - Generate Ed25519 keypair
   - Register with ThreatCloud
   - Download initial rule set
   - Create recovery partition (if not exists)
   ↓
7. Installation complete

7.2 Update Strategy

Gradual Rollout (prevent CrowdStrike-style incidents):

Phase 1: Canary (1% of users, internal testers)
  - Duration: 48 hours
  - Metrics: Crash rate, performance degradation
  - Rollback trigger: Crash rate > 0.1%
  
Phase 2: Early Adopters (10%)
  - Duration: 1 week
  - Metrics: Detection accuracy, false positives
  - Rollback trigger: False positive rate > 5%
  
Phase 3: Stable (50%)
  - Duration: 1 week
  - Metrics: Overall stability
  
Phase 4: General Availability (100%)
  - Full rollout

Update Mechanism:

  1. ThreatCloud pushes update manifest
  2. Client downloads new binaries (signed)
  3. Verifies signature + hash
  4. Stages update (does not install immediately)
  5. On next reboot, bootloader verifies and installs
  6. Old driver kept as backup for 7 days

Emergency Rollback:

  • Cloud kill switch: Disable specific version remotely
  • Client auto-downgrades to last known good version
  • Recovery OS can force rollback if driver prevents boot

7.3 Recovery Partition Setup

bash
# Create hidden recovery partition (5GB)
diskpart <<EOF
select disk 0
create partition primary size=5120
assign letter=R
format fs=ntfs quick label="Variants Recovery"
set id=27  # Hidden partition type
EOF

# Install Recovery OS
cp VariantsRecoveryOS.iso /mnt/recovery/
grub-install --boot-directory=/mnt/recovery/boot /dev/sda

# Configure UEFI boot entry
bcdedit /create {variants-recovery} /d "Variants Recovery OS" /application bootsector
bcdedit /set {variants-recovery} device partition=R:
bcdedit /set {variants-recovery} path \boot\grub\x64efi.efi
bcdedit /displayorder {variants-recovery} /addlast

8. Testing & Quality Assurance

8.1 Unit Testing

Coverage Target: > 80% for Rust code

Critical Test Suites:

  • DBG session management (attach, detach, freeze, terminate)
  • CoW file operations (write, commit, rollback)
  • MVCC transaction semantics
  • AST analysis pipeline (lift, optimize, extract features)
  • Cloud API authentication and error handling

Example:

rust
#[cfg(test)]
mod tests {
    use super::*;
    
    #[test]
    fn test_cow_write_commit() {
        let mut filter = CowFilter::new();
        let pid = 1234;
        
        // Create shadow buffer
        filter.create_shadow(pid);
        
        // Simulate write
        filter.write_to_shadow(pid, "test.txt", b"malicious data");
        
        // Verify shadow contains data
        let shadow_data = filter.read_shadow(pid, "test.txt").unwrap();
        assert_eq!(shadow_data, b"malicious data");
        
        // Commit
        filter.commit_shadow(pid).unwrap();
        
        // Verify real file now contains data
        let real_data = std::fs::read("test.txt").unwrap();
        assert_eq!(real_data, b"malicious data");
    }
    
    #[test]
    fn test_cow_write_rollback() {
        let mut filter = CowFilter::new();
        let pid = 1234;
        
        // Original file content
        std::fs::write("test.txt", b"original").unwrap();
        
        filter.create_shadow(pid);
        filter.write_to_shadow(pid, "test.txt", b"malicious data");
        
        // Rollback instead of commit
        filter.rollback_shadow(pid).unwrap();
        
        // Verify real file still has original content
        let real_data = std::fs::read("test.txt").unwrap();
        assert_eq!(real_data, b"original");
    }
}

8.2 Integration Testing

Test Scenarios:

  1. Ransomware Simulation:
    • Deploy WannaCry-like behavior simulator
    • Verify detection within 5 seconds
    • Verify complete rollback (0 files encrypted)
  2. Driver Conflict:
    • Install competing security software (e.g., Avira trial)
    • Verify graceful degradation or conflict resolution
    • Ensure no system crash
  3. APT Attack Chain:
    • Simulate multi-stage attack (phishing → privilege escalation → lateral movement)
    • Verify each stage detection
    • Verify cloud correlation (recognize attack pattern)
  4. Performance Regression:
    • Run PCMark, 3DMark benchmarks with Variants active vs. disabled
    • Ensure < 10% performance difference

8.3 Stress Testing

Load Generation:

  • 1000 concurrent processes under DBG monitoring
  • 50,000 file operations/second through CoW filter
  • 10,000 cloud API requests/second

Chaos Engineering:

  • Random process kills
  • Network partition (cloud unreachable)
  • Disk full conditions
  • Memory pressure (OOM scenarios)

8.4 Security Testing

Adversarial Evaluation:

  1. Hire red team to attempt bypass
  2. Test against public malware corpus (VirusTotal samples)
  3. Run against MITRE ATT&CK techniques

Fuzzing:

  • Fuzz IOCTL interface (AFL++)
  • Fuzz cloud API endpoints
  • Fuzz PE parser in AST analyzer

8.5 Compliance & Certification

Target Certifications:

  • WHQL (Windows Hardware Quality Labs)
  • AV-TEST certification
  • VB100 (Virus Bulletin)
  • ICSA Labs certification (optional)

11. Competitive Analysis

11.1 Windows Endpoint Security Comparison

FeatureVariants360KasperskyDefenderCrowdStrike
ArchitectureKD + CoW + ASTVT-x HypervisorBehavior MonitorSystem IntegratedCloud Sensor
Main Defense⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Detection Rate⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Performance⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Offline Capability⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Recovery⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Self-Protection⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Anti-Rootkit⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Resource UsageHeavyMediumMediumMinimalMinimal
PriceFree/PaidFree$40/yrFree$99/yr/endpoint

Detailed Comparison

360 Security (Qihoo 360)

Strengths:

  • ✅ VT-x hardware virtualization = Transparent to malware
  • ✅ EPT (Extended Page Table) protects SSDT/IDT from modification
  • ✅ Strong main defense (can block driver-level attacks)
  • ✅ Free for personal use

Weaknesses:

  • ❌ Heavy (10-20% CPU overhead when virtualization enabled)
  • ❌ Privacy concerns (Chinese cloud backend)
  • ❌ Ads and bundled software
  • Still bypassed by Silver Fox (driver load before virtualization)

Variants Advantage:

  • Kernel Debugger mode loads even earlier than VT-x (via ELAM)
  • PowerShell watchdog provides additional recovery layer
  • Open-source core = More trustworthy
  • Recovery OS can fix system even if 360's virtualization is disabled

360 Advantage:

  • More mature (10+ years in market)
  • Better performance (hardware-accelerated)
  • Larger threat database

Kaspersky Internet Security

Strengths:

  • ✅ Industry-leading detection rate (consistently #1 in AV-TEST)
  • ✅ System Watcher with automatic rollback (similar to our CoW)
  • ✅ Cloud sandbox for unknown files
  • ✅ Excellent behavioral analysis

Weaknesses:

  • ❌ Main defense is only medium (relies on detection, not prevention)
  • ❌ Expensive ($40-60/year)
  • ❌ Geopolitical concerns (banned in some countries)
  • Cloud sandbox can be detected by advanced malware

Variants Advantage:

  • Stronger main defense (kernel debugger can block before execution)
  • AST analysis is deeper than Kaspersky's behavioral heuristics
  • Recovery OS is more comprehensive than System Watcher restore
  • Can work fully offline (Kaspersky relies heavily on cloud)

Kaspersky Advantage:

  • 20+ years of threat intelligence
  • Better detection of sophisticated APTs
  • More polished UI and user experience
  • Multi-platform (Windows, Mac, Android, iOS)

Windows Defender

Strengths:

  • ✅ Deeply integrated with Windows (zero overhead)
  • ✅ Excellent self-protection (kernel-level, Microsoft-signed)
  • ✅ Free and no ads
  • "Self-destruct" strategy: If infected, triggers BSOD to protect system
  • ✅ Good detection rate (recently caught up with commercial AVs)

Weaknesses:

  • ❌ Main defense is reactive (scans after download)
  • ❌ False positives are common
  • ❌ Limited offline capability (heavily cloud-dependent)

Variants Advantage:

  • Proactive prevention via kernel debugger (vs. Defender's reactive scan)
  • Recovery OS is more powerful than Defender Offline
  • AST analysis detects unknown threats Defender might miss
  • Full control and transparency (vs. Defender's closed-source)

Defender Advantage:

  • System integration = Best compatibility
  • Microsoft updates it constantly
  • SmartScreen network protection
  • No installation needed

Why Defender + Variants is the ultimate combo:

Defender: Handles known threats efficiently (low overhead)
Variants: Catches advanced threats Defender misses (kernel debugger)
Both:     If one fails, the other has a chance

CrowdStrike Falcon

Strengths:

  • ✅ Industry-leading EDR (Endpoint Detection & Response)
  • ✅ Minimal performance impact (<1% CPU)
  • ✅ Global threat intelligence from millions of endpoints
  • ✅ Cloud-powered ML models
  • ✅ Excellent for enterprise environments

Weaknesses:

  • Weak main defense (sensor only collects events, doesn't prevent)
  • ❌ Heavily cloud-dependent (offline = almost useless)
  • ❌ Expensive ($99-150/endpoint/year for enterprise)
  • July 2024 incident: Single bad update crashed 8.5M Windows machines globally

Variants Advantage:

  • Superior main defense: Kernel debugger blocks threats in real-time
  • Offline-capable: Full protection without cloud
  • No catastrophic updates: Gradual rollout + Recovery OS fallback
  • Perfect rollback: CoW ensures zero data loss (vs. Falcon's limited rollback)

CrowdStrike Advantage:

  • Unmatched threat intelligence (sees attacks globally)
  • Lightweight sensor (Variants is heavier)
  • Enterprise management dashboard
  • Threat hunting capabilities

Target Audience Difference:

  • CrowdStrike: Large enterprises, SOC teams, compliance requirements
  • Variants: Power users, privacy-conscious individuals, offline environments

11.2 Linux Endpoint Security Comparison

FeatureVariantsClamAVSymantec EPCrowdStrike (Linux)
ArchitectureKernel Module + ptraceSignature ScannerAgent + Kernel ModuleSensor (eBPF)
Rootkit Detection⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Performance⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Deep System Protection⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Offline Capability⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Recovery⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
PriceFree/PaidFree$40+/endpoint/yr$99+/endpoint/yr

Detailed Comparison

ClamAV

Strengths:

  • ✅ Open-source and completely free
  • ✅ Very lightweight (minimal CPU/memory)
  • ✅ Good for mail servers (detects email-borne malware)
  • ✅ Actively maintained by Cisco

Weaknesses:

  • Signature-based only (no behavioral analysis)
  • Zero rootkit protection (can't detect kernel-level malware)
  • ❌ No real-time protection by default (must run manually or via cron)
  • ❌ High false negative rate for advanced threats

Variants Advantage:

  • Kernel-level protection: ptrace + kprobe monitors all syscalls
  • Rootkit detection: chroot scanning + static binary tools
  • Behavioral analysis: Detects unknown malware via AST
  • Recovery OS: Can clean deeply infected systems

ClamAV Advantage:

  • Extremely lightweight (suitable for servers)
  • No kernel dependencies (works on any Linux)
  • Simple to deploy

When to use ClamAV:

  • Email/file server scanning
  • As secondary scanner alongside Variants
  • Resource-constrained environments

Symantec Endpoint Protection (SEP) for Linux

Strengths:

  • ✅ Enterprise-grade with central management
  • ✅ Kernel module provides some rootkit protection
  • ✅ Behavioral analysis (not just signatures)
  • ✅ Good support and updates

Weaknesses:

  • ❌ Closed-source and expensive
  • ❌ Heavy for Linux standards (designed for enterprise)
  • Limited deep rootkit detection (can be bypassed like in your friend's case)
  • ❌ Cloud-dependent for advanced features

Variants Advantage:

  • Deeper rootkit detection: Static binaries bypass libc hooks
  • chroot isolation: Scan from clean environment
  • Open-source core: Community can audit and improve
  • Recovery OS: More powerful than SEP's remediation

SEP Advantage:

  • Enterprise management console
  • Multi-platform (Windows, Linux, Mac unified)
  • Compliance certifications
  • 24/7 support

CrowdStrike Falcon for Linux

Strengths:

  • ✅ Uses eBPF for efficient monitoring (kernel-level visibility)
  • ✅ Minimal performance overhead
  • ✅ Same cloud intelligence as Windows version
  • ✅ Excellent for cloud/container environments

Weaknesses:

  • Weak main defense (detect-only, not prevent)
  • ❌ eBPF can be bypassed by kernel rootkits
  • ❌ Heavily cloud-dependent
  • ❌ Expensive

Variants Advantage:

  • Stronger prevention: kprobe intercepts syscalls in real-time
  • Rootkit resistance: Static tools + chroot scanning
  • Offline capability: Full protection without cloud
  • Recovery OS: Can repair systems Falcon can't

Falcon Advantage:

  • eBPF is more efficient than kprobe
  • Container/Kubernetes integration
  • Global threat intelligence

11.3 Key Differentiators of Variants

What Variants Does Better

  1. Kernel Debugger Mode (Industry First)
    • Higher privilege than any driver
    • Can intercept and block driver loads before they happen
    • Reverse-attack capability (terminate attacking process)
  2. Perfect Rollback (CoW + MVCC)
    • Transaction-based file system protection
    • Ransomware can encrypt shadow buffer all it wants, real files untouched
    • Instant rollback on process exit
  3. Recovery OS (Most Comprehensive)
    • Bootable Arch Linux with forensic tools
    • SAT solver for integrity verification
    • chroot-based rootkit scanning
    • Can fix systems even when main OS won't boot
  4. AST + SAT Analysis (Academic-Grade)
    • Understands program logic, not just signatures
    • Can detect never-before-seen malware
    • SAT constraints verify "Can this program damage MBR?" mathematically
  5. Offline-First Design
    • Full protection without internet
    • Cloud enhances but doesn't replace local analysis
    • Ideal for air-gapped environments
  6. Open-Source Core
    • Engine is fully auditable
    • Community can contribute YARA rules
    • No black-box trust required

What Variants Does Worse

  1. Performance
    • Kernel debugger + AST analysis = Heavy
    • Target: 10-20% overhead (similar to McAfee/Norton)
    • CrowdStrike/Defender are much lighter
  2. Threat Intelligence
    • New product = Smaller threat database
    • Kaspersky/CrowdStrike have 20+ years of data
    • Will improve over time as user base grows
  3. Enterprise Management
    • No central console (yet)
    • Not designed for 10,000+ endpoint deployments
    • CrowdStrike/Symantec dominate this space
  4. Compatibility
    • Kernel debugger mode requires Windows 10+ (x64)
    • Some legitimate software may conflict
    • 360/Defender have better compatibility

11.4 The "Virus > Antivirus" Problem

Why malware often wins:

Defender's Dilemma:
┌─────────────────────────────────────────────────┐
│  Malware Developer                               │
│  - Only needs to find ONE bypass                 │
│  - Can test against all AVs before release       │
│  - No compatibility concerns (can break systems) │
│  - No false positive concerns                    │
└─────────────────────────────────────────────────┘
                    VS
┌─────────────────────────────────────────────────┐
│  Antivirus Vendor                                │
│  - Must block ALL attack vectors                 │
│  - Can't test every malware (new ones daily)     │
│  - Must maintain system stability                │
│  - Must minimize false positives                 │
└─────────────────────────────────────────────────┘

Examples:

  • Silver Fox bypassed 360's VT-x by using earlier boot stage
  • Rootkit in your friend's case bypassed SEP by replacing libc
  • CrowdStrike incident showed even industry leader can fail catastrophically

Variants' Approach to Narrow the Gap:

  1. Defense in Depth:
   Layer 1: Kernel Debugger (highest privilege)
   Layer 2: Driver Protection (ELAM, signature validation)
   Layer 3: CoW File System (transaction safety)
   Layer 4: PowerShell Watchdog (self-healing)
   Layer 5: Recovery OS (last resort)
  1. Assume Breach Mentality:
    • Don't rely on perfect prevention
    • Design for graceful failure (Recovery OS)
    • Make recovery easier than cleanup
  2. Community Intelligence:
    • Open-source engine = More eyes on code
    • Users contribute samples to ThreatCloud
    • Rapid response to new threats
  3. Academic Rigor:
    • AST analysis understands malware logic
    • SAT solver mathematically verifies threats
    • Less reliant on signature databases

But Ultimately:

  • No antivirus is perfect (including Variants)
  • User behavior matters most (don't run untrusted software)
  • Layered security is key (AV + firewall + backups + common sense)

9.1 Technical Risks

RiskLikelihoodImpactMitigation
Driver blue screenMediumCriticalExtensive testing, Rust safety, panic recovery
False positive epidemicMediumHighGradual rollout, user feedback loop, ML retraining
Cloud outageLowMediumLocal-only fallback mode, cached rules
DBG performance impactHighMediumSelective monitoring, user-mode fallback
Rootkit bypassMediumHighMulti-layer defense, Recovery OS, continuous research

9.2 Business Risks

RiskLikelihoodImpactMitigation
Cannot obtain WHQLMediumHighLaunch in test-signing mode initially
Cloud costs exceed revenueMediumHighTiered pricing, usage limits
Legal challenges (DMCA)LowCriticalLegal review, clear EULA
Competition from big playersHighMediumFocus on niche (power users), open-source trust

10. Appendix

10.1 Glossary

  • AST: Abstract Syntax Tree - Intermediate representation of program structure
  • CoW: Copy-on-Write - Optimization technique for memory/disk operations
  • DBG: Kernel Debugging Mode - Low-level system debugging capability
  • ELAM: Early Launch Anti-Malware - Boot-time malware prevention
  • IoC: Indicator of Compromise - Artifact indicating potential security breach
  • LSH: Locality-Sensitive Hashing - Approximate nearest neighbor search
  • MVCC: Multi-Version Concurrency Control - Database transaction isolation
  • SAT: Boolean Satisfiability - Constraint solving problem
  • SSDT: System Service Descriptor Table - Kernel syscall dispatch table

10.2 References

10.3 Revision History

VersionDateAuthorChanges
1.0.02026-01-17Variants TeamInitial specification
1.1.02026-01-17Variants TeamAdded: PowerShell watchdog, kernel debugger mode, Linux rootkit detection, competitive analysis

Document Status: Ready for Implementation
Next Review: 2026-02-17
Approval Required: Technical Lead, Security Architect

Content is user-generated and unverified.
    Variants Security Suite - Technical Architecture Specification | Claude