Skip to content

fix: harden authorization and fleet execution integrity - #3985

Draft
ToddHebebrand wants to merge 50 commits into
mainfrom
fix/s0-fleet-integrity-program
Draft

fix: harden authorization and fleet execution integrity#3985
ToddHebebrand wants to merge 50 commits into
mainfrom
fix/s0-fleet-integrity-program

Conversation

@ToddHebebrand

Copy link
Copy Markdown
Collaborator

Summary

This draft hardens the highest-priority authorization and fleet-integrity paths identified by the S0 revalidation.

Authorization and queued recovery

  • bind automation resources to explicit tenant ownership and enforce that ownership at execution time
  • add explicit cross-site restore permission and lineage validation
  • persist durable authorization subjects for queued recovery jobs
  • reauthorize media, boot, disaster-recovery, C2C, and scheduled work when workers execute it
  • add real-PostgreSQL proofs for stale or revoked queued authority

Fleet execution truth

  • replace unbounded device selectors with authorized paged options and race-safe hydration
  • make heartbeat the authoritative reachability signal
  • persist immutable versioned agent-health observations and ingest health independently of heartbeat success
  • return explicit per-target script admission results across API, mobile, remediation, and web consumers
  • persist per-action automation dispatch and terminal evidence with guarded state transitions and serialized reconciliation
  • preserve exact command, script, and software result correlations through HTTP, WebSocket, cancellation, and reaper paths
  • retain versioned software-inventory evidence and protect the last-known-good projection from empty, partial, failed, truncated, collapsed, or out-of-order reports
  • emit typed software-inventory completeness evidence from macOS, Linux, and Windows collectors
  • require exact accepted inventory evidence before resolving vulnerabilities by absence, and clear lineage on every reopen path

Consolidated verification

  • shared targeted: 12 passed
  • API targeted: 701 passed, 5 existing skips
  • web targeted: 222 passed
  • real PostgreSQL Track B matrix: 35 passed across 10 files
  • RLS coverage: 80 passed
  • migration naming: clean
  • migration ledger drift: 567/567 clean
  • API TypeScript: clean
  • web Astro diagnostics: 1,683 files, 0 errors
  • Go collector race, focused heartbeat v2 race, and uninstall/software compatibility race: clean
  • Linux and Windows collector cross-builds: clean
  • branch diff check: clean

Draft / do not merge yet

  • One independent whole-branch security review is still required.
  • Native Linux and Windows collector behavior plus real Windows registry evidence must be captured from CI/candidate artifacts.
  • The full macOS heartbeat race package hits an unchanged environment-specific hang in TestConsentGate_NoHelper_Proceed inside native screen capture; Task 13 focused heartbeat coverage passes.
  • The shared package typecheck still reports three unchanged baseline errors in packages/shared/src/validators/quotes.test.ts.
  • The full API suite executes 24,843 assertions but retains the unchanged streamingUpload.test.ts post-test ReadableStream already closed rejection.
  • No production deployment or rollout is included or authorized by this PR.

Follow-up scope

Readiness/offline scaling, device-control lifecycle, and PAM actuation are intentionally planned as follow-up PRs to keep review and rollback boundaries manageable.

Todd Hebebrand and others added 30 commits August 24, 2026 07:30
…facts

Corrections and additions after verifying the approved design against the
baseline code:

- Track A: per-table ownership predicates (XOR vs denormalized partner_id,
  is_system as the only global flag); two confirmed site-authorization defects
  in the restore path; the six registration points for the new
  backup:cross_site_restore permission.
- Track B: /devices/options mount-order requirement; enumerated selector
  migration targets; re-enrollment currently forces online + lastSeenAt;
  stale DEVICE_STATUSES constant; empty inventory report wipes all rows and
  NULL-links vulnerability findings.
- Track C: /ready already exists as a live evaluator (#2974) — extend it,
  consolidate /health/ready; compose healthchecks must be switched at rollout.
  Offline detector is already chunked — reframed as deltas (durable
  continuation, identity-keyed transitions, throughput).
- Track D: current first-match-wins distributor behavior; precedence gains an
  ownership tier (org-owned over partner-wide); partner fan-out and
  system-context distribution rules.
- Track E: no cleanup command exists today; reuse the intent_outbox pattern.
- Cross-cutting: FK KEY SHARE deadlock rule for hot agent-write tables
  (40P01, #3739/#3911); no epoch-aligned repeatable jobs; integration-suite
  placement/runIf evidence rule.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploying breeze with  Cloudflare Pages  Cloudflare Pages

Latest commit: d914d0a
Status: ✅  Deploy successful!
Preview URL: https://559da85c.breeze-9te.pages.dev
Branch Preview URL: https://fix-s0-fleet-integrity-progr.breeze-9te.pages.dev

View logs

@ToddHebebrand

Copy link
Copy Markdown
Collaborator Author

Reviewer-held findings — recorded for review, not acted on in this draft:

  1. Three of the six migrations are dated 2026-08-24 and sort before eight already-shipped 2026-09-* files. The usual “today’s date sorts last” escape does not apply because main is future-dated. The reviewer should assess migration ordering and rollout implications.

  2. CI has not run on this branch; only a Pages check is reporting. The PR body’s 701 API / 222 web / 35 real-PostgreSQL / 80 RLS / 567-of-567 ledger matrix is local, self-reported evidence, not PR-run CI verification. Do not treat the PR as CI-green on that basis.

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