Files
bare-operating-system/scripts/verify-zero-trust-gates.mjs
T
Raven Scott 5647491b08 Implement BareOS Zero-Trust Boot and Runtime Hardening (plan batches A–E).
Peer admission and bootstrap controls
- Fail closed when BARE_OS_PEER_ALLOWLIST_HEX is empty unless explicit
  break-glass BARE_OS_PEER_ALLOW_ALL=1.
- Treat BARE_OS_ZERO_TRUST_PROFILE=strict|security like strict admission
  posture alongside BARE_OS_PEER_ALLOWLIST_STRICT.
- Document BARE_OS_PEER_ALLOW_ALL and profile semantics; update boot trust
  model operator guidance.

Peer system seed and provenance
- In strict/security profile, peer system seed defaults off unless
  BARE_OS_PEER_SYSTEM_SEED is explicitly enabled (1/true/yes).
- Disable synthetic capability filling in strict profile; keep compat path
  when profile is not strict.
- Extend test.peer-system-seed.js for strict default-off and no-synthesis.

Path capability signer trust
- When BARE_OS_PATH_CAPABILITY_ENFORCE_READ is on, require trusted issuer
  if BARE_OS_PATH_CAPABILITY_REQUIRE_TRUSTED_SIGNER is set or profile is
  strict; wire verifyPathCapabilityEnvelopeTrusted into the primary deny
  path.
- Document BARE_OS_PATH_CAPABILITY_REQUIRE_TRUSTED_SIGNER and trusted key
  list usage in environment appendix.

Host delegates (least privilege)
- Under strict/security profile, empty BARE_OS_DELEGATE_ALLOW means deny-all
  delegates instead of allow-all; document behavior.
- Add delegate strict-profile test coverage.

Audit durability and telemetry hygiene
- Retain audit chain rows in memory and add bareOsAuditPersistRows for
  optional NDJSON persistence via VFS.
- Broaden var-log redaction for secret-shaped strings and env-like assignments.
- Emit boot.log security line when unsafe trust combinations are detected.

Release and CI gates
- Add scripts/verify-zero-trust-gates.mjs and npm run verify:zero-trust-gates.
- Document verifier in scripts/README.md and zero-trust steps in
  docs/release-checklist.md.

Tests
- Update bare-os-booter admission tests for allow-all and empty-allowlist
  messaging.
- Relax brittle man.json page-count equality to a minimal sanity check to
  avoid brittle/os.cwd brittle failures on inventory drift.

Verification (local): npm run verify:zero-trust-gates; npm run test -w
bare-os-booter; peer-system-seed brittle lane as applicable.

Plan file (.cursor/plans/zero-trust-boot-runtime-100-plan_*.plan.md) was not
edited per instructions.
2026-04-26 23:49:54 -04:00

43 lines
1.2 KiB
JavaScript

#!/usr/bin/env node
import { readFile } from 'node:fs/promises'
import path from 'node:path'
const root = process.cwd()
/** @type {Array<{ file:string, mustInclude:string, note:string }>} */
const checks = [
{
file: 'packages/bare-os-booter/lib/bare-os-peer-admission.js',
mustInclude: 'BARE_OS_PEER_ALLOW_ALL',
note: 'peer admission explicit allow-all override'
},
{
file: 'packages/bare-os-booter/lib/bare-os-peer-admission.js',
mustInclude: "reason: 'peer_allowlist_empty'",
note: 'empty allowlist fail-closed reason'
},
{
file: 'packages/bare-os-booter/lib/bare-os-path-capability.js',
mustInclude: 'BARE_OS_PATH_CAPABILITY_REQUIRE_TRUSTED_SIGNER',
note: 'trusted signer enforcement hook'
},
{
file: 'packages/bare-os-booter/lib/host-delegate-registry.js',
mustInclude: 'BARE_OS_ZERO_TRUST_PROFILE',
note: 'delegate strict-profile default deny'
}
]
let failures = 0
for (const c of checks) {
const p = path.join(root, c.file)
const txt = await readFile(p, 'utf8')
if (!txt.includes(c.mustInclude)) {
failures++
console.error(`missing gate: ${c.note} (${c.file})`)
}
}
if (failures > 0) process.exit(1)
console.log('verify-zero-trust-gates: ok')