v1 slice 9: grants: record_lesson and lesson_status are realm only, refused cross-realm #12

Closed
opened 2026-11-25 18:00:30 +00:00 by uranus · 2 comments
Member

Purpose (security): mcl-scribe's procedures are granted only inside its realm, with brief_package and report_outcome for 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.

  • A grant per procedure through mcl-om. record_lesson, lesson_status and search_lessons go to the realm's identified callers. brief_package and report_outcome go to the operator-configured Martha identity.
  • No open-callers opt-out on any procedure.

Done when:

  • A caller from another realm is refused on record_lesson and lesson_status (test with a second realm key).
  • The startup log names each procedure's grant (none says "open callers").

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:

  • The Martha-only grant ({callers, {nodes, [MarthaId]}} from operator config) and its refusal test, including "a realm member who is not Martha is refused on report_outcome": to #10 (brief_package) and #11 (report_outcome).
  • search_lessons' grant and its cross-realm refusal test: to #9.
  • The fleet#78 deploy gate reads "#12 met for the procedures that exist at deploy time".

Refs #1

Purpose (security): mcl-scribe's procedures are granted only inside its realm, with `brief_package` and `report_outcome` for 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. - A grant per procedure through mcl-om. `record_lesson`, `lesson_status` and `search_lessons` go to the realm's identified callers. `brief_package` and `report_outcome` go to the operator-configured Martha identity. - No open-callers opt-out on any procedure. Done when: - [ ] A caller from another realm is refused on `record_lesson` and `lesson_status` (test with a second realm key). - [ ] The startup log names each procedure's grant (none says "open callers"). **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: - The Martha-only grant (`{callers, {nodes, [MarthaId]}}` from operator config) and its refusal test, including "a realm member who is not Martha is refused on `report_outcome`": to #10 (`brief_package`) and #11 (`report_outcome`). - `search_lessons`' grant and its cross-realm refusal test: to #9. - The fleet#78 deploy gate reads "#12 met for the procedures that exist at deploy time". Refs #1
uranus changed title from v1 slice 9: grants: only the realm's callers, and Martha alone for brief and outcome to v1 slice 9: grants: record_lesson and lesson_status are realm only, refused cross-realm 2026-11-25 18:57:52 +00:00
Author
Member

Threat 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_status returns, 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):

  • A. A caller from another realm. A real identity, with a valid membership token from its own realm.
  • B. An unknown identity in this realm. No membership token, an expired one, or a copy of another node's token.

Out of scope: the realm's members, of any tier (the realm is the privacy boundary, DECIDED 2026-11-25), and the operator.

# Threat Control Proof
T1 A calls 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 key Test: a token signed by a second realm key is refused on record_lesson
T2 A calls lesson_status: reads refusal reasons that name private terms as T1 Test: the same second-realm token is refused on lesson_status
T3 B calls with no token or an expired one as T1 Test: refused on both procedures
T4 B replays another node's genuine token the token's audience is bound to the wire-authenticated caller (macula) Test: a token of this realm minted for another node is refused
T5 A station or link reads a lesson in transit confidential => required (slice 1, tested) in place
T6 A procedure ships with open or no auth every capability declares {callers, members}; macula logs one line per served procedure naming its class Test: every capability's class is members, none is open; the startup line is macula's class_declared
T7 The realm key is not pinned, and a member class would be served open macula refuses to resolve the class (no_realm_key): the procedure is not served at all Test: resolving our declared auth with no pinned key refuses

How it is tested. No mesh, no outside service. Each capability's declared auth goes 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 (members to open; a capability without auth).

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.

## Threat 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_status` returns, 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): - **A. A caller from another realm.** A real identity, with a valid membership token from *its own* realm. - **B. An unknown identity in this realm.** No membership token, an expired one, or a copy of another node's token. Out of scope: the realm's members, of any tier (the realm is the privacy boundary, DECIDED 2026-11-25), and the operator. | # | Threat | Control | Proof | | --- | --- | --- | --- | | T1 | A calls `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 key | Test: a token signed by a second realm key is refused on `record_lesson` | | T2 | A calls `lesson_status`: reads refusal reasons that name private terms | as T1 | Test: the same second-realm token is refused on `lesson_status` | | T3 | B calls with no token or an expired one | as T1 | Test: refused on both procedures | | T4 | B replays another node's genuine token | the token's audience is bound to the wire-authenticated caller (macula) | Test: a token of this realm minted for another node is refused | | T5 | A station or link reads a lesson in transit | `confidential => required` (slice 1, tested) | in place | | T6 | A procedure ships with `open` or no `auth` | every capability declares `{callers, members}`; macula logs one line per served procedure naming its class | Test: every capability's class is `members`, none is `open`; the startup line is macula's `class_declared` | | T7 | The realm key is not pinned, and a member class would be served open | macula refuses to resolve the class (`no_realm_key`): the procedure is not served at all | Test: resolving our declared auth with no pinned key refuses | **How it is tested.** No mesh, no outside service. Each capability's declared `auth` goes 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 (`members` to `open`; a capability without `auth`). **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.
Author
Member

Landed: PR 14 → main ef745e4 (tip b0c4ce70).

Purpose (security) MET for the procedures that exist after slice 1 (scope narrowed per the Mars ruling above; the Martha-only and search_lessons grants moved to #9, #10, #11):

  • cross-realm caller refused on record_lesson and lesson_status, tested with a second realm key: mcl_scribe_grants_tests T1/T2, reason pinned not_the_issuer; also T3 (malformed, expired) and T4 (not_the_audience).
  • startup log names each grant, none "open callers": 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).
Landed: PR 14 → main ef745e4 (tip b0c4ce70). Purpose (security) MET for the procedures that exist after slice 1 (scope narrowed per the Mars ruling above; the Martha-only and `search_lessons` grants moved to #9, #10, #11): - cross-realm caller refused on `record_lesson` and `lesson_status`, tested with a second realm key: `mcl_scribe_grants_tests` T1/T2, reason pinned `not_the_issuer`; also T3 (`malformed`, `expired`) and T4 (`not_the_audience`). - startup log names each grant, none "open callers": `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).
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
macula-services/mcl-scribe#12
No description provided.