Repository navigation
Release 0.13.0
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-aclrefreshes the readonly allow rule again. The compatibility
path was wired toacl 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: denyand the upgrade looked like it changed nothing. Applying
a scan is the explicit write and merges the full default;acl syncstays
deny-only.- A refusal for a path that contains a protected location no longer reports the
protected path as the protector.rm -r /tmpwhere~/.awslives 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'spath_guardsummary uses the same access mode as the call
it describes. It derived the mode fromannotations.readonlyalone, so a call
whoseargvcheck refused a path still reportedallowed: truebeside it — a
summary disagreeing with the verdict it summarises.- A
readonlymodule that declaresx-apexe-writes-withis now checked at the
strength its arguments call for.access_modeconsultedreadonlyfirst and
returned before reading the list, which made the list unreachable for exactly
the tools it exists for: areadonlyfindgiven-deletewas 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.yamltemplate now means exactly what the compiled
defaults mean. It disagreed in three lists —readonlywas missing nine words
the baseline has (find,ps,whoami, …),requires_approvalomitted
--recursive, andruns_other_commandsomittedsuandfind— so running
apexe config initsilently changed decisions relative to having no file at
all. A test now compares the template againstAnnotationDefaults::default(),
which is how the divergence was found and what keeps it from coming back. schema_versionanddefaults_revisionare real config fields. They were in
the shipped template while nothing read them, becauseApexeConfigtolerates
unknown keys: a file stating its schema version was stating something the
binary never checked.
Documentation
docs/sandbox.mdanddocs/sandbox-testing.mdadd 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_digestin
audit.jsonl) — plus the selection rule (opt-in per module id, never a blanket
wrapper) and the measured reason macOS isadvisory: on macOS 26.3 (arm64)
sandbox-execaccepted 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 policyis nowapexe paths, matching thepaths:section it reports
on.policywas 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 readspolicywhile printingpathsvocabulary would
preserve the confusion it was renamed to remove.
Added
list --diagnosticsnames the granted modules that are notreadonly, 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: denyingrmwhile grantingpython3constrains 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 syncreports readonly modules that match no allow rule. A corpus update
that turnsdestructiveintoreadonlyremoves the module from the deny rule
and, because sync never generates an allow, leaves it matching nothing — it
falls todefault_effect: denyand 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.AnnotationOverridesgainsapproval_flags(properties whose
presence puts the call to a human) andwrites_with(properties whose presence
means the call may write), both written intoannotations.extrawhere the
approval gate and the path guard already read them.writes_withdefaults 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
findexpressible at all: it reads the
filesystem unless-delete/-execis given, so a blanketrequires_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.AnnotationOverridesalso 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-withnarrows the path guard's access mode per call: when
none of the named properties is set, a non-readonlymodule's path arguments
are checked at read strength. Module-level annotation was the wrong
granularity for tools that only write when asked —find -deleteexists, so
every read-onlyfindwas checked as a writer. The key can only narrow, never
widen: a module that can write without the named properties must not carry it,
andsedis the standing example (sed -n 'w /etc/x' filewrites with no flag
at all). Absent the key, nothing changes. -
config.yamlgains anannotations: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 removesrmfromdestructiveexpectsrmto stop being labelled — an
additive merge would silently ignore that. Root executables and subcommand
words stay separate: merging them marked/usr/bin/syncas network-reaching,
a regression the existing test for it caught. -
config.yamlgains apaths:section that states the path policy in the
vocabulary the idea came from:read_only(systemdReadOnlyPaths=),
read_write(ReadWritePaths=),no_access(InaccessiblePaths=) and
write_only(AppArmor'swright). 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 initwrites the commented template from
docs/config.example.yamlinstead of a bareserde_yamldump 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-timeinclude_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-censusreports the three states a command on this machine
can be in:granted(bound and allowed for--caller),denied(bound and
refused by the policy), andunscanned(onPATHwith no binding at all —
the only oneapexe 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 explainsplit policy
authorship out ofscan.initwrites a starter policy once and refuses to
overwrite one,syncrefreshes only the destructive and open-world denials,
andexplainnames 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 developergrants the local shell the rest of what this
machine installed (callers: ['local']→cli.*, placed below the denials so
first-match-wins ordering still refusesrm). 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 todefault_effect: deny.
--profile strictkeeps the previous shape, where every grant is one you
wrote. Unauthenticatedserve/a2aclients 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
~/.apexeis 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 scanno longer writesacl.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-aclkeeps an
existing script working for one release: it writes a starter only when none
exists, then syncs the denials, and never grants.apexe scannarrows 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, soapexeno longer parses the whole installation's grammar before
running anything: a governedlson 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.yamlconvention 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-declaredbindings.pattern— falls back to the full
load, so narrowing stays a performance decision and never a coverage one.apexe execnarrows the same way: a module-id call loads only its own
binding, and a native call (apexe exec -- ls -la) loads thecli.<tool>
namespace ofargv[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 -- lswent from ~130 ms to ~10 ms.