⚠️ Heads-up: beta feature. CMR exists only in RouterOS 7.26, available today only as a beta. What follows is lab analysis of a non-stable release: the syntax, the wire format and the behaviours can change from one beta to the next (we watched them change: on an earlier beta the control certificate was even encoded in a non-standard way, later fixed). This is not production material — it is to understand what you sign up for when you turn CMR on, and how to protect yourself once it goes stable.

In the first article on CMR, the fleet controller inside RouterOS, we saw what it does: it discovers routers, adopts them, runs mass commands, upgrades, alerts. Here we look under the hood: how the controller and the clients talk on the wire, and why the whole fleet’s trust rests on one key — with a security consequence worth knowing before you expose the service.

One lock only: TLS, not «end-to-end»

CMR’s management channel is a mutual TLS 1.2 connection on port 54321: both ends present an Ed25519 self-signed certificate (the common name looks like figman-<public-key fingerprint>). So far so good — on the wire you see only ciphertext, we verified it packet by packet: nothing leaks in clear outside the TLS.

The point is what is inside that tunnel. CMR’s application protocol has no second, end-to-end encryption layer: TLS is the only protection. In practice: anyone able to terminate that TLS — that is, anyone who holds the controller’s identity — reads the management protocol in clear. CMR’s security, then, isn’t «there’s TLS»: it is «the key that signs the TLS must not get out».

M3: how CMR talks on the wire

Inside the TLS, messages use a binary serialization we’ll call m3 (it is CMR’s same data model put on the wire in a form different from the one used in backups). It is compact but readable once TLS is stripped: no obfuscation, no application-layer signature.

Take the most telling case, a run-script command (the controller makes a client execute a command). By terminating the TLS in the lab, the command record decodes like this — here with a harmless test command, :put "...":

run-script record (controller -> client), made readable:
  type        : 05            (run-script request)
  length      : ...
  command     : 3a 70 75 74 ...   ->  :put "...TEST..."      <-- in clear
  user        : 61 64 6d 69 6e    ->  admin                  <-- in clear
  seq         : .. .. .. .. .. .. .. ..   (8-byte counter)

reply (client -> controller): same seq + command output, in clear

You see what matters: the command, the user (admin) and the client’s output travel in clear inside the TLS. The same is true of inventory and telemetry (identity, hardware, software, interfaces, polled every ten seconds). Whoever terminates the TLS reads the entire control plane as if it were text.

A good thing, worth stressing: the device password, used during adoption, never appears on the wire. Pairing uses a zero-knowledge password exchange (a PAKE, in the SPAKE2 family): the password is used to derive keys, it is not transmitted — not even in clear inside the TLS. Over thousands of captured records, zero occurrences of the password. This part is done right.

Trust is one key: the «local-id»

Every CMR node — controller and client — has an identity: an Ed25519 key pair, exposed in the configuration as local-id. The fleet’s trust is all here: the controller is «the one holding that key», the clients recognize it by its public key. There is no separate secret: whoever holds the local-id is the controller, in the eyes of the already-adopted clients.

So the security question becomes a single one: that private key — who can read it?

Mind «sensitive»: the controller’s key comes out read-only

In RouterOS the permission to see secret values (passwords, keys, PSKs…) is the sensitive policy. And here is the trap: the factory read group — the one you give to a «read-only» account — includes sensitive. Result: a read-only account can read the controller’s local-id, in clear, over the REST API:

# with a user in the factory "read" group (read-only!)
GET /rest/cmr        ->  "local-id": "6E24....."   (full key)
# same from the console: /cmr export show-sensitive

The console does not show it in a plain print, which gives a false sense of secrecy: but show-sensitive and REST return it. A «read» account, which we usually treat as harmless, here hands over the controller’s identity.

The client side is one notch better protected: its key is not returned to a read-only account (the field is omitted), you need a write account to read it. And the backups? That one deserves its own section, because the answer is surprising — and it loops right back to sensitive.

Backups and identity: you can’t clone a controller from the file

⚠️ We are in beta: this behaviour can change. That said, it is worth knowing today, because it overturns an intuitive idea («I back up the controller, restore it elsewhere, and the fleet resumes»). We opened an unencrypted backup of the controller packet by packet: the public keys of the identities and the peer records are in clear, but of the private seed there is no trace — not in clear, not reversed or base64, not as a high-entropy encrypted blob (we scanned the whole file: the only 32-byte «random-looking» blocks are the two public keys). And the encrypted backup? Same substance, and we tested it end to end: restored onto a blank box.

After the restore (encrypted included) the general configuration comes back — the hostname becomes the controller’s again — but /cmr is empty: no local-id, controller not active, no self-client-id. Meanwhile a client that had already been adopted is left hanging like this:

/rest/cmr/client (on the client, after the controller is powered off):
  "controller-identity" : "cmr-srv"
  "controller-addresses": "10.0.0.10"
  "status"              : "paired,disconnected"   <-- it waits for the KEY, not the name

