Endpoint Agent
Repo: AnyOne-Endpoint (Rust workspace). The per-host agent that runs as the AnyOneAgent
Windows service (anyone-agent.exe). It collects kernel and OS telemetry, runs the OCSF pipeline,
orchestrates static analysis, executes remediation, and manages its own enrollment identity.
Workspace crates
The workspace has five members. Only the drivers and the service run on the endpoint long-term.
| Crate | Binary | Role |
|---|---|---|
service | anyone-agent.exe | The agent itself, covering everything below. |
cli | anyone-agent-cli.exe | Interactive shell that talks to the running agent over a named pipe. |
notifier | anyone-agent-notifier.exe | Helper spawned into the active desktop session to show toast notifications. |
updater | anyone-updater.exe | Boot-time service that verifies a staged update and rolls back on failure. |
shared | (lib) | Types shared across crates: events, the IPC contract, and constants. |
Note: package names for the client/notifier crates (
anyedr-cli,anyedr-notifier) differ from their binary names.
Component view
ℹ️ Arrow colors:
- Blue : data plane (telemetry flow)
- Orange : control plane (commands, enrollment, and remediation actions).
Source tree
The service crate is a single binary. Its source is organized by subsystem.
service/src/
├── main.rs
├── service.rs
├── bootstrap.rs
├── config.rs
├── context.rs
├── event.rs
├── stats.rs
├── constants.rs
├── driver.rs
├── sources/
│ ├── etw/
│ ├── eventlog.rs
│ ├── kcallback/
│ ├── minifilter/
│ ├── lifecycle.rs
│ └── tamperwatch.rs
├── pipeline/
│ ├── normalizer.rs
│ ├── dedup.rs
│ ├── enricher.rs
│ ├── mapper.rs
│ └── batcher.rs
├── channel/
│ ├── remotectl.rs
│ ├── telemetry.rs
│ ├── static_analysis.rs
│ ├── localctl.rs
│ ├── notification.rs
│ ├── ndjson.rs
│ └── handlers/
├── static_api/
│ ├── filter.rs
│ └── worker.rs
├── commands/
│ ├── dispatcher.rs
│ ├── verifier.rs
│ ├── registry.rs
│ ├── trust_bundle.rs
│ ├── kill_process.rs
│ ├── file_quarantine.rs
│ ├── isolate_host.rs
│ ├── update.rs
│ ├── update_package.rs
│ ├── handler.rs
│ ├── context.rs
│ ├── outcome.rs
│ └── noop.rs
├── remediation/
│ ├── executor.rs
│ ├── kill.rs
│ ├── quarantine.rs
│ ├── isolation.rs
│ ├── verdict.rs
│ ├── audit.rs
│ └── types.rs
├── enrollment/
│ ├── identity.rs
│ ├── keystore.rs
│ ├── certmanager.rs
│ ├── stepca.rs
│ ├── tls.rs
│ ├── fingerprint.rs
│ ├── metadata.rs
│ └── startup.rs
└── utils/
├── process_tree.rs
├── bloom_filter.rs
├── hash.rs
├── pipe.rs
├── path.rs
├── install.rs
├── executable.rs
└── user_resolver.rs
External communication
The diagram shows the wires. This table describes what actually crosses each one, the external processes the agent talks to, what moves, and over which protocol. Internal module-to-module calls are omitted.
| From | To | Data | Protocol |
|---|---|---|---|
| AnyOneKcallback (kernel) | sources/ kcallback | Kernel events: process, thread, image load, registry, object, and network activity | IOCTL and shared ring buffer |
| AnyOneMinifilter (kernel) | sources/ minifilter | File-system activity events | Minifilter communication port |
| Event Tracing for Windows | sources/ etw | Operating-system trace events from ETW providers | ETW real-time session |
| Windows Event Logs | sources/ eventlog | Windows event-log records | Event Log subscription |
channel/ telemetry | Gateway | Batched OCSF telemetry | gRPC, mTLS |
channel/ remotectl | Gateway | Up: enrollment, heartbeats, and command results. Down: signed commands and trust bundles | gRPC bidirectional stream, mTLS |
channel/ staticanalysis | Static Analysis API | Files to scan and hashes to look up, with verdicts returned | HTTPS, mTLS |
enrollment/ certmanager | step-ca | Certificate bootstrap (CSR signing) and renewal | HTTPS, pinned root |
| AnyOne CLI | channel/ localctl | Local operator commands and status queries | Named pipe |
channel/ notification | AnyOne Notifier | Toast notification requests | Child-process handoff |
Module layout (service)
What each module and subsystem is responsible for.
Entry / host:
| Module | Responsibility |
|---|---|
main.rs | Development-only entry point for running the agent directly from the command line. Slated for removal, since production installs run the agent as a Windows service with its entry point in service.rs. |
service.rs | The production entry point. Registers with the Service Control Manager, handles start and stop requests, and brings up the subsystems: configuration, shared state, the control channel, the pipeline, and the sources. |
bootstrap.rs | One-time startup setup: process hardening, acquiring the privileges the agent needs, and initialising logging. |
config.rs | A global configuration singleton populated from environment variables. |
context.rs | Shared runtime state handed to every subsystem. |
event.rs | The internal event model and the set of telemetry sources. |
stats.rs | Runtime counters used for metrics and diagnostics. |
constants.rs | Fixed values shared across the service. |
driver.rs | Transport to the AnyOneKcallback kernel driver. Opens the device and moves telemetry and commands across the kernel boundary. |
Subsystems:
| Module | Responsibility |
|---|---|
sources/ | Collectors that gather telemetry from the kernel drivers and the operating system. |
pipeline/ | Transforms raw events into batched OCSF telemetry through normalize, deduplicate, enrich, map, and batch stages. |
channel/ | All external transport: the telemetry and control channels to the gateway, the static-analysis client, the local CLI server, and the notifier handoff. |
static_api/ | Orchestrates static-analysis API calls, using a local filter to decide which files actually need a scan. |
commands/ | Receives commands from the server, verifies their signatures, and dispatches them to the matching handler. |
remediation/ | Executes response actions (kill process, quarantine file, isolate host) and records an audit trail. |
enrollment/ | Manages the agent’s cryptographic identity: enrollment, secure key storage, and certificate renewal. |
utils/ | Shared helper routines used across the service. |
Configuration
The agent takes all of its configuration from environment variables, read once at startup into a global configuration singleton. There is no configuration file the agent parses itself.
How those variables are set depends on the install path:
- Normal (dashboard) install. The installer provisions the credentials and writes the configuration for you, so there is nothing to set by hand.
- Manual install. You write the variables yourself as the service’s registry
Environmentvalue, which the Service Control Manager injects into the process when it starts.
The mandatory variables are:
| Variable | Purpose |
|---|---|
GRPC_ENDPOINT | Gateway address for the telemetry and control channels. |
KERNEL_DRIVER_PATH | Location of the AnyOneKcallback driver file. |
MINIFILTER_DRIVER_PATH | Location of the AnyOneMinifilter driver file. |
CA_URL, CA_FINGERPRINT, CA_PROVISIONER | step-ca connection and root pinning for enrollment. |
ENROLLMENT_CERT_SUBJECT | The device id, which must match the enrollment certificate. |
ENROLLMENT_X5C_CERT_PATH, ENROLLMENT_X5C_KEY_IMPORT_PATH | The delivered device credential. |
COMMAND_ANCHOR_PUBLIC_KEY_BASE64 | Anchor public key used to verify signed commands. |
For the full procedure and every available setting, see Manual Installation → Configuring the Agent in the Installation Guide.
Library inventory
Key third-party libraries the agent depends on, for traceability when reading the code.
| Library | Used for |
|---|---|
tokio | Asynchronous runtime for all concurrent tasks. |
tonic, prost | gRPC transport and Protocol Buffers encoding. |
anyproto | Shared AnyOne protobuf contracts for telemetry and control. |
reqwest | HTTP client for the Static Analysis API. |
windows, windows-service | Windows system APIs and Windows service integration. |
ed25519-dalek | Verifying signed server commands. |
p256, pkcs8, rcgen, x509-parser | Enrollment certificates and key handling. |
xorf | Local membership filter for the static-analysis pre-check. |
arc-swap | Hot-swapping the rotating identity and filter without a restart. |
sha2, hex, base64 | Hashing and encoding. |
serde, serde_json, postcard | Serialization. |
quick-xml | Parsing Windows event-log XML. |
dashmap, once_cell | Shared concurrent state. |
clap | Command-line parsing. |
flexi_logger, log | Logging. |
zip | Extracting update packages. |