Expand description
The signed parent policy the user daemon exports (ADR-103 D8). The signed parent policy (ADR-103 A6, D8, Phase 2 package E).
The user daemon exports its governance rules and limits as a
ParentPolicy, signs it with the user key and writes it to
<run>/<id>/parent-policy.json. A project kernel reads it at boot (and on
governance.reload / governance.parent.update), checks the signature
against the user_pubkey of its certificate and merges its overlay onto it
(crate::governance_overlay::merge).
Signed bytes: PARENT_POLICY_DOMAIN + canonical JSON of every field but
sig (rules sorted by id, the risk threshold as the hex of its bits). The
tag is distinct from the certificate, anchor and proof-of-possession tags
of package A, so a signature made for one can never verify as another.
version only moves forward: a kernel pins the highest version it has
accepted and refuses an older signed policy (ParentPolicyError::Rollback),
so putting an old, looser, validly signed file back does nothing.
Structs§
- Parent
Policy <run>/<id>/parent-policy.json.
Enums§
- Parent
Policy Error - Why a parent policy was refused. Every variant names its key.
Constants§
- PARENT_
POLICY_ DOMAIN - Domain tag prepended to the signed bytes of a
ParentPolicy. - PARENT_
RULES_ DOMAIN - Domain tag of
parent_rules_hash. - PARENT_
SCHEMA - Parent policy format version.
- VERSION_
SLACK_ SECS - How far past the clock a previous version may be and still be believed.
Functions§
- export
- User side: snapshot
engine, tighten withlimits, sign. - export_
rules exportfrom an already-taken snapshot (rules, engine threshold and human-approval flag).- export_
rules_ to export_tofrom an already-taken snapshot.- export_
to - User side: export and atomically write
path(normally<run>/<id>/parent-policy.json). The version continues from whatever valid policy the file already holds. - load_
parent_ policy - Read and parse a parent policy file (size-capped; missing is an error: a project kernel with no parent policy must not start).
- next_
version - The next version after
prev: pastprevand past the clock, so a lost counter file cannot send the version backwards behind a kernel’s pin. - parent_
rules_ hash - Hash of a rule set and its limits (the
parent_hashof an effective merge). Coversactive, severity and selectors through each rule’s full serialized form. - verify_
parent_ policy - Check shape, hash and signature against the trusted user key.
- write_
atomic_ 0600 - Atomic write, mode 0600 on unix: a private temp file in the same
directory, fsynced, then renamed over
path.