splice-topology-key-monitor Helm chart deploys a small service that watches the topology state of a participant and logs a warning whenever a topology transaction or proposal signed by one of a configured set of keys appears. Use it to get alerted when one such key is used.
The chart is available starting with Splice 0.9.5.
How it works
The monitor runs a Canton console script against the admin API of your participant. On every poll it:- Looks up the synchronizers registered on the participant under the configured aliases (
globalby default). - Lists the topology transactions and the topology proposals on each of these synchronizers that became effective since the previous poll.
- Logs a
WARNline for every transaction or proposal that carries a signature from one of the tracked keys. The line states whether it is a transaction or a proposal, the synchronizer, the matched key fingerprints and the full transaction.
Installing the monitor
Create a values file, for exampletopology-key-monitor-values.yaml:
sv namespace:
Configuration
Participant admin API authentication
By default the monitor calls the admin API of your participant without credentials. If you have enabled authentication on the participant admin API (adminApi.disableAuth: false in the values of the splice-participant chart, enabled by default from 0.11.0), the monitor needs credentials of its own.
Support for authenticating the monitor is available starting with Splice 0.10.4. Authentication on the participant admin API itself is available starting with Splice 0.10.3.
topology-key-monitor, and that only allows the following services of the admin API:
com.digitalasset.canton.topology.admin.v30.TopologyManagerReadServicecom.digitalasset.canton.admin.participant.v30.SynchronizerConnectivityServicecom.digitalasset.canton.connection.v30.ApiInfoService
Creating the credentials
The charts expect the following objects in the namespace of your participant. Their names and the claims of the token are fixed:
The following script creates both. It needs
openssl and kubectl, and discards the private key when it finishes:
Enabling the authentication
Create the objects before you change any Helm release. Once the participant is configured to use the ConfigMap, its pod does not start without it, and the monitor pod does not start without the Secret.-
Add the following to the values of your
participantrelease and upgrade it. The value only takes effect if authentication is enabled on the participant admin API, and is ignored otherwise. -
Add the following to the values of your
topology-key-monitorrelease and upgrade it:
Rotating or revoking the credentials
To rotate the credentials, run the script again. The new certificate replaces the old one, so tokens signed with the previous key stop working. If Stakater Reloader is installed in your cluster, the participant and the monitor restart automatically when the ConfigMap and the Secret change, as the charts enable Reloader by default. Otherwise restart both deployments yourself:enableTopologyKeyMonitorAccess back to false, upgrade the participant release, and delete the ConfigMap and the Secret.
Alerting
The monitor logs JSON to stdout from thetopology-key-monitor container. Configure your log-based alerting to fire on every log line with level WARN or higher from that container.
If your alerting already fires on all warnings from the namespace of your participant, exclude the topology-key-monitor container from that alert and add a dedicated one, so that a tracked-key match is not hidden among other warnings.