The baseboard management controller is a small computer inside every server, with its own network port, its own operating system and full control over power, console and virtual media. It is also the part that is easiest to forget. We spent most of the autumn tightening ours, and here is the list.
The problems, briefly
- IPMI 2.0 authentication has a design flaw: during the RAKP exchange the BMC hands any client a salted hash of the user's password before the client has proved anything. An attacker on the network can take the hash away and try passwords offline. Long random passwords make this impractical. Short ones do not.
- Cipher suite 0 means no authentication and no encryption. Some BMCs ship with it enabled.
- Many BMCs ship with an anonymous user, a well-known default account, or both.
- BMC firmware has the same bug rate as any other embedded Linux, with fewer people watching it.
1. Put them somewhere no one can reach
Every BMC port goes to a switch in a dedicated out-of-band VLAN per site. That VLAN has no route to the internet, to customer networks or to our corporate network. The only way in is through a single bastion per site, which in turn requires a hardware key. If you can reach a BMC from anywhere else, something is wrong, and we check for exactly that every week (see below).
2. Limit the cipher suites
On BMCs that still need IPMI over LAN, we leave a single cipher suite enabled: 17, which uses HMAC-SHA256 and AES-CBC-128. Our tooling passes it explicitly.
$ export IPMI_PASSWORD=...
$ ipmitool -I lanplus -C 17 -H 10.20.4.17 -U acadmin -E channel getciphers ipmi
ID IANA Auth Alg Integrity Alg Confidentiality Alg
17 N/A hmac_sha256 sha256_128 aes_cbc_128
$ ipmitool -I lanplus -C 17 -H 10.20.4.17 -U acadmin -E chassis power status
Chassis Power is on
Where the firmware supports Redfish, we use that for everything and turn IPMI over LAN off completely. About two thirds of the fleet is in that group now.
3. One credential per box, and no spare accounts
On first boot after racking, a provisioning job runs a short sequence:
$ ipmitool user list 1
$ ipmitool user disable 2
$ ipmitool user set name 3 acadmin
$ ipmitool user set password 3
$ ipmitool user priv 3 4 1
$ ipmitool user enable 3
It reviews the user table, disables the factory account, creates ours in slot 3 with administrator privilege on the LAN channel, and sets a 24-character random password that is stored in our secret store and exists nowhere else. No two BMCs share a credential. When one is compromised, and sooner or later one will be, that is the whole blast radius.
4. Customers do not get the BMC
You rent a server from us and you can power-cycle it, reinstall it and open a serial console, all through the API (POST /v1/servers/{id}/actions, POST /v1/servers/{id}/console). The console endpoint returns a short-lived WebSocket URL that proxies serial-over-LAN from inside the out-of-band network. At no point does a customer need an address or a password for the BMC.
5. What happens between customers
A rental server comes back to us with an unknown disk, unknown firmware settings and possibly a modified BMC configuration. Before it goes back into stock:
- BMC reset to factory defaults and re-provisioned as in step 3.
- BIOS settings reapplied from a known profile and the boot order reset to network first.
- All NVMe drives wiped with a secure erase:
nvme format /dev/nvme0n1 --ses=1. - Firmware versions compared against the fleet baseline. Anything that does not match is flashed, and the flash is verified from the Redfish
UpdateServiceinventory.
The server is not listed as available until all four checks are green.
6. Check from the wrong side
A control is only useful if you test it from the position of someone who should not have access. Each week a job on a host that is deliberately outside the out-of-band VLAN scans every BMC subnet for the IPMI port and the HTTPS management port:
$ nmap -sU -p 623 --script ipmi-version 10.20.0.0/22
$ nmap -sT -p 443,5900 10.20.0.0/22
The expected result is that every port is filtered. Anything else opens a ticket.
Firmware
BMC firmware gets updated quarterly in a rolling window by site, using Redfish. We hold each update for a week after release to see whether other people report problems. We do not enjoy this schedule. A BMC that has gone unresponsive in a rack in Ashburn is a two-hour drive for our remote-hands contractor, and we would rather not give them reasons to make it.
Written by Marcus Webb. Comments, corrections and arguments to marcus.webb@ansiblecloud.io.