Skip to main content

Module enrollment_reconcile

Module enrollment_reconcile 

Source
Expand description

Enrollment reconciler (#698 Phase 2, code slice 2) — the single-writer protected-controller action that folds the durable enrollment-intent journal into the NEXT unsigned boot-policy generation for the offline trust sign-mac-boot-policy ceremony.

Design: docs/mac-architecture.md “Enrollment lifecycle (#698 Phase 2)”.

Inputs:

  • the intent journal (crate::mac::enrollment_journal), and
  • the CURRENT boot policy as pinned by OS-owned config: the signed artifact at policy_path plus the operator-supplied (expected_generation, expected_policy_hash) pin (crate::config::MacBootPolicyConfig). The pin is the trust anchor: the reconciler recomputes the artifact’s policy hash and refuses on any mismatch, so it never folds intents into a policy the deployment did not pin.

Output (unsigned, never signed, never installed here): a new CompiledPolicy JSON with generation = current + 1, the SAME lattice compartment vocabulary, an empty TE matrix (enrollment-only, the check_enrollment_only contract), and the enrollment table = current table ∪ non-conflicted intents. Signing and distribution stay with the offline authority + config pin + restart; this module only stages the reviewed input and prints the exact trust hash-mac-boot-policy command.

Fail closed everywhere:

  • unreadable/corrupt/gapped/locked journal ⇒ refuse (no output);
  • missing/undecodable current policy, or any pin mismatch ⇒ refuse;
  • a current policy with non-empty TE rules ⇒ refuse (the reconciler never authors TE authority);
  • conflicting intents ⇒ emit the policy WITHOUT every subject touched by a conflict and list them in the report for operator resolution — conflicts are never auto-resolved;
  • intent labels outside the allowed user-clearance vocabulary (internal / confidential, design risk #5) ⇒ that intent is excluded (deny-side) and reported, never silently mapped.

Structs§

AppliedIntent
An intent folded into the new enrollment table.
ConflictSummary
A durable conflict record surfaced for operator resolution.
ReconcileReport
What the reconciler produced — mirrored to reconcile-report.json next to the unsigned policy so the offline reviewer sees exactly what changed.

Enums§

ExcludedIntent
An intent deliberately left OUT of the new table (fail-closed exclusion).
ReconcileError

Constants§

RECONCILE_REPORT_FILE
File name of the reconciliation report inside the output directory.
UNSIGNED_POLICY_FILE
File name of the emitted unsigned CompiledPolicy JSON inside the output directory.

Functions§

reconcile_enrollment
Fold the journal into the next unsigned boot-policy generation and stage it, unsigned, for the offline ceremony. NEVER signs and NEVER installs.