simple_clearance
simple_clearance
¶
Terminal-based clearance fallback for hosts without the D-Bus hub.
simple-clearance is the stripped-down sibling of the full Clearance
flow: instead of desktop notifications and a TUI sharing signals over
org.terok.Shield1, it streams blocked-connection events from a
subprocess NFLOG reader and prompts the operator on a terminal.
Verdicts are applied by shelling out to the audited
terok-shield allow|deny CLI, so the trust boundary is identical.
Refuses to run when the D-Bus hub is active on the session bus — concurrent application from both paths would race on the same verdict, so only one is enabled at a time.
ClearanceSession(*, state_dir, container)
¶
Drive the terminal clearance loop for a single container.
Owns the reader subprocess, the operator prompt UI, and the verdict subprocess calls. Lives until the reader exits or the operator interrupts with Ctrl-C.
Prepare the session — the reader is spawned in run.
Source code in src/terok_shield/simple_clearance.py
run()
¶
Spawn the reader, then multiplex its stdout with stdin prompts.
Source code in src/terok_shield/simple_clearance.py
run_simple_clearance(state_dir, container)
¶
Run the terminal clearance fallback for container.
Refuses to start when org.terok.Shield1 already has an owner on
the session bus — the D-Bus hub would race this tool on every verdict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state_dir
|
Path
|
Per-container shield state directory. |
required |
container
|
str
|
Container name. |
required |