Skip to content

Release 0.13.0

Choose a tag to compare

@tercel tercel released this 14 Nov 12:47
· 53 commits to main since this release

Fixed

  • A flag list dropped for naming an undeclared property is now recorded on the
    module (metadata["x-apexe-overlay-undeclared"]), not only logged. Dropping is
    still the right call — a trigger that can never fire would check a writing call
    at read strength — but the drop is a claim that did not take effect, and a log
    line nobody reads is indistinguishable from silence. apexe list --format json
    now shows it, and one helper computes it for both the drop and the record so the
    two cannot disagree.
  • scan --write-acl refreshes the readonly allow rule again. The compatibility
    path was wired to acl sync's deny-only floor, so a scan that made a module
    readonly — which is what a corpus update does when a command stops being
    destructive — left it matching no rule at all: it fell to
    default_effect: deny and the upgrade looked like it changed nothing. Applying
    a scan is the explicit write and merges the full default; acl sync stays
    deny-only.
  • A refusal for a path that contains a protected location no longer reports the
    protected path as the protector. rm -r /tmp where ~/.aws lives under /tmp
    said "'/tmp' … which is protected by '/tmp/h/.aws'" — the relation runs the
    other way, and the sentence now says "which contains the protected location",
    so an operator is not sent to change the wrong entry.
  • exec --dry-run's path_guard summary uses the same access mode as the call
    it describes. It derived the mode from annotations.readonly alone, so a call
    whose argv check refused a path still reported allowed: true beside it — a
    summary disagreeing with the verdict it summarises.
  • A readonly module that declares x-apexe-writes-with is now checked at the
    strength its arguments call for. access_mode consulted readonly first and
    returned before reading the list, which made the list unreachable for exactly
    the tools it exists for: a readonly find given -delete was still checked
    at read strength, so a protected path stayed writable through it. Found by
    driving the real binary rather than by the unit tests, which had encoded the
    wrong order as an expectation.
  • The shipped config.yaml template now means exactly what the compiled
    defaults mean. It disagreed in three lists — readonly was missing nine words
    the baseline has (find, ps, whoami, …), requires_approval omitted
    --recursive, and runs_other_commands omitted su and find — so running
    apexe config init silently changed decisions relative to having no file at
    all. A test now compares the template against AnnotationDefaults::default(),
    which is how the divergence was found and what keeps it from coming back.
  • schema_version and defaults_revision are real config fields. They were in
    the shipped template while nothing read them, because ApexeConfig tolerates
    unknown keys: a file stating its schema version was stating something the
    binary never checked.

Documentation

  • docs/sandbox.md and docs/sandbox-testing.md add the specification for
    delegating confinement to an existing backend (systemd-run, bwrap, a
    container runtime) instead of implementing one. No behaviour changes: no
    backend is implemented.
    The contract answers two questions an operator asks
    first — what can the backend actually express (capabilities, including
    deny_within_grant), and what happened on this call (sandbox_backend,
    sandbox_enforcement, sandbox_outcome, sandbox_policy_digest in
    audit.jsonl) — plus the selection rule (opt-in per module id, never a blanket
    wrapper) and the measured reason macOS is advisory: on macOS 26.3 (arm64)
    sandbox-exec accepted a profile denying writes beneath a directory and did
    not block the write, with the commands and output recorded in the document so
    the finding can be re-run rather than believed.

Changed

  • apexe policy is now apexe paths, matching the paths: section it reports
    on. policy was the wrong word for it: the ACL is policy too, and the command
    only ever described locations. No alias is kept — the command is rarely used
    and an alias that reads policy while printing paths vocabulary would
    preserve the confusion it was renamed to remove.

Added

  • list --diagnostics names the granted modules that are not readonly, because
    their path checks cover only the arguments a call declares. A command that
    computes its own paths — an interpreter, a script, a pipeline — is outside that
    check: denying rm while granting python3 constrains which tool is spelled,
    not what can be done, and nothing said so. The list is deliberately labelled as
    every granted non-readonly module rather than a verdict on each, because apexe
    cannot tell which ones compute paths internally; a precise classification needs
    a corpus annotation.

Added

  • acl sync reports readonly modules that match no allow rule. A corpus update
    that turns destructive into readonly removes the module from the deny rule
    and, because sync never generates an allow, leaves it matching nothing — it
    falls to default_effect: deny and the upgrade looks like it did nothing. In
    the strict profile that was the whole effect of the change. Sync now names the
    modules and the command that rebuilds the allow rule; it does not grant them,
    because an allow the operator did not review is the thing this separation
    exists to prevent.

