Run the MSN hub
MSN is the hub at the middle of the pyramid. The modules send it their performance logs and event logs. It stores them in OpenSearch, chained by hash and signed every minute, so a record changed or deleted later is detected. AVACOM asks it for evidence, and it forwards critical events and tamper alarms to AVACOM as alerts.
It runs as three containers: msn-opensearch (OpenSearch 3.9), msn-bootstrap (a one-off job that creates the
indices and MSN’s own OpenSearch user) and msn (the service: HTTP on port 8090, syslog on port 5514).
Run it for evaluation
Section titled “Run it for evaluation”-
Add MSN’s secrets to the
.envfile next todocker-compose.yml:Terminal window python scripts/generate_secrets.py --missing-from .env >> .envThis adds
MSN_OPENSEARCH_ADMIN_PASSWORD,MSN_OPENSEARCH_PASSWORDandMSN_ADMIN_KEY(an admin key that starts withmsn_). -
Start it. Compose waits for OpenSearch to be healthy and for the bootstrap to finish:
Terminal window docker compose --profile msn up -d msncurl http://127.0.0.1:8090/health -
Issue an ingest key for each source. An ingest key writes to exactly one stream:
Terminal window curl -X POST http://127.0.0.1:8090/v1/keys -H "Authorization: Bearer $MSN_ADMIN_KEY" \-H "Content-Type: application/json" \-d '{"name": "db-core-01", "role": "ingest", "stream": "db-core-01"}' -
Connect MSN to AVACOM in both directions.
Locally OpenSearch uses its demo certificates, so the TLS check between MSN and OpenSearch is off. Do not use this set-up for real data.
Keys and roles
Section titled “Keys and roles”Send a key as Authorization: Bearer msn_... or in the X-MSN-Key header. Keys are stored hashed, and issuing or
revoking one is logged in MSN’s own stream.
| Role | Can |
|---|---|
ingest |
Write to its one stream (POST /v1/events) |
reader |
Search and answer evidence queries; give this one to AVACOM |
auditor |
Verify streams, read and make checkpoints, run the integrity check |
admin |
Issue and revoke keys |
The stream names syslog:… and msn:… are reserved for MSN itself.
Getting logs in
Section titled “Getting logs in”- The ingest API:
POST /v1/eventswith one JSON event, a JSON array, or NDJSON. The key decides the stream. An event has@timestamp,severity,category,message, and optionallyhost,service,user,action,outcomeandattributes. A performance log carries its measurement inattributes:metric,value,unitandthreshold. - Syslog (RFC 5424 or 3164) over UDP or TCP on port 5514, one stream per sender address. Only addresses in
MSN_SYSLOG_ALLOWED_NETWORKSare accepted; with it empty, no sender is. - OpenTelemetry:
POST /v1/otlp/v1/logsand/v1/otlp/v1/metrics(OTLP over HTTP, protobuf or JSON) with an ingest key. A collector’sotlp_httpexporter sends there withendpoint: https://msn.bank.internal/v1/otlp. A request holds at most twiceMSN_MAX_BATCHlog records or data points and 4 MiB once inflated; MSN counts them before it reads any and refuses a larger request (413) with nothing written. A request within them is written whole or not at all. - Agents: the AVACOM collector bundle (OpenTelemetry Collector) for Windows and Linux servers, databases and network devices, with installers: see Connect servers and network devices.
MSN never rejects an event for what it holds. Anything malformed, too large or too deeply nested is stored with a
note, because a log agent treats any answer as delivered. It refuses a whole request only for its size (413) or its
rate: a stream that sent more than MSN_MAX_RECORDS_PER_MINUTE records in the last minute gets 429 with Retry-After,
and the agent resends after it.
curl -X POST http://127.0.0.1:8090/v1/events -H "Authorization: Bearer $INGEST_KEY" \ -H "Content-Type: application/json" \ -d '{"@timestamp": "2026-10-14T07:43:55Z", "severity": "error", "category": "system", "host": "db-core-01", "service": "postgres", "message": "Mount /mnt/wal-archive changed to read-only"}'Severities are emergency, alert, critical, error, warning, notice, info and debug. Categories are
auth, access, config, database, network, application, system, security, performance and other.
Settings
Section titled “Settings”| Variable | Default | What |
|---|---|---|
MSN_OPENSEARCH_URL |
https://msn-opensearch:9200 |
The OpenSearch cluster |
MSN_OPENSEARCH_USER, MSN_OPENSEARCH_PASSWORD |
msn, – |
MSN’s own OpenSearch user (created by the bootstrap) |
MSN_OPENSEARCH_CA_FILE, MSN_OPENSEARCH_VERIFY_CERTS |
–, true |
TLS to OpenSearch |
MSN_ADMIN_KEY |
– | The first admin key: msn_ and at least 32 characters |
MSN_RETENTION_DAYS |
400 |
How long records are retained |
MSN_SYSLOG_UDP_PORT, MSN_SYSLOG_TCP_PORT |
5514 |
Syslog ports (0 turns UDP off) |
MSN_SYSLOG_ALLOWED_NETWORKS |
(none) | Addresses allowed to send syslog, for example 10.20.0.15/32,10.20.0.16/32 |
MSN_MAX_BATCH |
1000 |
Events per /v1/events request (OTLP: twice this) |
MSN_MAX_RECORDS_PER_MINUTE |
30000 |
Records per stream per minute over the ingest APIs (0: no limit) |
MSN_CHECKPOINT_INTERVAL |
60 |
Seconds between signed checkpoints |
MSN_INTEGRITY_INTERVAL |
3600 |
Seconds between full integrity checks |
MSN_AVACOM_URL, MSN_AVACOM_API_KEY |
– | Where to forward events, and an AVACOM key with the webhook role |
MSN_FORWARD_MIN_SEVERITY |
critical |
The lowest severity forwarded (tamper alarms always are) |
MSN_SIGNING_KEY_FILE, MSN_LEDGER_FILE |
under /state |
The signing key and the checkpoint ledger: back them up |
Any of them can be read from a file instead: set <NAME>_FILE to its path.
For a bank
Section titled “For a bank”- A three-node OpenSearch cluster with the bank’s own certificates (
MSN_OPENSEARCH_CA_FILE). - TLS in front of MSN, since API keys travel in every request.
- Syslog over TCP with TLS, from registered senders only: one
/32per device inMSN_SYSLOG_ALLOWED_NETWORKS(UDP sender addresses can be forged). - Back up
/state: the signing key and the ledger. Without the signing key MSN refuses to start. - Give the auditors the public key (
GET /v1/public-key) and export the checkpoints (GET /v1/checkpoints) to storage outside MSN. - Set
MSN_RETENTION_DAYSto the bank’s rule. PCI DSS asks for 12 months, with 3 immediately searchable.