Proto Contracts
Repo: AnyProto (protobuf, Buf). The central wire ABI, consumed everywhere as the anyproto
crate (prost messages + tonic stubs). Two concerns live here: the control channel between agent
and gateway, and the OCSF telemetry schema.
Proto tree
Control channel (endpoint/v1/endpoint.proto)
One service, one bidirectional stream — there is no separate enrollment or telemetry service
here (enrollment rides in-band on Hello.shared_enrollment_secret; telemetry lives in ocsf.v1).
service EndpointService {
rpc EndpointChannel(stream EndpointChannelRequest)
returns (stream EndpointChannelResponse);
}
| Direction | Envelope oneof | Messages |
|---|---|---|
| endpoint → server | EndpointChannelRequest | Hello, Heartbeat, CommandResult |
| server → endpoint | EndpointChannelResponse | Command, TrustBundle |
Hello—endpoint_id,mac_addr,public_key(bytes),shared_enrollment_secret,HelloMetadata(hostname, os, agent_version, mac_addresses[], machine_uuid). First frame.Command—endpoint_id+bytes raw(opaque, backend-signed).TrustBundle—endpoint_id+bytes raw(anchor-signed signing-key bundle).CommandResult—command_id,ResultStatus(OK/ERROR/SIG_ERROR/TARGET_REJECTED/EXPIRED),detail.
OCSF telemetry (ocsf/v1/)
The schema is not one message per class. There is a single flat OcsfEvent (event.proto) with
a class_uid discriminator and many optional object fields; each field is annotated with the
class_uid that populates it. The telemetry service is OcsfEventService with unary
OcsfBatch(OcsfBatchRequest{agent_id, events}) → OcsfBatchResponse{accepted, rejected, errors}
(ocsf.proto).
Class UIDs actually used (verified against event.proto — note the corrections from earlier
project docs):
| Class | UID | Field |
|---|---|---|
| FileSystemActivity | 1001 | file / file_result |
| KernelExtensionActivity | 1002 | |
| ModuleActivity | 1005 | module |
| ScheduledJobActivity | 1006 | job |
| ProcessActivity | 1007 | process |
| ScriptActivity | 1009 | |
| RegistryKeyActivity | 201001 | reg_key |
| RegistryValueActivity | 201002 | |
| WindowsServiceActivity | 201004 | |
| ProcessRemediation | 7003 | command_uid |
| NetworkActivity / DnsActivity | 4001 / 4003 | |
| AccountChange / Authentication | 3001 / 3002 | |
| DetectionFinding | 2004 |
Corrections vs older docs: Module is 1005 (1006 is ScheduledJob); remediation is 7003; there is no
999999agent-lifecycle class in the proto.
Streaming/ML messages (EnrichedEvent, WindowResult, AnomalyDetected) and the enrich.v1
IpReputation type also live here but belong to downstream correlation, out of this project’s scope.
Consumption
Consumed as a git dependency tracking main (or pinned to a rust/v… tag):
anyproto = { git = "https://github.com/MarkAny-GaneshaIT/AnyProto", branch = "main" }
Buf codegen (buf.gen.yaml) runs neoeinstein-prost + neoeinstein-tonic + a crate generator; the
generated crate is committed at gen/rust/ and CI regenerates it on push. Cargo features
endpoint-v1, enrich-v1, ocsf-v1 (+ proto_full) let a consumer compile only the packages it
uses.