Expand description
§12d Network security fails closed: the hold, as lane-nix’s
planarian-hold@<unit>.service (nix/posture.nix) builds it. This module
only starts and stops that unit, reads which holds are in place, and
writes the release marker the hold script honours:
- apply:
systemctl start planarian-hold@<unit>.service(idempotent; systemd’sOnFailure=starts the same unit on a crash or kill); - lift:
systemctl stopof it; - reapply:
systemctl reloadof it (ExecReload: rebuild the table, never lift); - state:
/run/planarian/hold/<unit>exists while a hold is in place; - release:
/run/planarian/hold-released/<unit>holdsboot(until the next boot), or<unix> <boottime>: the expiry in Unix seconds and the same deadline inCLOCK_BOOTTIMEseconds. The script takes whichever passes first, so a stepped wall clock cannot lengthen a release; an unparsable or past one is expired (the script holds).
<unit> is the systemd unit name without .service. A failure posture
response, not a transition (docs/bypasses.md): no Prepared, no lease,
no op tag. It only ever restricts traffic, except lift, which the
daemon calls only once the unit is Running and its Readiness probes pass,
or on an attested release.
Constants§
Functions§
- apply
- Start the unit’s hold, waiting at most
wait(and never past TIMEOUT). Past it thesystemctlclient is killed and the result isUnknown; systemd’s start job is the manager’s, not the client’s, and goes on, so the hold may still land. - boottime_
s 🔒 - end_
release_ in - held_in
- The units held now, from the hold script’s state directory. A directory that cannot be read (other than absent: no hold was ever applied) is an error, never “none” (rule 21).
- hold_
unit 🔒 - instance
- The hold’s instance name: the unit’s systemd name without
.service. - lift
- marker
- The marker’s content:
boot, or the expiry in Unix seconds and the same deadline on the boot clock,boottime_now + (until - wall_now), both truncated to seconds. A deadline already past saturates toboottime_nowor below: expired. - marker_
path 🔒 - outcome 🔒
- reapply
- Rebuild the hold’s table in place (
ExecReloadruns the script’sreapply). A reload never lifts the hold, where a restart would runExecStop(lift) first and let traffic through for a moment. - reapply_
with 🔒 - release_
in - Write the release marker, then lift the hold. The marker comes first so that a failure racing the lift does not re-apply the hold.
- table_
present - The hold script’s table (
table inet planarian-hold). - wall_
now 🔒