[FEATURE] Derive immutable invocation-scoped authority brokers #26
Labels
No labels
alpha-1
bug
ci
docs
duplicate
enhancement
help wanted
invalid
performance
phase-6
question
refactor
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
erix/launchd#26
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?
Problem and motivation
Native tools prepare a specific command before requesting file authority. A
single executable may inspect an image or publish a newly built image, so its
authenticated manifest describes more operations than one invocation needs.
Launchd should let that invocation retain an immutable broker limited to its
prepared file operations.
Proposed behavior and scope
Add an explicit derivation operation to Launchd's existing job-bound broker.
Accept a complete, counted set of exact operation, object-class, raw selector
and lifetime rows. Validate every row against the original authenticated
manifest, inherited script and invoking session ceilings. Return a fresh,
SEND-only derived broker with those immutable rows; derivation opens no files,
pregrants no objects and performs no interactive approval.
Use the derived broker for the native
Boot backend: inspect and
verify request only their original reads, while build and extraction add only
the exact selected publications. Commands with no file operations retire their
unused original broker before ordinary effects and need no derived broker.
Keep acquisition and release behavior compatible for existing clients.
Authority, security and reliability
The producer is Launchd's retained authenticated job receiver. Caller-supplied
names, hashes, request numbers and slots are descriptions, never authority.
Derived rows must be a subset of every original ceiling, with exact selector
bytes and lifetimes no broader than invocation scope. A derived receiver cannot
derive a broader broker or regain the original receiver.
At the first accepted preparation, Launchd must reject actual pending or live
original file grants and put the original receiver into a monotone
prepare/cleanup-only state. Block simultaneous ordinary acquisitions.
Commit delivery, abort, cancellation and uncertain delivery cannot restore
broader ordinary access. This transition uses Launchd's actual job/grant
tables; client counters and local alias deletion do not prove revocation.
The client must positively retire its original broader local sender before
ordinary command effects. Retain the actual original binding, generation,
correlation and lifetime in an opaque derived receipt, with its own once-only
retirement. Failed delivery, malformed receipts, cancellation or uncertain
retirement freeze the actual owner. Do not reacquire a transaction by ID, retry
an uncertain derivation or replace the first error with a cleanup error.
Existing grants remain tied to their original issuer and exact retirement
route. Job teardown must account for original and derived receivers and any
in-flight replies. Detached signing authority remains separate.
Acceptance criteria
lifecycle contracts before adopting them in native tools.
without opening objects or granting interactive escalation.
selector changes, duplicate rows, malformed counts and stale job generations.
actual pending and live grants; abort or uncertain delivery cannot reopen it.
effects; retain independent cleanup uncertainty and refuse reuse.
transfer, cancellation, job exit and outstanding reply paths.
workloads for read-only, publishing and authority-free commands.
technical manual; keep files and counted row sets free of arbitrary limits.
Alternatives and tradeoffs
A private Rust field that omits a publisher does not narrow a broker still held
by the process. Opening every potential object during preparation changes effect
ordering and unnecessarily retains grants. An immutable derived broker narrows
future requests while preserving on-demand acquisition and original cleanup.
It adds a small explicit receiver lifecycle that must be accounted for fully.
Tracking and rollout
Coordinate with Boot-tool issue 6,
Integration PR 12.
Land the producer, shared codecs and client together before native Boot adopts
the derived route. Keep existing clients usable until their explicit migration.