Chapter 08
Security and resilience
Security is layered: the backend decides who may open what, every command is signed and short-lived, traffic is encrypted end to end, and the cabinet keeps working through power and network outages.
Access control
- The app never addresses a lock directly. The backend checks ownership on every request.
- Commands are signed (HMAC or Ed25519), single-use and expire within 30 s.
- Optional presence check: the customer scans a QR code on the cabinet or is within BLE range.
Transport
- TLS everywhere: HTTPS for the app, MQTT on port 8883 for the cabinet.
- One client certificate per cabinet, revocable from the backend.
- The broker's ACLs restrict each cabinet to its own topics.
Power and network outages
- The DC UPS and battery keep the cabinet running for about 15 h (7 Ah at about 4 W idle).
- Offline mode: BLE with a pre-issued, signed and time-limited token stored in the app. Events sync when the cabinet reconnects.
- Fail-secure locks stay locked without power.
Physical
- 1.5 mm steel, with the hatch and rear panel under key or tamper-proof screws.
- Mechanical override for the service team, logged on use.
- Anchor the cabinet to the wall and floor.
Audit
- Every request, unlock and door event is logged with the user, time and result.
- Alert when a door is left open too long, or opens without a command.
Device hardening
- Read-only root filesystem or overlay. SSH by key only, or disabled.
- Automatic security updates and a hardware watchdog.
- Secrets stored outside the code with restricted file permissions.