Added

  • An overlay can scope approval and write behaviour to flags instead of the
    whole module. AnnotationOverrides gains approval_flags (properties whose
    presence puts the call to a human) and writes_with (properties whose presence
    means the call may write), both written into annotations.extra where the
    approval gate and the path guard already read them. writes_with defaults to
    the approval list, because the two answer one question — which arguments are
    the dangerous ones — and a second hand-maintained list is a second thing to
    drift.

    This is what makes a tool like find expressible at all: it reads the
    filesystem unless -delete/-exec is given, so a blanket requires_approval
    makes it unusable and no marking leaves arbitrary programs ungated.

    A flag list naming a property the module does not declare is dropped, with an
    error that names the unknown property and the real ones. Applying it would be
    worse than dropping it: a trigger that can never fire checks a writing call at
    read strength, while dropping leaves the module at write strength — the same
    conservative state as a module with no lists.

    AnnotationOverrides also refuses unknown keys now. Before this, an author who
    misspelled one was silently ignored — an overlay that loads and does nothing is
    indistinguishable from one that works, which is the failure mode this project
    keeps having to fix.

  • x-apexe-writes-with narrows the path guard's access mode per call: when
    none of the named properties is set, a non-readonly module's path arguments
    are checked at read strength. Module-level annotation was the wrong
    granularity for tools that only write when asked — find -delete exists, so
    every read-only find was checked as a writer. The key can only narrow, never
    widen: a module that can write without the named properties must not carry it,
    and sed is the standing example (sed -n 'w /etc/x' file writes with no flag
    at all). Absent the key, nothing changes.

  • config.yaml gains an annotations: section: the lists that label a command
    when nothing has reviewed it are now the operator's. A configured list
    replaces the compiled default rather than adding to it, because a machine
    that removes rm from destructive expects rm to stop being labelled — an
    additive merge would silently ignore that. Root executables and subcommand
    words stay separate: merging them marked /usr/bin/sync as network-reaching,
    a regression the existing test for it caught.

  • config.yaml gains a paths: section that states the path policy in the
    vocabulary the idea came from: read_only (systemd ReadOnlyPaths=),
    read_write (ReadWritePaths=), no_access (InaccessiblePaths=) and
    write_only (AppArmor's w right). The four names are the four subsets of
    {read, write}, so there is no fifth state to explain and no allow/deny pair to
    misread — the deepest matching entry decides, and a path may appear in only one
    list. An absent section leaves the compiled-in baseline in force; an empty one
    is a policy that protects nothing, which is why the distinction is kept.

  • apexe config init writes the commented template from
    docs/config.example.yaml instead of a bare serde_yaml dump of the defaults.
    The template describes only what this release enforces.
    The file an operator receives and the file the manual points at are now the
    same text, and a build-time include_str! fails if one moves without the
    other.

  • The manual's "coverage and policy are two gates" model is now three: coverage
    (bindings), permission (acl.yaml) and access (paths:), with the command
    that inspects each and the migration table from the old path keys.

  • apexe list --path-census reports the three states a command on this machine
    can be in: granted (bound and allowed for --caller), denied (bound and
    refused by the policy), and unscanned (on PATH with no binding at all —
    the only one apexe scan <tool> fixes). It reads directory entries and the
    policy and never scans or executes anything, so "this command does not work
    here" becomes a one-line diagnosis instead of a refusal met one call at a
    time. On this machine it reports 2017 executables, 27 bound, 1990 unscanned.

  • apexe acl init / apexe acl sync / apexe acl explain split policy
    authorship out of scan. init writes a starter policy once and refuses to
    overwrite one, sync refreshes only the destructive and open-world denials,
    and explain names the rule that decided a given module for a given caller.
    The split follows the authority: a generated denial can only restrict, while a
    generated allow is a grant nobody reviewed — which is how a policy came to be
    a projection of the last scan rather than an operator's document.

  • acl init --profile developer grants the local shell the rest of what this
    machine installed (callers: ['local'] → cli.*, placed below the denials so
    first-match-wins ordering still refuses rm). It replaces the per-module
    enumeration every developer had to hand-write: a module the scanner could not
    classify is now usable locally instead of falling to default_effect: deny.
    --profile strict keeps the previous shape, where every grant is one you
    wrote. Unauthenticated serve/a2a clients are unaffected by the local rule.

  • Generated policies carry a header stating the model and the evaluation order,
    and a rewrite preserves it — YAML drops comments on parse, so without this the
    one part of the file that explains its rule order was erased by every sync.

Changed

  • ~/.apexe is readable through a governed tool and still not writable. It holds
    the policy, the audit trail and the recorded security evidence, so reading is
    how an operator — or the agent helping them — finds out what is actually
    enforced; the old read refusal bought nothing, since the agent's own file tools
    already reach it and no shim governs those. Writing stays refused: a wrapped
    tool that can rewrite the policy can govern itself, including deleting the
    record of what it did.
  • apexe scan no longer writes acl.yaml. It produces bindings, which is its
    declared deliverable; writing the policy as a side effect of learning about a
    tool is what let a policy drift away from any review. --write-acl keeps an
    existing script working for one release: it writes a starter only when none
    exists, then syncs the denials, and never grants.
  • apexe scan narrows the bindings it loads to the tool it scanned, and a shim
    loads only the bindings its own command can reach, not every installed
    tool's. The shim already knows from its manifest which routes a command
    serves, so apexe no longer parses the whole installation's grammar before
    running anything: a governed ls on an install with 174 bindings went from
    ~150 ms to ~10 ms, and the cost of a call no longer grows with the number of
    tools installed. Selection is by module-id prefix, matching the
    {module_id}.binding.yaml convention the writer uses, and every case that
    could make the subset narrower than the full load — no matching file, an empty
    route list, an operator-declared bindings.pattern — falls back to the full
    load, so narrowing stays a performance decision and never a coverage one.
  • apexe exec narrows the same way: a module-id call loads only its own
    binding, and a native call (apexe exec -- ls -la) loads the cli.<tool>
    namespace of argv[0], which is the whole scope route resolution consults.
    A tool with many subcommands (e.g. git) still loads that tool's full route
    set, because resolving a subcommand needs its siblings to disambiguate;
    apexe exec -- ls went from ~130 ms to ~10 ms.