Technical Deep-Dive: Architecture, Internals & Roadmap
Project Overview
| Attribute | Value |
|---|---|
| Language | Rust 2024 Edition (MSRV: 1.91+) |
| License | Apache-2.0 (open core, hybrid commercial) |
| Repository | EvilBit-Labs/DaemonEye |
| Open Issues | 43 |
| Stars / Forks | 4 / 0 |
| Async Runtime | Tokio 1.49.0 |
| Embedded Database | redb 3.1.0 |
| IPC | Protobuf (prost 0.14.3) over interprocess 2.2.3 |
| CLI Framework | clap 4.6.0 (derive) |
| DaemonEye is a lightweight, privacy-respecting endpoint security monitoring system designed for offline-first and air-gapped environments. It provides cross-platform process visibility for operators who need detection capability without enterprise EDR overhead or cloud dependency. The three-component architecture cleanly separates privileged process collection from user-space detection and alerting, enforcing strict privilege separation at every boundary. |
Codebase Metrics
| Metric | Value |
|---|---|
| Total Rust code | ~121,850 lines across 175 files |
| Integration test code | ~39,200 lines |
| Benchmark code | ~6,430 lines |
| Workspace crates | 6 (procmond, daemoneye-agent, daemoneye-cli, daemoneye-lib, collector-core, daemoneye-eventbus) |
| Protobuf schemas | 3 files (common.proto, ipc.proto, eventbus.proto) |
| CI workflows | 9 (audit, benchmarks, ci, codeql, copilot-setup, docs, release, scorecard, security) |
| Public structs | ~323 |
| Public traits | 13 |
| Public enums | ~95 |
| Benchmark suites | 16 (Criterion-based) |
| Test functions | ~495 across 61 files |
Crate Size Breakdown
| Crate | SLOC | Source Files | Role |
|---|---|---|---|
procmond | 23,250 | 14 | Privileged process monitoring daemon |
collector-core | 19,398 | 22 | Extensible collector framework |
daemoneye-eventbus | 14,578 | 17 | Pub/sub event distribution and RPC |
daemoneye-lib | 13,231 | 20 | Shared library (models, storage, detection, IPC, crypto) |
daemoneye-agent | 4,706 | 8 | Detection orchestrator |
daemoneye-cli | 78 | 1 | Operator command-line interface |
Architecture Overview
Design Principles
- Offline-First: Complete air-gap compatibility, zero external dependencies at runtime
- Privilege Separation: Only
procmondruns elevated; detection and alerting are user-space - Security-First:
unsafe_code = "forbid"at workspace level, zero-warning clippy policy - Operator-Focused: Built for security professionals in contested/airgapped environments
- Trait-Based Extensibility: All major subsystems use trait abstractions for pluggability
- Async-First: Tokio-based with streaming APIs to prevent unbounded memory buffering
Technology Stack
| Category | Technology | Version |
|---|---|---|
| Language | Rust 2024 Edition | MSRV 1.91+ |
| Async Runtime | Tokio | 1.49.0 |
| Serialization | Serde, Postcard, Prost (protobuf) | 1.0.228 / 1.1.3 (no-default-features) / 0.14.3 |
| Database | redb (pure Rust embedded) | 3.1.0 |
| CLI | clap (derive) | 4.6.0 |
| Process Enumeration | sysinfo | 0.38.4 |
| Detection Engine | sqlparser | 0.60.0 |
| IPC Transport | interprocess (Unix sockets / named pipes) | 2.2.3 |
| Crypto (Hashing) | BLAKE3, SHA2 | 1.8.3 / 0.10.9 |
| Crypto (Merkle) | rs-merkle | 1.5.0 |
| Logging | tracing + tracing-subscriber | 0.1.44 / 0.3.23 |
| Errors | thiserror / anyhow | 2.0.18 / 1.0.100 |
| Task Runner | just | 136 tasks |
| Testing | cargo-nextest, insta, criterion | - |
Three-Component Security Architecture
DaemonEye implements strict privilege separation across three binaries with distinct security boundaries. Each component operates at a different privilege level with carefully controlled data access and network capabilities.
Component Privilege Matrix
| Component | Privileges | Network | Database | Function |
|---|---|---|---|---|
procmond | Elevated (drops after init) | None (air-gapped) | Write-only (audit ledger) | Privileged process collector |
daemoneye-agent | Minimal (user-space) | Outbound-only | Read/write (event store) | Detection orchestrator |
daemoneye-cli | Minimal | None | Read-only | Operator CLI |
daemoneye-lib | N/A (library) | N/A | N/A | Shared core |
collector-core | N/A (framework) | N/A | N/A | Collector framework |
daemoneye-eventbus | N/A (library) | N/A | N/A | Event bus infrastructure |
Deployment Tiers
| Tier | Components | Pricing |
|---|---|---|
| Free (Community) | procmond + daemoneye-agent + daemoneye-cli (standalone) | Free, unlimited hosts |
| Business (Professional) | • Security Center + Enterprise integrations | $199/site |
| Enterprise / Gov-IC | • Kernel monitoring (eBPF) + Federated architecture + Advanced SIEM | Custom |
Data Flow Pipeline
The system follows a pipeline processing model where process data flows from collection through detection to alerting. Each stage enforces security boundaries and uses bounded channels for backpressure.
procmond: Privileged Process Collector
Overview
procmond is the privileged component responsible for process enumeration, lifecycle tracking, and audit trail maintenance. It runs with elevated privileges only during initialization, then drops to minimal permissions. It has zero network access and communicates solely via local IPC.
Execution Modes
procmond operates in two modes determined by the DAEMONEYE_BROKER_SOCKET environment variable:
Actor Mode (env var set — managed by daemoneye-agent):
-
Constructs
ProcmondMonitorCollectorwithEventBusConnector -
Spawns four concurrent Tokio tasks: backpressure monitor, heartbeat (30s interval), shutdown handler, event consumer
-
Buffer management: 10MB max buffer, backpressure activates at 70% (7MB), releases at 50% (5MB)
Standalone Mode (env var unset — independent operation): -
Uses
ProcessEventSourcewith collector-core framework -
Registration timeout: 10s, max 3 retries with exponential backoff
Process Collection
The ProcessCollector trait provides cross-platform process enumeration:
pub trait ProcessCollector: Send + Sync {
fn name(&self) -> &'static str;
fn capabilities() -> ProcessCollectorCapabilities;
async fn collect_processes() -> Result<(Vec<ProcessEvent>, CollectionStats)>;
async fn collect_process(pid: u32) -> Result<ProcessEvent>;
async fn health_check() -> Result<()>;
}
Platform implementations: linux_collector.rs, macos_collector.rs, windows_collector.rs
ProcessCollectionConfig defaults: enhanced_metadata=true, compute_hashes=false, max_processes=unlimited, skip_system=false, skip_kernel=false
Process Lifecycle Tracking
The lifecycle tracker (lifecycle.rs) detects four event types:
| Event | Detection | Data |
|---|---|---|
Start | New PID not in previous snapshot | ProcessSnapshot + detected_at |
Stop | PID in previous but not current snapshot | ProcessSnapshot + runtime_duration |
Modified | PID exists but fields changed | previous + current + modified_fields list |
Suspicious | Anomalous behavior patterns | ProcessSnapshot + reason + SuspiciousEventSeverity |
| ProcessSnapshot captures 14 fields: pid, ppid, name, executable_path, command_line, start_time, cpu_usage, memory_usage, executable_hash, user_id, accessible, file_exists, snapshot_time, and platform_metadata. |
PID Reuse Handling: Compares start times to detect when a new process reuses a recycled PID.
Write-Ahead Log (WAL)
The WAL (wal.rs) provides crash recovery for event publishing:
- Entry format: Sequence number (u64, monotonic) + ProcessEvent + CRC32 checksum + event type tag
- Serialization: Length-delimited postcard (no-default-features,
alloc-only) with CRC32 integrity validation - File rotation: At 80MB threshold, files named
procmond-{sequence:05}.wal - Recovery: On startup, replays all WAL files in sequence order, re-publishes unpublished events
- Confirmation:
mark_published(sequence)enables cleanup after successful delivery
Security Context
Platform-specific privilege detection:
- Linux: Parses
/proc/self/statusCapEff field forCAP_SYS_PTRACE(bit 19) andCAP_DAC_READ_SEARCH(bit 2) - macOS: Checks
getuid() == 0 - Windows: Currently returns degraded mode (tracked in issue #149)
- FreeBSD: Checks
getuid() == 0(best-effort)
Data Sanitization: Redacts values after sensitive flags (--password,--secret,--token,--api-key,-p,-s,-t,-k) in command lines. Sanitizes env vars containing PASSWORD, SECRET, TOKEN, KEY, API_KEY, AUTH. Redacts file paths containing.ssh,.aws,.gnupg,.kube/config,.docker/config.
Actor Model
In actor mode, ProcmondMonitorCollector communicates via an ActorHandle with a bounded mpsc channel (capacity: 100):
pub enum ActorMessage {
HealthCheck { respond_to: oneshot::Sender<HealthCheckData> },
UpdateConfig { config: Box<ProcmondMonitorConfig>, respond_to: oneshot::Sender<Result<()>> },
GracefulShutdown { respond_to: oneshot::Sender<Result<()>> },
BeginMonitoring,
AdjustInterval { new_interval: Duration },
}
CollectorState transitions: WaitingForAgent → Running → ShuttingDown → Stopped
daemoneye-agent: Detection Orchestrator
Overview
The agent operates in user-space with minimal privileges. It manages the embedded event bus broker, coordinates collector lifecycles via RPC, executes SQL-based detection rules, and dispatches alerts through configured sinks.
Three-Phase Startup
Phase 1 — Initialization:
-
Load YAML configuration
-
Initialize tracing/telemetry
-
Start embedded
DaemoneyeBroker -
Start IPC server for CLI communication
Phase 2 — Collector Coordination: -
Load collectors config from
/etc/daemoneye/collectors.json(Unix) orC:\ProgramData\DaemonEye\config\collectors.json(Windows) -
Wait for expected collectors to register via RPC
-
State machine:
Loading→Ready→SteadyState -
Broadcast
BeginMonitoringto all registered collectors
Phase 3 — Detection & Alerting: -
Initialize
DetectionEnginewith SQL rule evaluation -
Initialize
AlertManagerwith configured sinks -
Main event loop: periodic RPC health checks (every 10 iterations), request process enumeration via RPC, execute detection rules, dispatch matching alerts
Agent State Machine
pub enum AgentState {
Loading, // Spawning collectors, waiting for registration
Ready, // All collectors registered and ready
SteadyState, // Normal operation, monitoring broadcast
StartupFailed { reason: String }, // Timeout or fatal error
ShuttingDown, // Graceful shutdown in progress
}
Collector Registry
Thread-safe registry (RwLock<HashMap<String, CollectorRecord>>) managing collector lifecycles:
- Registration: Validates uniqueness, assigns topics, records heartbeat interval
- Heartbeat monitoring: 30s default interval, 3 max missed heartbeats, 10% grace period
- Recovery detection: Identifies collectors with
HeartbeatStatus::Failedfor restart
IPC Server
Listens for CLI connections via InterprocessServer. Receives DetectionTask messages and returns DetectionResult with process, network, filesystem, and performance event vectors.
daemoneye-lib: Shared Core Library
Module Architecture
Feature-gated module system for precise dependency control:
// Core modules (always available)
pub mod config;
pub mod crypto;
pub mod ipc;
pub mod models;
pub mod proto;
pub mod storage;
pub mod telemetry;
// Feature-gated modules
#[cfg(feature = "alerting")] pub mod alerting;
#[cfg(feature = "process-collection")] pub mod collection;
#[cfg(feature = "detection-engine")] pub mod detection;
#[cfg(feature = "kernel-monitoring")] pub mod kernel;
#[cfg(feature = "network-correlation")] pub mod network;
Models (models/)
Core data types shared across all components:
ProcessRecord: pid (u32), name (String), executable_path, command_line, start_time, cpu_usage (f64), memory_usage (u64), status, executable_hash (SHA-256), collection_time
Alert: id, severity (Info/Low/Medium/High/Critical), title, description, detection_rule_id, process (ProcessRecord), deduplication_key, timestamps
DetectionRule: id, name, description, sql_query, category, severity, enabled flag, validation constraints
SystemInfo: hostname, os_name, os_version, architecture, cpu_cores, total_memory, uptime, capabilities
Storage (storage.rs) — redb Integration
Five table definitions with JSON-serialized byte values:
| Table | Key | Value | Access Pattern |
|---|---|---|---|
processes | u64 | Vec<u8> (ProcessRecord) | Agent R/W, CLI R/O |
detection_rules | &str | Vec<u8> (DetectionRule) | Agent R/W |
alerts | u64 | Vec<u8> (Alert) | Agent R/W, CLI R/O |
system_info | u64 | Vec<u8> (SystemInfo) | Agent R/W |
scan_metadata | u64 | Vec<u8> (ScanMetadata) | Agent R/W |
DatabaseManager provides: new(), open(), CRUD operations per table, store_processes_batch(), cleanup_old_data(retention_days), get_stats(). Platform-agnostic directory validation with friendly error messages before database operations. |
Note: redb Value trait implementations are pending (Task 8). Current implementation uses stub methods with proper transaction scaffolding.
Detection Engine (detection/)
SQL-based detection with AST validation for injection prevention:
sql_to_ipc.rs: Parses SQL queries usingsqlparser, validates AST structure, generates IPCDetectionTaskmessages- Security: Whitelist-based function approval, SELECT-only queries, no data modification operations permitted
- Sandboxing: Detection rules execute with resource limits in an isolated context
Alert System (alerting.rs)
Trait-based multi-channel alert delivery:
#[async_trait]
pub trait AlertSink: Send + Sync {
async fn send(&self, alert: &Alert) -> Result<DeliveryResult, AlertingError>;
fn name(&self) -> &str;
async fn health_check(&self) -> Result<(), AlertingError>;
}
Implementations: StdoutSink (JSON/Human/CSV), FileSink (append mode), with factory pattern (AlertSinkFactory) for config-driven creation.
AlertManager provides:
- Concurrent delivery to all sinks via
futures::future::join_all - Deduplication window (default 5 minutes, configurable)
- Rate limiting (max alerts per minute)
- Automatic pruning of dedup cache at 1000 entries
- Health summary with per-sink status and percentage calculation
- Error isolation: individual sink failures don't block other deliveries
Cryptographic Subsystem (crypto.rs)
Certificate Transparency-style audit ledger:
Blake3Hasher: Computes BLAKE3 hashes (32 bytes / 64 hex chars) for data and string inputs.
AuditEntry (7 fields): sequence, timestamp, actor, action, payload_hash, previous_hash (chain link), entry_hash. Each entry's hash incorporates all fields plus the previous entry's hash, creating a tamper-evident chain.
AuditLedger: Append-only structure with add_entry(), verify_integrity() (validates both individual entry hashes and chain continuity), get_latest_hash(). Uses saturating_add for sequence numbers.
Planned: Merkle tree inclusion proofs via rs-merkle crate, Ed25519 signatures for external verification.
IPC Communication (ipc/)
Four-layer IPC architecture:
codec.rs: Protobuf message framing with CRC32C integrity checkingclient.rs: Resilient IPC client with circuit breaker and load balancinginterprocess_transport.rs: Unix socket (Linux/macOS) and Windows named pipe transportproto/ipc.proto: Detection task and result message definitions
Transport: Unix domain sockets on Linux/macOS, named pipes (\\.\pipe\DaemonEye-broker) on Windows. Async message handling with automatic reconnection and exponential backoff.
Configuration (config.rs)
Hierarchical configuration with precedence: CLI flags > environment variables (PROCMOND_*) > user config (~/.config/procmond/config.yaml) > system config (/etc/procmond/config.yaml) > embedded defaults.
Formats: YAML, JSON, TOML via figment.
Event Bus Architecture
daemoneye-eventbus Crate
Embedded pub/sub message broker providing multi-collector coordination:
Core Components (17 modules):
broker.rs—DaemoneyeBroker: Embedded event broker with topic-based routingmessage.rs— 12 message type variants with correlation metadata trackingrpc.rs— 3 traits, 21 structs for request/response patternstopic.rs/topics.rs— Hierarchical topic abstractiontransport.rs— Transport layer (10 structs)queue_manager.rs— Per-client message queue managementprocess_manager.rs— Process lifecycle (6 structs)task_distribution.rs— Load balancing (4 structs)result_aggregation.rs— Result combining (5 structs)correlation.rs— Distributed tracing (8 structs)rate_limiter.rs— Rate limiting (2 structs)compatibility.rs— Version compatibility (5 structs)
Topic Hierarchy
events.process.{start|stop|modify} → ProcessEvent with correlation metadata
control.health.heartbeat.{collector_id} → HeartbeatMetrics from procmond
control.collector.lifecycle → Registration/Deregistration requests
control.collector.{id} → RPC control messages to collectors
control.rpc.response → RPC responses from collectors
events.collector.{id} → Event output from specific collector
Protobuf Message Definitions
| Proto File | Key Messages | Key Enums |
|---|---|---|
common.proto | ProcessFilter, HashCheck, HashResult, ProcessRecord, NetworkFilter, FilesystemFilter, PerformanceFilter | TaskType (7 variants: ENUMERATE_PROCESSES, CHECK_PROCESS_HASH, MONITOR_PROCESS_TREE, etc.) |
ipc.proto | CollectionCapabilities, AdvancedCapabilities, DetectionTask, DetectionResult, CapabilityRequest/Response | MonitoringDomain (PROCESS, NETWORK, FILESYSTEM, PERFORMANCE) |
eventbus.proto | AlertPayload, QoS settings, RPC request/response | MessageType (8), EventType (6), AlertSeverity (5), DeliveryGuarantee (3), DuplicateHandling |
Quality of Service
The event bus supports configurable QoS:
- Delivery Guarantees: AT_MOST_ONCE, AT_LEAST_ONCE, EXACTLY_ONCE
- Duplicate Handling: Configurable deduplication strategies
- Retention Policies: Time-based and count-based message retention
Backpressure Management
- 10MB max buffer per connector
- Activation threshold: 70% capacity (7MB)
- Release threshold: 50% capacity (5MB)
- Backpressure signal reduces collection interval or pauses event processing
Collector Framework (collector-core)
Overview
Extensible collection infrastructure (22 modules, 19,398 SLOC) providing shared operational foundation for multiple monitoring components.
Key Components
| Module | Structs | Purpose |
|---|---|---|
collector.rs | 3 | Core Collector trait and implementations |
event_bus.rs | 19 | EventBus integration layer |
high_performance_event_bus.rs | 6 | High-throughput variant for load testing |
daemoneye_event_bus.rs | 7 | DaemonEye-specific EventBus bridge |
rpc_services.rs | 5 | RPC service implementation |
process_manager.rs | 2 | Collector process lifecycle management |
task_distributor.rs | 3 | Task distribution across collectors |
result_aggregator.rs | 5 | Multi-collector result combining |
load_balancer.rs | 4 | Load balancing across collectors |
capability_router.rs | 4 | Capability-based request routing |
trigger.rs | 16 variants | Event trigger definitions |
analysis_chain.rs | 9 | Analysis pipeline stages |
shutdown_coordinator.rs | 4 | Graceful shutdown orchestration |
health_monitor.rs | 2 | Health check infrastructure |
performance.rs | 10 | Performance metrics collection |
Key Traits
MonitorCollector— Generic monitoring collector interfaceHighPerformanceEventBus— High-throughput event distributionEventBusClient— Event bus client interfaceRpcClient— RPC communication patternCollectorRpcClient— Lifecycle management (start/stop/restart/health_check/update_config)ResultAggregator— Multi-collector result aggregationConfigManager— Configuration management interface
Security Model
Defense in Depth
| Layer | Mechanism | Implementation |
|---|---|---|
| Memory Safety | Rust ownership + unsafe_code = "forbid" | Workspace-level lint, zero unsafe code policy |
| Integer Safety | Overflow checks in release builds | overflow-checks = true in [profile.release] |
| Privilege Separation | Three-component isolation | Only procmond runs elevated, immediate drop after init |
| Network Isolation | Zero inbound, outbound-only for agent | procmond has no network access whatsoever |
| SQL Injection Prevention | AST validation with sqlparser | Whitelist-based function approval, SELECT-only |
| IPC Integrity | CRC32C validation on all messages | Protobuf framing with integrity checks |
| Audit Trail | BLAKE3 hash chain | Certificate Transparency-style tamper-evident ledger |
| Data Sanitization | Sensitive field redaction | Command lines, env vars, file paths sanitized before logging |
| Concurrency Safety | Tokio primitives, no lock-while-await | clippy::await_holding_lock = "deny" |
Cryptographic Standards
| Purpose | Algorithm | Crate |
|---|---|---|
| Audit hashing | BLAKE3 | blake3 1.8.3 |
| Executable hashing | SHA-256 | sha2 0.10.9 |
| Merkle proofs | BLAKE3-based Merkle tree | rs-merkle 1.5.0 |
| Signatures (planned) | Ed25519 | ed25519-dalek |
| AEAD (Enterprise) | ChaCha20-Poly1305, AES-GCM | chacha20poly1305, aes-gcm |
| KDF (Enterprise) | HKDF-SHA256, Argon2id | - |
| TLS (Enterprise) | TLS 1.2+ min, 1.3 preferred | rustls |
Performance Budgets & Benchmarking
Performance Targets
| Metric | Target |
|---|---|
| CPU Usage | < 5% sustained during continuous monitoring |
| Memory | < 100 MB resident under normal operation |
| Process Enumeration | < 5 seconds for 10,000+ processes |
| Database Writes | > 1,000 records/sec |
| Alert Latency | < 100ms per detection rule |
| Query Response | Sub-second for 100k+ events/min |
Benchmark Suite (16 Criterion Suites)
| Crate | Suite | Focus |
|---|---|---|
| procmond | process_collector_benchmarks | Process enumeration performance |
| procmond | wal_benchmarks | Write-Ahead Log throughput |
| procmond | eventbus_benchmarks | Event bus throughput from collector |
| procmond | serialization_benchmarks | Postcard serialization speed |
| procmond | system_benchmarks | System-level monitoring overhead |
| daemoneye-lib | process_collection | Core collection performance |
| daemoneye-lib | database_operations | redb read/write patterns |
| daemoneye-lib | detection_engine | SQL detection rule execution |
| daemoneye-lib | ipc_communication | IPC latency and throughput |
| daemoneye-lib | ipc_performance_comprehensive | Extended IPC analysis |
| daemoneye-lib | ipc_client_validation_benchmarks | Client validation overhead |
| daemoneye-lib | alert_processing | Alert delivery pipeline |
| daemoneye-lib | cryptographic_operations | BLAKE3/SHA2 hashing speed |
| daemoneye-eventbus | throughput | Event delivery rate |
| daemoneye-eventbus | ipc_performance | IPC transport benchmarks |
| collector-core | collector_benchmarks | Collector framework performance |
Resource Management
- Bounded channels with configurable backpressure policies
- Memory budgets with cooperative yielding
- Timeout enforcement and cancellation support
- Circuit breakers for external dependencies
- Graceful degradation when resource-constrained
CI/CD Pipeline
GitHub Actions Workflows
| Workflow | File | Purpose |
|---|---|---|
| CI | ci.yml | Quality (rustfmt + clippy strict), test (nextest + release build), cross-platform matrix, coverage (LCOV + Codecov) |
| Benchmarks | benchmarks.yml | Criterion benchmarks with baseline caching, 20% regression threshold, manual dispatch with suite selection |
| Audit | audit.yml | Dependency vulnerability scanning |
| CodeQL | codeql.yml | Static analysis and security scanning |
| Security | security.yml | Security-focused checks |
| Scorecard | scorecard.yml | OSSF Scorecard security assessment |
| Release | release.yml | Multi-platform release builds |
| Docs | docs.yml | Documentation generation |
| Copilot Setup | copilot-setup-steps.yml | GitHub Copilot workspace configuration |
CI Test Matrix
- Platforms: Linux (ubuntu-22.04), macOS-15, Windows (windows-2022)
- Rust: stable, beta, MSRV (1.91+)
- Quality Gate:
just lint(clippy strict + fmt-check + justfile lint) must pass
Development Commands (justfile — 136 tasks)
| Category | Key Commands |
|---|---|
| Core | just fmt, just lint, just build, just test, just check |
| Benchmarks | just bench, just bench-procmond, just bench-database, just bench-detection, just bench-ipc, just bench-crypto |
| Security | just audit-deps, just deny-deps, just security-scan |
| Distribution | just goreleaser-build, just goreleaser-snapshot, platform-specific test targets |
| Release | just release, just release-patch, just release-minor, just release-major |
Error Handling Architecture
Two-tier error handling strategy:
- thiserror: Structured, typed errors for library boundaries (every module defines its own
#[non_exhaustive]error enum) - anyhow: Contextual errors for binary crate orchestration and error propagation
Key Error Types
| Error Type | Module | Variants |
|---|---|---|
ProcessCollectionError | procmond | 6 (SystemEnumerationFailed, ProcessAccessDenied, ProcessNotFound, InvalidProcessData, PlatformError, CollectionTimeout) |
AlertingError | daemoneye-lib | 11 (SinkError, ConfigurationError, Timeout, SerializationError, IoError, FileSinkError, StdoutSinkError, RateLimitExceeded, DeduplicationError, HealthCheckFailed, UnknownSinkType) |
StorageError | daemoneye-lib | 10 (MissingDirectory, NotADirectory, DirectoryPermissionDenied, DatabaseCreationFailed, DatabaseError, StorageError, TableError, TransactionError, CommitError, SerializationError, IoError, TableNotFound, RecordNotFound) |
CryptoError | daemoneye-lib | 3 (Hash, Signature, Key) |
WalError | procmond | 6 (Io, Serialization, Corruption, InvalidSequence, FileRotation, Replay) |
EventBusConnectorError | procmond | 8 (Wal, EventBus, Connection, BufferOverflow, EnvNotSet, Serialization, PayloadTooLarge, MaxRetriesExceeded) |
RegistrationError | procmond | 7 (RegistrationFailed, RegistrationRejected, Timeout, HeartbeatFailed, DeregistrationFailed, EventBusError, InvalidStateTransition) |
RegistryError | daemoneye-agent | 3 (AlreadyRegistered, NotFound, InvalidHeartbeatInterval) |
CollectorConfigError | daemoneye-agent | 6 (FileNotFound, IoError, ParseError, ValidationError, BinaryNotFound, DuplicateCollectorId) |
Platform Support
| OS | Version | Arch | Status |
|---|---|---|---|
| Linux | Ubuntu 20.04+ LTS, RHEL/CentOS 8+, Debian 11+ | x86_64, ARM64 | Primary |
| macOS | 14.0+ (Sonoma) | x86_64, ARM64 | Primary |
| Windows | 10+, Server 2019+ | x86_64, ARM64 | Primary |
| Linux | Alpine 3.16+, Amazon Linux 2+ | x86_64, ARM64 | Secondary |
| FreeBSD | 13.0+ | x86_64, ARM64 | Secondary |
| Platform-Specific Dependencies: |
- macOS:
security-framework3.5.1 - Windows:
windows0.62.2 (14 Win32 features),windows-service0.8.0,winreg0.56.0 - Unix/FreeBSD:
uzers0.12.2,nix
Internal Dependency Graph
Testing Strategy
Three-Tier Architecture
| Tier | Scope | Tools | Volume |
|---|---|---|---|
| Unit | Individual functions, structs, trait impls | tokio-test, trait mocking, inline #[cfg(test)] modules | ~495 test functions across 61 files |
| Integration | Cross-component, database operations | insta (snapshots), predicates, real redb instances, tempfile | ~39,200 lines in dedicated test files |
| Performance | Regression detection | Criterion (16 benchmark suites), 20% CI threshold | ~6,430 lines of benchmark code |
Quality Enforcement
- Runner: cargo-nextest (parallel execution, failure isolation)
- Coverage: llvm-cov with LCOV output (target: >85%)
- Zero-Warning Policy:
cargo clippy -- -D warningswith no exceptions - Formatting:
rustfmtwith 119-char line length - Environment:
NO_COLOR=1 TERM=dumb cargo test --workspacefor stable output
Known Technical Debt & Implementation Status
| Item | Status | Tracking |
|---|---|---|
| redb Value trait implementations for typed table access | Pending (Task 8) | Stub methods with proper transaction scaffolding in place |
| Merkle tree inclusion proofs via rs-merkle | Planned | Placeholder in AuditLedger::generate_inclusion_proof() |
| Windows privilege detection | Unimplemented | Issue #149 — currently returns degraded mode |
| daemoneye-cli full implementation | Minimal (78 SLOC) | Basic config load + DB stats query only |
| Kernel monitoring (eBPF) | Feature-gated stub | Enterprise tier — kernel.rs module |
| Network correlation | Feature-gated stub | Enterprise tier — network.rs module |
| Webhook and syslog AlertSink implementations | Planned | Factory pattern ready, only stdout and file implemented |
| Ed25519 signature support for audit entries | Planned | Dependency declared, not yet integrated |
Configuration Parameters Reference
| Parameter | Type | Default | Component |
|---|---|---|---|
DAEMONEYE_BROKER_SOCKET | env var | (unset) | procmond — toggles actor vs standalone mode |
scan_interval_ms | u64 | (from config) | agent — RPC polling interval |
startup_timeout | u64 | 60s | agent — wait for collectors |
heartbeat_interval_secs | u64 | 30 | all — periodic health signal |
max_buffer_size | usize | 10MB | procmond — WAL backpressure trigger |
max_queue_size | usize | 1000 | eventbus — per-client queue depth |
ACTOR_CHANNEL_CAPACITY | usize | 100 | procmond — actor mailbox size |
max_concurrent_requests | usize | 10 | procmond — parallel RPC handler limit |
default_timeout | Duration | 30s | RPC — operation timeout |
dedup_window_seconds | u64 | 300 (5 min) | alerting — deduplication window |
Developer Gotchas
Document Metadata
| Field | Value |
|---|---|
| Document Version | 1.0 |
| Created Date | 2026-03-08 |
| Generated From | Codebase analysis (121,850 SLOC), AGENTS.md, Dosu knowledge base, GitHub API |
| Approval Status | Draft |