Skip to content

fix(enroll): tenth audit — nix build PIPESTATUS, nginx HEALTHY, harmonia diag, preflight host dir, sed post-verify#182

Merged
mdheller merged 1 commit into
mainfrom
fix/enroll-tenth-audit
Jun 16, 2026
Merged

fix(enroll): tenth audit — nix build PIPESTATUS, nginx HEALTHY, harmonia diag, preflight host dir, sed post-verify#182
mdheller merged 1 commit into
mainfrom
fix/enroll-tenth-audit

Conversation

@mdheller

Copy link
Copy Markdown
Member

Summary

  • CRITICAL (regression docs: align source-os runtime posture to software operational risk pack #9)CLOSURE=$(nix build ... | head -1): with set -euo pipefail, a failed build fires set -e before the die with BUILD_LOG path runs. Fixed with set +e / PIPESTATUS[0] / set -e, matching the nixos-rebuild steps pattern.
  • HIGH — nginx inactive: no else branch meant HEALTHY stayed 1 and the entire minisig verification block silently skipped. Added else with HEALTHY=0 and diagnostic commands.
  • MEDIUMKATELLO_PG_PASSWORD sed was not post-verified (only FOREMAN_ADMIN_PASSWORD was). Added matching grep -q guard.
  • MEDIUM — harmonia inactive warn had no actionable diagnostic. Added journalctl and systemctl start hints.
  • LOW — nginx up but harmonia not listening on :8101: curl check had no else, leading to misleading "minisig not yet at..." message. Added explicit else with HEALTHY=0.
  • LOWCURRENT_GEN empty from failed readlink: both divergence branches silently skipped. Added explicit empty-string warn branch.
  • LOW — preflight didn't validate hosts/${HOST}/ exists. A bad SOURCEOS_HOST override now fails at step 0 with available-hosts list, not a cryptic Nix eval error in step 2.

Test plan

  • bash -n scripts/enroll.sh — syntax clean
  • Set SOURCEOS_HOST=bogus → preflight dies with available hosts listed
  • Simulate nix build failure → die shows exit code and BUILD_LOG path
  • Stop nginx before step 12 → HEALTHY=0, minisig block skipped, clear diagnostic
  • Stop harmonia before step 12 → HEALTHY=0, journalctl hint shown
  • Corrupt COMPOSE_ENV after sed → KATELLO_PG_PASSWORD guard fires

…nia diag, preflight host dir, sed post-verify
@mdheller mdheller merged commit 67bc53a into main Jun 16, 2026
@mdheller mdheller deleted the fix/enroll-tenth-audit branch June 16, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant