24 Commits
Author SHA1 Message Date
Morning StarandMojo-LB 0d49fc8428 feat: diskless machines (no SSD), machine power / display / hardware list, HTTPS admin (#3)
Diskless goldens over iSCSI, Add hardware, maintenance VM in the browser, machine power / display / hardware list, roles with permissions and HTTPS for the web admin. Includes the security fixes from the review on #2.

Co-authored-by: Mojo-LB <35627917+Mojo-LB@users.noreply.github.com>
2026-11-22 11:28:59 +07:00
morningstar-sudo 4891415ffa feat(boot): support legacy BIOS clients
BIOS PXE ROMs (DHCP arch 0) got no boot file; Broom was UEFI-only.

- DHCP/TFTP: serve undionly.kpxe (iPXE with bios.ipxe embedded:
  chains autoexec.ipxe, so router-DHCP mode does not loop)
- SSD on BIOS machines: MBR (Windows boots BIOS only from MBR),
  marked by disk id "BROM" ("BROL" Linux-only); partition role
  from its place. GPT<->MBR layout redone on firmware mode switch
- Windows stage: no BootNext under BIOS. Writes the boot
  partition + MBR code from bios.tar.gz, then POST /api/boot/local;
  the next /boot.ipxe sanboots that drive once (120 s, only from
  the IP of the machine's menu choice). Drive found via EDD MBR ids
  in /sys/kernel/boot_params, no edd module
- prep-win: build broom\bios (fixed MBR VHD, bcdboot /f BIOS);
  publish packs it as bios.tar.gz when present
- strict reset on BIOS: bootorder task deletes \bootmgr and drops
  BROOMWIN/BROOMEFI drive letters
- shim line skipped on pcbios; deploy warns on UEFI image to BIOS PC

Windows goldens prepped before this boot UEFI clients only: run the
prep command again, upload, Publish. Stage bundle needs a rebuild.
2026-10-30 14:26:52 +07:00
morningstar-sudo 61060c94a5 feat: enhance authentication and session management, add crypto tests 2026-10-19 15:27:47 +07:00
morningstar-sudo 35b10703b2 feat(auth)!: password-free sign-in handshake, signed releases
The web admin and Capture ran over plain HTTP and sent the owner
password in the clear on a LAN that may not be isolated.

- auth: 4-message handshake (hello → salt + nonce → proof → server
  proof). PBKDF2-SHA256 runs on the client; the server keeps a
  verifier only, so a copied DB logs nobody in and a sniffed sign-in
  yields no password or replayable proof.
- new passwords (setup, change, owner reset) travel as verifiers
  sealed with the handshake's session key, or the setup token for
  the first owner; neither the token nor the password is sent
- web: SHA-256/HMAC/PBKDF2 in plain JS (crypto.js), since WebCrypto
  is off on http:// to an IP; values pinned against the Rust side
- capture: same handshake, checks the server's proof
- deps: argon2 out (no server-side KDF left), pbkdf2 in; random
  bytes from getrandom(2)
- ci: SLSA build provenance (attest-build-provenance) on every
  release file
- docs: quick start checks SHA256SUMS and explains
  `gh attestation verify`; read-before-run variant of the prep
  scripts
- prep-linux.sh: body in main() so a cut-off `curl | bash` runs
  nothing
- comments: drop stale "one-time token" wording for the prep
  scripts

BREAKING CHANGE: accounts store a verifier instead of an argon2
hash and sessions gain a key column; an existing bootrom.db no
longer works, so start with a new one. /api/auth/login takes
{hs, proof} after /api/auth/hello; /api/password and /api/users
take a sealed `cred` instead of a plain password.
2026-10-19 02:56:54 +07:00
morningstar-sudo 7c6b78632f fix!: stateful sessions, fuzz-found parser panics
Parser inputs come from the LAN or uploads and run as root; mutation
fuzzing found three panics:
- dns: a query with QDCOUNT 0 panicked the response builder
  (any LAN host could take DNS answers down)
- gpt: huge LBAs overflowed the byte offsets
- lvm: negative or huge metadata numbers overflowed segment offsets

Sessions move to a `sessions` table (blake3 of the token stored, never
the token): logout ends the session on the server, so a copied cookie
dies too; a password change or a deleted account ends all of that
account's sessions.

- agentauth: hmac crate instead of a hand-rolled HMAC-SHA256
- tests: no-panic fuzz of DHCP, DNS, TFTP, iSCSI sessions, SCSI CDBs,
  GPT/MBR, VMDK, LVM, ext4, NTFS (BROOM_FUZZ=N for deeper runs)
- tests: app.js lint, every ${} in HTML templates escaped or vetted;
  esc the volume state, CSS.escape the page selector
- tests: account rights and session ends in the API contract test
- build: binary version = release tag (UTC timestamp) via
  BROOM_VERSION; build.sh stamps local builds with the build time

BREAKING CHANGE: session_secret and pw_gen are gone; existing session
cookies are invalid, everyone logs in again.
2026-10-19 02:32:49 +07:00
morningstar-sudo 3eddc62964 feat: Enhance CI workflow and asset management with bundle pinning and improved documentation 2026-10-18 09:07:07 +07:00
morningstar-sudo f6fb31553f Add hardware metrics collection and reporting
- Introduced a new `metrics.rs` module to handle per-machine hardware health metrics (CPU %, RAM %, temperatures, disks).
- Updated the `broom-watch.ps1` script to reference System.Management for improved functionality.
- Modified `AppState` to store and retrieve metrics for each machine.
- Enhanced the `MachineStatus` struct to include metrics data.
- Implemented disk health checks using SMART data for NVMe and SATA disks in `sysmon.rs`.
- Updated the VNC agent to push hardware health metrics over WebSocket connections.
- Enhanced the frontend to display hardware health metrics in the UI, including disk status and temperatures.
- Added unit tests for metrics parsing and disk health attribute extraction.
2026-10-16 20:46:51 +07:00
morningstar-sudo e475d25be4 feat: add remote VNC support for Windows machines
- Implemented a remote agent (broom-vnc.exe) that allows viewing and controlling Windows machines via a WebSocket connection.
- Updated broom-watch.ps1 to start the VNC agent and ensure it runs in the console session.
- Added new API endpoints for VNC agent management and viewing.
- Created a new remote page in the web interface for connecting to and controlling Windows machines.
- Enhanced asset management to include VNC-related scripts and binaries.
- Updated the frontend to support remote control features, including mouse and keyboard events.
- Added tests for VNC agent and viewer functionality.
2026-10-16 15:43:51 +07:00
morningstar-sudo d306f1932a feat: enhance build process by including additional base packages for versioning 2026-10-14 18:38:21 +07:00
morningstar-sudo e5ce3501e1 Refactor and optimize various components for improved performance and maintainability
- Enhanced `serve` function in `goldenram.rs` to read and send data in 1 MB chunks concurrently, improving throughput.
- Updated `hash.rs` to implement a more efficient `sha256_with` function that reads data in parallel while hashing, reducing overall processing time.
- Modified `write_chunk` in `images.rs` to skip writing zeroed MBs, optimizing disk usage.
- Improved `command` function in `conn.rs` to streamline read operations.
- Optimized `read_at` method in `overlay.rs` to read neighboring blocks in a single call, reducing disk access overhead.
- Adjusted `main.rs` to increase the buffer chunk size for TFTP service, enhancing data transfer efficiency.
- Refined `status` function in `monitor.rs` to limit concurrent pings, improving responsiveness and resource management.
- Changed default `boot_timeout` in `settings.rs` from 10 to 3 seconds for quicker boot processes.
- Updated `autoexec` function in `tftp.rs` to utilize existing IP addresses, reducing DHCP wait times.
- Enhanced `sha256` function in `vhdx.rs` to leverage the new `sha256_with` for better performance.
- Added tests for sparse file writing and hash caching behavior in `hash.rs` and `golden.rs` to ensure correctness and performance.
2026-10-14 18:17:20 +07:00
morningstar-sudo a51c0d7ee9 Add integration tests for booting a Linux golden and server lifecycle management
- Implemented a test for the Linux client boot process, simulating DHCP, TFTP, HTTP boot menu, and iSCSI login.
- Created minimal client implementations for HTTP, DHCP, TFTP, and iSCSI protocols.
- Established a sandbox environment for integration tests with isolated network namespaces.
- Added lifecycle tests to ensure server data persistence across restarts and validate single instance enforcement on the same port.
- Verified that the iSCSI daemon outlives the server process, maintaining session integrity.
2026-10-12 22:00:30 +07:00
morningstar-sudo 0168dcb189 refactor: optimize build scripts and improve driver handling for reduced boot time 2026-10-12 18:11:08 +07:00
morningstar-sudo 79961b2c7e fix: update push time format in build process and documentation to ISO 8601 UTC 2026-10-12 13:46:57 +07:00
morningstar-sudo 0651f66220 refactor: update build process to tag releases with push time and enhance documentation 2026-10-12 11:57:21 +07:00
morningstar-sudo b6a5e1a812 feat: add debug build configuration and update build scripts for CI 2026-10-12 10:02:51 +07:00
morningstar-sudo 4bec40762e feat: enhance documentation and add guides for diskless boot setup, FACEIT Anti-Cheat, and Broom comparison with CCBoot 2026-10-11 23:07:00 +07:00
morningstar-sudo f155098f20 Refactor asset handling in management module
- Changed constants for iPXE binaries in `boot.rs` to functions that retrieve assets dynamically.
- Updated the `broom_prep` function in `images.rs` to use the new asset retrieval method for the prep script.
- Modified `main.rs` to load HTML and JavaScript assets using the new asset functions, removing hardcoded strings.
- Refactored overlay scripts in `overlay.rs` to use functions for asset retrieval instead of constants.
- Updated TFTP server in `tftp.rs` to serve iPXE binaries using the new asset functions.
- Adjusted Windows stage scripts in `winstage` module to load scripts dynamically from assets.
- Ensured all tests reflect the changes in asset handling, maintaining functionality and correctness.
2026-10-09 15:56:36 +07:00
morningstar-sudo dd53b26208 feat: DHCP option checkboxes, one box per DNS server, comment review
DHCP (Network page, only shown when broom is the DHCP server):
- iPXE: don't wait for ProxyDHCP (option 175.176), default on
- Authoritative NAK for machines asking for an IP that isn't theirs, default on
- Send hostname (option 12), default on
- Rapid Commit (RFC 4039, option 80): ACK straight after DISCOVER when the
  client asks for it, default off
- DNS: one input per server ("+ DNS"), up to 8; the server validates them,
  drops duplicates and keeps the order

Comments across src, scripts, web, build.sh, CI and README brought in line
with the current code (module split, stage bundle from CI, no distro
packages, TFTP always on).

Note: the comment edits change the embedded scripts, so the next publish
rebuilds the golden image and the stage once, and each Windows machine
downloads the delta and rebuilds its base once.
2026-10-04 09:15:47 +07:00
morningstar-sudo 877c37bdf7 feat: Windows stage built by CI and downloaded by the server (no stage packages)
- bootrom-mgmt build-stage <dir> --kernel <ver>: the stage (kernel + initrd)
  for a given kernel + Ubuntu's signed shim → broom-stage.tar.gz (CI, root)
- CI installs linux-image-generic + shim-signed + the stage tools on the
  runner, builds the bundle, appends its sha256 + release URL to
  mgmt/stage.pin (embedded with include_str!, comments only in git = local
  build), rebuilds the binary and releases broom-stage.tar.gz with it
- server: on the first Windows publish (or Linux publish with Secure Boot
  on), use broom-stage.tar.gz next to the binary if present (offline
  server), else download it over HTTPS (ureq, rustls, built-in roots);
  only the pinned sha256 is accepted; unpacked into tftp/broom-stage as a
  whole; the Secure Boot shim comes from it too
- a binary without a pinned bundle (local builds) builds the stage on the
  server as before; preflight asks for the stage packages only then, and
  warns about missing kernel modules (loop, ntfs3, LIO target, zram)
- archive::untar_gz (refuses paths escaping the target)
2026-10-04 07:53:16 +07:00
morningstar-sudo bc865e9928 feat: VMDK/VHDX in-process with parallel I/O (no qemu-img)
- vmdk.rs: read VMDK descriptors (text or embedded) with SPARSE (grain
  tables; streamOptimized zlib grains + footer), FLAT/VMFS and ZERO extents
  into a sparse raw golden, one grain table / 32 MB flat piece per thread;
  refuse snapshots/linked clones (parentCID), extent paths outside the
  upload folder and SE sparse; write monolithicSparse (64 KB grains,
  redundant tables) for exports
- vhdx.rs: write the golden as a dynamic VHDX (32 MB blocks stored in
  virtual-disk order, so a golden always lays out the same way for the
  clients' delta updates); header/metadata builder shared with the
  differencing templates
- writers read a window of blocks in parallel, place them in disk order,
  write in parallel (reused buffers, workers x 32 MB of RAM)
- disk.rs: Source (files/ranges joined into one virtual disk, sparse holes
  skipped with SEEK_DATA/SEEK_HOLE), workers() + par_map
- publish/winstage/export use them; qemu-utils dropped from preflight
- tests check against qemu-img (installed in CI for tests only): every
  VMDK subformat reads back byte-identical, written VHDX/VMDK pass
  qemu-img check and convert back to the same bytes; bench_convert
  (ignored) times broom vs qemu-img on a given raw
2026-10-04 07:33:02 +07:00
morningstar-sudo 6db0444df1 fix: commit the rest of 260f025 (CI used the old iPXE build script)
260f025 only held what was already staged (ipxe-src removal + patches);
the new mgmt/ipxe/build.sh, build.sh, sources, UI and README were left
out, so CI ran the old script against the deleted ipxe-src.

- mgmt/ipxe/build.sh: fetch upstream iPXE at IPXE_COMMIT, apply
  patches/, build snponly.efi, delete the checkout (KEEP_IPXE_SRC=1)
- TFTP serves autoexec.ipxe (router DHCP can boot clients); autoexec
  skip patch dropped
- auth: setup token, per-IP throttle, password change rotates sessions
- DHCP off by default, gateway/DNS required, no NAK for foreign
  clients, static IP vs live lease, relayed packets ignored, HTTP bound
  first
- Windows stage: safe disk choice, per-image base mode, boot-file
  sha256 check every boot, strict reset, "not reset" flag, one-time
  prep link, license re-arm + 30 min window, driver/chunk hash checks,
  blake3 keys
- install-service subcommand, README ops/backup/DHCP/strict docs
2026-10-03 22:43:40 +07:00
morningstar-sudo 8e529043d6 feat: security hardening, admin login, DHCP toggle, LVM goldens
Harden the mgmt app against an untrusted shared LAN, gate the web admin
behind a login, replace proxyDHCP with a DHCP on/off toggle, make Linux
goldens boot reliably (LVM), and prep the repo for release under Apache-2.0.

Auth & web admin
- Admin login on its own /login page; stateless blake3-signed session
  cookie (survives restarts). Host-header check. All /api/* gated; only
  boot/client endpoints stay open.

Security review remediation (all CRITICAL + HIGH, most MEDIUM/LOW)
- TFTP serves only the embedded snponly.efi.
- VMDK/zip/upload/virtual-size limits; qemu-img forced with -f vmdk.
- DHCP lease pruning, DECLINE/config validation, bind-then-abort restart.
- License handed out by bound-IP + ARP-MAC check (POST, one-time).
- Stored-XSS via DHCP hostname closed (sanitise option 12 at ingest).
- Golden-chunk: Semaphore(8) + reject out-of-range index before reading.
- iSCSI republish made safe: per-generation IQN + zram hot-swap, GC when
  idle; disk-cache publish/rollback refused while clients are connected.
- for_machine stores hwids only for known MACs; upload-chunk blocked
  during a running job; internal errors no longer leak OS paths.

DHCP
- Remove proxyDHCP and the :4011 boot server. dhcp_mode is now full|off:
  broom is the LAN's DHCP server, or off when another server owns the LAN.

Linux golden boot
- Activate LVM volume groups read-only in the initrd (the iSCSI LUN is
  read-only, so the stock lvm2 hook's writable vgchange fails) — LVM
  goldens now boot.
- Hide broom's own SSD partitions (broomwb/broomcache) from the desktop.
- Refuse to publish a VM that attaches more than one disk (ambiguous which
  is the OS) instead of silently converting the wrong one.

Docs & licensing
- Apache-2.0 (LICENSE + NOTICE); bundled iPXE stays GPLv2/UBDL.
- Rewrite README; drop internal dev logs; stop tracking mgmt/dist/.

Tests: 59 unit + 4 live (LIO/zram/ping/LVM) green.

BREAKING CHANGE: proxyDHCP is removed; an install with dhcp_mode=proxy now
behaves as "off" and must enable the DHCP server (Network page) to boot.
2026-09-29 20:01:08 +07:00
morningstar-sudo b24bddad17 fix: update build command to use bash for iPXE build script 2026-09-26 13:00:17 +07:00
morningstar-sudo a8ea266077 feat: enhance machine management with driver support and improved filtering
- Added driver management functionality, allowing custom Windows drivers to be uploaded and associated with machines.
- Implemented a new page for driver uploads, including a user-friendly interface for managing driver packages.
- Introduced filtering options in the machine list, enabling users to filter by hostname, group, IP, MAC, status, and license.
- Updated the backend to handle driver uploads, processing .zip files containing extracted driver folders, and extracting hardware IDs from .inf files.
- Enhanced the database schema to support driver associations with machines based on hardware IDs and groups.
- Added unit tests for driver handling and filtering logic to ensure reliability and correctness.
2026-09-26 12:51:41 +07:00