v1 slice 9: grants: record_lesson and lesson_status are realm only, refused cross-realm #12
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose (security): mcl-scribe's procedures are granted only inside its realm, with
brief_packageandreport_outcomefor Martha's identity alone.After slice 1, before the first deploy. Threat model first: the outside attacker is a caller from another realm, or an unknown identity in this one. Crew members are trusted.
record_lesson,lesson_statusandsearch_lessonsgo to the realm's identified callers.brief_packageandreport_outcomego to the operator-configured Martha identity.Done when:
record_lessonandlesson_status(test with a second realm key).Scope narrowed (2026-11-25). Mars ruling 2026-11-25: "(a). Do #12 now for record_lesson and lesson_status: the cross-realm refusal test with a second realm key on both, plus the startup grant log line, threat model first."
This PR proves the grants of the procedures that exist after slice 1. The removed lines moved with the procedures they guard:
{callers, {nodes, [MarthaId]}}from operator config) and its refusal test, including "a realm member who is not Martha is refused onreport_outcome": to #10 (brief_package) and #11 (report_outcome).search_lessons' grant and its cross-realm refusal test: to #9.Refs #1
v1 slice 9: grants: only the realm's callers, and Martha alone for brief and outcometo v1 slice 9: grants: record_lesson and lesson_status are realm only, refused cross-realmThreat model (before code), for the narrowed #12
What is at stake. A recorded lesson's text before the scan, which may carry exactly what the leak scan is there to refuse. The refusal reason
lesson_statusreturns, which names those terms (person, host, repo). The realm's memory: every lesson that passes is written to mcl-rag under mcl-scribe's own identity.The outside attacker (as #12 states; crew members are trusted):
Out of scope: the realm's members, of any tier (the realm is the privacy boundary, DECIDED 2026-11-25), and the operator.
record_lesson: writes into this realm's memory through the scribe's identity{callers, members}, resolved by macula to{realm_member_required, RealmKeyId, any}: the token must be signed by THIS realm's keyrecord_lessonlesson_status: reads refusal reasons that name private termslesson_statusconfidential => required(slice 1, tested)openor noauth{callers, members}; macula logs one line per served procedure naming its classmembers, none isopen; the startup line is macula'sclass_declaredno_realm_key): the procedure is not served at allHow it is tested. No mesh, no outside service. Each capability's declared
authgoes through macula's own resolver (macula_client:caller_policy/3) and its own token check (macula_ucan:authorize/3), with real keys generated in the test: one realm key for this realm and a second realm key. So the test exercises the code the link runs at the door, not a copy of it. Each guard gets a mutant (memberstoopen; a capability withoutauth).Accepted residuals. Any member of the realm, at any tier, may record a lesson and read the status of any lesson id it knows. Lesson ids are 128-bit random but are not relied on as a secret.
Landed: PR 14 → main
ef745e4(tipb0c4ce70).Purpose (security) MET for the procedures that exist after slice 1 (scope narrowed per the Mars ruling above; the Martha-only and
search_lessonsgrants moved to #9, #10, #11):record_lessonandlesson_status, tested with a second realm key:mcl_scribe_grants_testsT1/T2, reason pinnednot_the_issuer; also T3 (malformed,expired) and T4 (not_the_audience).the_startup_log_names_each_procedures_grant.Grants mutants (members→open, →role, one procedure open, →nodes of a stranger) all killed. The procedure name is the release's own (org from config/sys.config.src via mcl_om_capabilities:org_procedure/2).