The client is not looking for «a box called cmr-srv»: it waits for the one that holds the key of the original controller. A controller rebuilt from the backup necessarily has a different key → the client sees it as a stranger and rejects it, staying disconnected. Lab counter-proof: the instant we power the real controller back on (the one with its key in persistent store), the client reconnects on the first attempt. Blunt takeaway: the fleet does not come back from a backup, and you cannot clone a controller by restoring its file.

So where is the identity, and how do you really save it? Not in the backup: in the live configuration. The local-id is a readable and writable config field, and the «identity export» already exists — it is /cmr export show-sensitive, which serializes it as a re-applicable command:

/cmr
set controller-addresses=10.0.0.10 enabled=yes \
    local-id="6E24…2CA2C816 31B83DBD…661F42DB"    <-- public(64 hex) + seed(64 hex)
/cmr client
set … local-id="7F6ADB…C2E1"                      <-- the controller's self-client-id
/cmr device
add identity=cmr-c3 ids="…/6E24…C816" labels=lab   <-- peer table (public keys only)

And it really works: we proved it packet by packet. We took a second box (a «spare» controller), first gave it a different identity and then re-injected the local-id exported from the original controller, watching the state of an already-adopted client (/cmr/client over REST):

spare box, DIFFERENT identity              -> client: "paired, disconnected"   <-- refused (wrong key)
re-inject the exported local-id (original) -> client: "paired, connected"      <-- re-adopted, with NO re-pairing

The client follows the key, not the name or the IP: with the right key it adopts a box it had never seen; with any other key it refuses it. So here is the double edge. On one side, this is the real way to save or move a controller: you keep the show-sensitive export (the local-id and the /cmr device table) and re-apply it on the new box — not the backup restore. On the other, it is a security alarm that doubles the point of the previous section: that same show-sensitive — and REST with sensitive, a policy the factory read group holds — returns the full set local-id=… line, that is the controller’s re-injectable identity, to a read-only account. Encrypting backups is still good practice (they hold other router secrets), but the real crown jewel — the fleet’s root of trust — is not in the backup file: it lives in the config, behind the sensitive permission, and that is where it must be guarded.

The control plane in clear: a MITM reads it all (shown in the lab)

Put the pieces together. The channel is per-leg TLS with no end-to-end; the controller’s identity can be read with a read-only account. Whoever obtains both identities (controller and a client) and sits on the management network can step in the middle: it presents the controller’s identity to the client and the client’s identity to the controller, terminates the two TLS sessions, and reads the whole protocol in clear — commands, output, inventory, username.

We reproduced it in the lab with a relay in the middle: pairing went through the relay and the run-script records were captured in clear. An honest note: because there is no end-to-end integrity, the same party that reads is also in a position to tamper with the traffic — this is a structural risk of «no E2E», not a recipe we publish here. The barrier isn’t magic: it is protecting the identities and the management network.

In fairness, the picture is not «anyone, from the Internet»: it takes a position on the management segment and it takes reading the keys (read-only for the controller, a write account for the client). It is not a wide-open door — but it is a serious reason not to treat «read-only» and «54321» lightly.

Securing CMR

All of the above is neutralized with a few choices, all already available:

  • No sensitive for read-only accounts. Make a dedicated group, without that policy, for those who only need to look:
    /user group add name=monitor policy=read,api,rest,winbox,!sensitive,!write,!policy
    /user set [find group=read] group=monitor
  • Close 54321 to everything that is not management. The control plane must not be exposed:
    /ip firewall filter
    add chain=input protocol=tcp dst-port=54321 src-address-list=mgmt action=accept
    add chain=input protocol=tcp dst-port=54321 action=drop
  • Limit write accounts. The clients’ key only falls with a write account: keep them few and separate.
  • Adoption with confirm, not automatic. Set pairing-requirement=confirm (the «automatic» adoption accepts anyone on the L2).
  • CMR client off if not needed. It is disabled at factory: leave it so until you really need it.
  • Encrypt backups, but know what they do NOT protect. The CMR identity seed does not end up in the backup, encrypted or not (see above): so the backup password does not defend the root of trust — it defends the other router secrets, which are there too. The identity must be protected where it actually lives: behind the sensitive permission.
  • Treat the show-sensitive export as the master key. That is where (not in the backup) the re-injectable local-id lives: whoever reads it can impersonate the controller. Restrict who can run /cmr export show-sensitive and REST with sensitive, and store that export the way you would store a private key.
  • Wait for stable. It is beta: that holds for production, and it holds double for a feature that has the whole fleet in its hands.

A confident note

CMR already does one right and important thing: the password never goes on the wire (PAKE). The rest is a question of maturity of a feature still in beta. We trust that MikroTik, towards stable, will add end-to-end integrity/encryption to the management protocol, tighten the exposure of the local-id (for example behind a permission stronger than plain read) and offer a controller identity recovery worthy of a fleet — a dedicated export/restore or real HA, so that the death of one box does not force you to re-adopt everything. Meanwhile the defense is entirely in our hands, and it is simple: protect the identities, isolate 54321, encrypt the backups. A fleet controller is wonderfully convenient — but it concentrates a lot of trust in one single spot, and that spot must be guarded accordingly.