Dosu LogoDosu Logo
Ask
Join our Discord
Organization avatar
DaemonEyePublic
EvilBit Labs LLC
DocumentsDaemonEye
IPC Endpoint Path Generation
IPC Endpoint Path Generation
Type
Document
Status
Published
Created
Dec 3, 2025
Updated
Dec 3, 2025
Updated by
Dosu Bot

IPC Endpoint Path Generation in collector-core#

collector-core generates Inter-Process Communication (IPC) endpoint paths using a secure, platform-aware mechanism that ensures both security and test isolation. The approach differs slightly between production and testing environments, and between Unix and Windows platforms.

Mechanism Overview#

When initializing an IPC server, collector-core calls a function to create the endpoint path. On Unix systems, this function creates a secure temporary directory (using the tempfile crate) with a daemoneye- prefix. The socket file is then placed inside this directory. In production, the socket name includes a UUID to guarantee uniqueness; in tests, a shorter name derived from the process ID is used to avoid exceeding Unix socket path length limits (SUN_LEN). If the generated path is too long, the system falls back to a short name like s.sock within the temporary directory. On Windows, the endpoint is a named pipe with a unique suffix, such as \\.\pipe\daemoneye\collector-{unique_id}. The temporary directory handle is retained for the server's lifetime to ensure the socket remains accessible and is cleaned up automatically when the server shuts down [source].

Secure Temporary Directories and Unique Socket Names#

For testing, collector-core always generates a new temporary directory and a unique socket name for each test run. This is achieved by using the process ID modulo 10000 as part of the socket name, which keeps the path short and unique. The use of temporary directories ensures that each test has its own isolated environment, preventing interference between concurrent or repeated test runs. The temporary directory is created with permissions set to 0700, and the socket file itself is set to 0600, restricting access to the owner only [source].

Rationale and Security Implications#

This design provides several benefits:

  • Security: By placing sockets in directories with restrictive permissions and using owner-only socket files, unauthorized access is prevented. The IPC system is strictly local, with no network exposure, further reducing the attack surface [source].
  • Reliability: Unique socket names and isolated directories prevent collisions and ensure that sockets are cleaned up automatically, reducing the risk of stale or orphaned sockets causing failures in subsequent runs.
  • Test Isolation: Each test run operates in its own temporary directory with a unique socket, eliminating cross-test interference and making tests more reliable and reproducible [source].

Customizing IPC Endpoint Paths#

While the default behavior is to generate endpoint paths automatically, users can customize the IPC endpoint path via configuration. The IPC configuration structure (IpcConfig) includes an endpoint_path field. You can set this field programmatically or via a configuration file.

Example YAML configuration:

ipc:
  endpoint_path: "/tmp/custom-daemoneye.sock" # Unix/macOS
  # OR
  endpoint_path: "\\\\.\\pipe\\custom-daemoneye" # Windows

This allows you to specify a fixed location for the IPC socket or named pipe if needed for integration with other components or for debugging purposes [source].

Programmatic configuration example (Rust):

let config = IpcConfig {
    endpoint_path: "/tmp/my-custom.sock".to_string(),
    // ... other fields ...
};

Summary Table#

EnvironmentDirectory/SecuritySocket NameCustomizable?
Production (Unix)Secure temp dir (0700)c{UUID}.sock (fallback to s.sock if needed)Yes
Test (Unix)Secure temp dir (0700)c{pid%10000}.sockYes
Production (Windows)N/A\\.\pipe\daemoneye\collector-{UUID}Yes
Test (Windows)N/A\\.\pipe\daemoneye\test-ipc-client-{unique}Yes

Additional Reliability Features#

The IPC system also supports automatic reconnection with exponential backoff, connection limiting, and configurable timeouts, further improving robustness in both production and test environments [source].

For more details, see the collector-core IPC implementation and the technical documentation.

Documents
Alerting and Detection Engine
Alerting and Detection Engine
Alerting and Detection Engine Updates
Alerting Data Model and Configuration Updates
core-monitoring
query-pipeline
windows-process-collector
API Reference
Checksum Implementation
collector-core Capabilities and Lifecycle
ProcessEventSource Configuration and Integration
protobuf-ipc
Architecture
Checksum Implementation
Extensible Monitoring Architecture
IPC Migration to interprocess Crate
process-management
ProcessEventSource Configuration and Integration
query-pipeline
security_design_overview
topic-hierarchy-design
CI and Automation Workflows
CI and Automation Hooks
Docker Container Best Practices
release-process
CollectionEvent Model
integration-guide
collector-core Framework
collector-core Capabilities and Lifecycle
collector-core Framework
core-monitoring
Extensible Monitoring Architecture
integration-guide
IPC Endpoint Path Generation
multi_collector_coordination
Process Event Source Integration
process-management
ProcessEventSource Configuration and Integration
procmond Process Collection Integration
procmond Refactor and Integration
README
Contributing
Docker Container Best Practices
README
Testing Standards and Tooling
Event Bus Architecture
message-schemas
protobuf-ipc
README
topic-hierarchy
topic-hierarchy-design
IPC Protocol
Checksum Implementation
CRC32C Checksum Usage in IPC
IPC Endpoint Path Generation
IPC Migration to interprocess Crate
IPC Protocol and Migration
ipc_client_validation
procmond Refactor and Integration
protobuf-ipc
Testing Strategy for CLI and IPC
Platform-Specific Event Capture
core-monitoring
windows-process-collector
procmond
core-monitoring
Process Event Source Integration
process-management
ProcessEventSource Configuration and Integration
procmond Process Collection Integration
procmond Refactor and Integration
protobuf-ipc
windows-process-collector
Project Overview
README
SECURITY
security_design_overview
Rust Async Patterns
IPC Migration to interprocess Crate
IPC Protocol and Migration
Rust Async Patterns and Best Practices
Security
IPC Endpoint Path Generation
IPC Migration to interprocess Crate
SECURITY
security_design_overview
Testing Strategy
Alerting and Detection Engine Updates
CI and Automation Hooks
collector-core Capabilities and Lifecycle
CRC32C Checksum Usage in IPC
IPC Migration to interprocess Crate
ipc_client_validation
ProcessEventSource Configuration and Integration
procmond Refactor and Integration
testing
Testing Standards and Tooling
Testing Strategy for CLI and IPC
Workspace Management
README
release-process
SECURITY
Workspace and Dependency Management
SUMMARY
architecture
collector-core-framework
contributing
correlation-metadata
embedded-broker-architecture
eventbus-architecture
getting-started
introduction
ipc-implementation
macos-process-collector
project-overview
rpc-eventbus-architecture
rpc-patterns
security
sql-dialect-reference
system-architecture
task-distribution
technical