Skip to main content

install_baseline_boot_policy

Function install_baseline_boot_policy 

Source
pub fn install_baseline_boot_policy(
    ed_sk: &SigningKey,
    pq_sk: &MlDsaSigningKey,
) -> Result<(Arc<CompiledPolicy>, bool), BootPolicyError>
Expand description

Install the node’s baseline compiled policy at daemon boot.

The baseline is intentionally minimal: a self-issued empty grant over an empty lattice generation and an empty object registry, so the compiled TE matrix is empty (grants nothing) and no subject is enrolled. Its only effect is to make crate::mac::compiled_policy return Some, which switches the grant path’s subject resolver from deny-all to the real EnrollmentSubjectContextResolver. The active 9P PEP uses this policy as decision provenance.

Unlike compile_sign_load_install, this path locally derives an approval; that exception is confined to a private helper which constructs the empty policy internally and accepts no caller-controlled policy inputs. At daemon boot this is the first (and, given the OnceLock write-once seam, only) install, so installed is normally true; a false means a policy was already installed this process.

A future policy-authoring step (config-driven UCAN grant + enrollment) will need a swap-capable seam to replace this baseline at runtime — it cannot do so through the current write-once [install_compiled_policy] (see that function’s and compile_sign_load_install’s docs). The empty baseline is the fail-closed default until that seam lands.