No description
Find a file
Mitchell R 436d2d730c
feat(harden): hardware-bound at-rest encryption of kiosk state files
New module kiosk/src/at_rest.rs. Derives an AES-256-GCM key via HKDF
from a Pi-bound value:
  1. /proc/device-tree/serial-number  (Pi 5 firmware exposes it)
  2. /proc/cpuinfo Serial line          (older kernels)
  3. /etc/machine-id                    (non-Pi dev fallback)

File format: "BFE1" magic || 12-byte random nonce || ciphertext+tag.
Atomic write via tempfile + rename so a crash mid-write can't leave a
half-encrypted file.

Wired into kiosk/src/server.rs at every file I/O touching sensitive
state:
  - kiosk.key      (bearer token to BF server)
  - local.key      (LAN-side API auth key)
  - bundle.json    (cached bundle with RTSP credentials in URL form)

Migration: read paths tolerate legacy plaintext (kiosks upgraded from a
pre-at_rest build) AND re-store as ciphertext on the first read. One-
shot upgrade — subsequent boots skip the migration write.

Threat model defended: SD card extraction. Attacker who pulls the card
can't decrypt without also having the same physical Pi (CPU serial is
hardware-bound). Doesn't defeat an attacker who has both — at that
point they ARE the kiosk. Bar is raised from "trivially extract every
camera password" to "must steal the device intact."

Not defended: TPM-style attestation, remote attestation, sealed boot.
Pi 5 has no TPM and we don't ship a secure-boot config.

Tests in-module: round-trip short bytes, round-trip JSON, legacy
plaintext passthrough.
2026-05-21 11:34:29 +02:00
.github/workflows feat(harden): nftables default-drop firewall + first-boot password rotation 2026-05-21 11:18:28 +02:00
deploy feat(harden): nftables default-drop firewall + first-boot password rotation 2026-05-21 11:18:28 +02:00
docs feat(ota): add RAUC OS update foundation 2026-05-20 05:15:29 +02:00
kiosk feat(harden): hardware-bound at-rest encryption of kiosk state files 2026-05-21 11:34:29 +02:00
nodered fix(nodered): parse JSON body in trigger nodes 2026-05-13 03:07:22 +02:00
scripts feat(os-ota): build + sign + auto-import .raucb bundles in CI 2026-05-21 10:44:24 +02:00
server feat(harden): hardware-bound at-rest encryption of kiosk state files 2026-05-21 11:34:29 +02:00
.gitattributes fix(deploy): mark setup-pi-kiosk.sh executable in git index + add .gitattributes 2026-05-13 03:33:41 +02:00
.gitignore adding initial project 2026-05-10 01:09:13 +02:00
CLAUDE.md fix(proxy): split Node-RED route surfaces 2026-05-11 10:44:45 +02:00
docker-compose.coolify.yml fix(admin): restore display layout switching 2026-05-21 08:57:54 +02:00
docker-compose.yml fix(release): surface build versions 2026-05-21 08:51:41 +02:00
LICENSE-AGPL.txt docs: dual-license declaration + vendored AGPL-3.0 text 2026-05-15 04:47:46 +02:00
LICENSE-COMMERCIAL.md docs: dual-license declaration + vendored AGPL-3.0 text 2026-05-15 04:47:46 +02:00
LICENSE.md docs: dual-license declaration + vendored AGPL-3.0 text 2026-05-15 04:47:46 +02:00
package-lock.json feat(store): Postgres adapter foundation + BF_DB selector (phase 1) 2026-05-18 22:50:48 +02:00
package.json adding initial project 2026-05-10 01:09:13 +02:00
sec-config.yaml feat: Node-RED custom nodes + dashboard entity type 2026-05-13 01:47:53 +02:00
tsconfig.base.json adding initial project 2026-05-10 01:09:13 +02:00