proone-hostinfod
Daemon that implements an authoritative Heartbeat host, collecting host information from Proone instances and storing it in a MariaDB database.Overview
proone-hostinfod provides a centralized collection point for Proone instance telemetry. It implements the server side of the Heartbeat protocol and stores received data in a relational database.Usage
Configuration File
The daemon uses a YAML configuration file with the following structure:Configuration Parameters
Database Settings
db.host: MariaDB server hostname (required)db.port: MariaDB server port (default: 3306)db.user: Database user (required)db.pw: Database password (optional)db.db: Database name (required)db.table_prefix: Prefix for table names (default: “prne-”)
TLS Settings
All TLS parameters are required:ssl.ca: Path to CA certificatessl.crt: Path to server certificatessl.key: Path to server private keyssl.key_pw: Password for encrypted private key (optional)ssl.dh: Path to Diffie-Hellman parameters
Connection Settings
max_conn: Maximum concurrent connections (default: unlimited)db_q_size: Maximum database queue size (default: unlimited)report_int: Interval for reporting max connections warning (ms)sck_op_timeout: Socket operation timeout (ms, default: 5000)
Server Settings
nb_thread: Number of client handler threads (default: number of CPUs)backlog: Listen backlog (default: 10)listen_port: TCP port to listen on (default: 64420)verbose: Logging verbosity level (0-5, default: 2)
Database Schema
The daemon creates a table named<table_prefix>hi with the following schema (see src/data/sql/hi-create.sql):
instance_id: UUID of the instanceorg_id: Organization UUIDinserted: First seen timestampupdated: Last seen timestampparent_uptime: Parent process uptimechild_uptime: Child process uptimebne_cnt: Number of BNE attemptsinfect_cnt: Number of successful infectionsparent_pid: Parent process PIDchild_pid: Child process PIDprog_ver: Program version UUIDboot_id: System boot IDcred_id: Host credential usernamecred_pw: Host credential passwordcrash_cnt: Number of crashesarch: CPU architecture codeos: Operating system codeflags: Instance flags bitfieldipaddr: Source IP address
Protocol
The daemon implements the Heartbeat protocol:- Client connects via TLS
- Mutual certificate verification
- ALPN negotiation (must be “prne-htbt”)
- Client sends
OP_SOLICITrequest - Server responds with
OP_HOST_INFOrequest - Client responds with host information
- Server stores data in database
- Connection closes
Threading Model
- One database thread handles all database operations
- Multiple client handler threads (configurable)
- Each client handler uses poll() for event-driven I/O
- Non-blocking SSL handshakes and I/O operations
Exit Codes
| Code | Description |
|---|---|
| 0 | Success |
| 1 | Runtime error (database, network, etc.) |
| 2 | Configuration error |
Dependencies
- MariaDB Connector/C
- mbedtls (TLS)
- libyaml (configuration parsing)
Source
Location:src/proone-hostinfod.c
Sample configuration: src/data/hostinfod.conf.sample
Database schema: src/data/sql/hi-create.sql