Skip to content

Commit 0e31d10

Browse files
committed
update readme agent receiver
Change-Id: I04efee9cbde57457be79ec2c3cb66a5c529ccd3c
1 parent ac8873f commit 0e31d10

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

packages/cmk-agent-receiver/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,23 @@ B3 trace-ID middleware) lives in `cmk/agent_receiver/lib/`.
2222

2323
The relay sub-app is only active on editions that support relays.
2424

25+
### mTLS client certificate extraction
26+
27+
Agent and relay endpoints require mTLS authentication.
28+
The custom `ClientCertWorker` (in `worker.py`) extends the Uvicorn worker to intercept H11 protocol frames during the TLS handshake, extract the client certificate's CN, and inject it as a `verified-uuid` HTTP header.
29+
FastAPI endpoint dependencies then validate this header against the UUID in the URL path, preventing application-layer spoofing.
30+
31+
## API
32+
33+
The **agent-receiver** sub-app covers agent registration (including async approval workflows and legacy pairing), certificate renewal, monitoring-data upload, and registration status queries.
34+
All endpoints that operate on a specific agent UUID require mTLS — the client certificate CN is validated against the UUID in the URL path.
35+
36+
The **relay** sub-app covers relay registration, certificate exchange, task management (create / fetch / update), config activation, and forwarding of monitoring data to CMC.
37+
Relay tasks are stored in-memory with a configurable TTL and a bounded per-relay queue depth.
38+
At startup the service schedules an asynchronous background task (with exponential-backoff retry) to push an initial relay config task — startup is not blocked while this completes.
39+
40+
The full endpoint list is available via FastAPI's auto-generated OpenAPI docs at `/<site>/agent-receiver/docs` and `/<site>/relays/docs` when running locally.
41+
2542
## Configuration
2643

2744
The service reads `agent_receiver_config.json` from `$OMD_ROOT` at startup.
@@ -32,6 +49,8 @@ If the file is absent, built-in defaults apply.
3249
| `task_ttl` | `float` | `120.0` | Time-to-live for relay tasks (seconds) |
3350
| `max_pending_tasks_per_relay` | `int` | `10` | Maximum pending tasks per relay |
3451

52+
The environment variables `OMD_ROOT` and `OMD_SITE` must be set (provided automatically by `omd`).
53+
3554
## Development
3655

3756
### Deploying local changes

0 commit comments

Comments
 (0)