Management on its own network
Manage every device from a network of its own, and let only that network reach the device's login services.
Why
Whoever logs in to a device controls the traffic through it. A login service that answers the whole internet can be tried by anyone, and a flaw in it gives the device away without a password.
In 2021, the Mēris botnet set a record of 21.8 million requests a second, with floods from tens of thousands of routers. Their vendor said most had been broken into in 2018, through a flaw in a management service. The flaw was patched that year, but updating didn't close a router whose stolen password was never changed. A router that answers management only from its own network can't be reached that way.
A VLAN of its own keeps management off the ports anyone can plug into, such as a wall socket or a customer's port.
In Circuit
management.allow lists the sources that may reach every login service, as prefixes or as the name of an address set. A service can set its own allow, and a service you leave out is off. Each device of the single site example allows only the management network, and turns on SSH alone:
management: { allow: [home.addresses.management], ssh: {} },The management VLAN travels only on the trunk between the two devices. The example's own check fails on any access port in it:
// This network's own checks, beside Circuit's built-in ones. circuit.ts turns them on in `checks`.
import type { Check } from "circuit";
/** Someone who plugs into a wall socket must not land on the management network: only a trunk between devices carries it. */
export const managementStaysOnTrunks: Check = (network) =>
network.devices.flatMap((device) =>
Object.entries(device.interfaces?.ethernet ?? {})
.filter(([, port]) => port?.access_vlan === "mgmt")
.map(([name]) => ({
device: device.name,
path: `interfaces.ethernet.${name}`,
message: "gives management to whatever plugs in. Put the port in another VLAN.",
}))
);management.interfaces also limits the ports and interfaces the services answer on. Keeping the keys covers users and passwords, and how not to lock yourself out.