A CLI-first git forge.

cli forge git self-hosted

https://gitbay.org

security hardening: software and host #28

open cmc opened this on 2026-08-24 15:21 · roadmap security

cmc 2026-08-24 15:21

Umbrella for security work beyond #14 (which covers audit logging, rate limiting, quotas, user disable). Two halves:

The software

  • fuzz every parser that eats attacker-controlled bytes: the pkt-line reader in gitd, the SSHSIG and commit parsers in internal/sig, the armor decoder (the ssh tokenizer already has fuzz targets — extend the pattern)
  • web security headers: CSP, X-Frame-Options, Referrer-Policy — none are set today; raw file serving already has nosniff
  • dependency hygiene: govulncheck wired into the test loop, periodic review of the (deliberately short) module list
  • constant-time comparison audit for every token/hash check
  • a written threat model in docs/: what the forge trusts, what it never does (execute repo content, hold a signing key, serve repo HTML on its origin), where the boundaries are
  • signed release artifacts (with #26)

The host (bay1 pattern, documented for any instance)

  • unattended-upgrades for OS security patches; reboot policy
  • tighter systemd sandboxing: SystemCallFilter=@system-service, RestrictAddressFamilies, PrivateDevices, LockPersonality on top of the existing ProtectSystem/NoNewPrivileges set
  • auth throttling on both SSH surfaces (gitbayd port 22 via #14 ssh_auth_rate; admin sshd 2222 via MaxStartups/fail2ban)
  • database: verify file modes, consider continuous replication (litestream-style) alongside the nightly archive and provider snapshots
  • basic monitoring: disk, service failures, certificate renewal — journald + a webhook to somewhere visible

referenced in commit 2e6467a72f: Audit logging, auth throttling, pack limits, user disable

2026-08-24 21:40

referenced in commit d38eddbbf4: Security hardening: fuzzing, headers, threat model, host sandbox

2026-08-25 00:42

referenced in commit 2a6874e6b7: docs: mark #28 concrete items done

2026-08-25 00:47
cmc 2026-08-25 00:47

Concrete items shipped in !28 and applied to bay1. Software: fuzz targets for every attacker-facing parser (the SSHSIG armor fuzzer found a real decodeArmor negative-slice crash — fixed, crasher kept as a regression seed); CSP + X-Frame-Options/nosniff/no-referrer/HSTS on every response (live, verified on gitbay.org); govulncheck wired into deploy/audit.sh, which flagged CIRCL GO-2026-4550 reachable via PGP key parsing (bumped 1.6.2->1.6.3, now clean); token-comparison audit (every secret checked by SHA-256 hash DB lookup, never a Go-level compare — no timing oracle); docs/threat-model.org; optional minisign over release manifests. Host: systemd sandbox (SystemCallFilter=@system-service, PrivateDevices, LockPersonality, MemoryDenyWriteExecute, RestrictAddressFamilies) — verified clone, blob render, archive, and a signed push all still work under it; unattended-upgrades; fail2ban + MaxStartups/MaxAuthTries on the admin sshd (already banning 2 real attackers); hourly disk/service/cert monitoring (dormant until /etc/gitbay/monitor.url is set). Leaving this umbrella open for ongoing security work; the gating items for open registration are done.

referenced in commit b8cda1cc1e by cmc: org: refuse #+INCLUDE and #+SETUPFILE when rendering

2026-08-29 02:00

referenced in commit c8bf623f41 by cmc: deploy: refuse to build a dirty tree

2026-08-30 02:07

referenced in commit 30ef5fd837 by cmc: gitbayd: log when a restart moves the schema

2026-08-30 02:24

referenced in commit b685adf5ab by cmc: build: stamp the commit into gitbayd and the runner

2026-08-30 03:43

referenced in commit eb453997f3 by cmc: gitbayd: warn at startup about a build that cannot be vouched for

2026-08-30 04:04

referenced in commit 255a74d8cf by cmc: dashboard: report the running build to admins

2026-08-30 04:30