Repository navigation
[0.5.2] - 2026-12-03
Maintenance, mostly for packagers and ttp.service. The packages depend on
polkit, so the watchdog restarts a failed Tor instead of engaging the emergency
killswitch, and no longer need transitions. ttp.service stays stoppable
when ttp start exits 3 or 9, and takes its notification recipient from
ttp.conf. --allow-root exempts root from the NAT chain too. An interrupted
ttp start undoes itself, and ttp stop keeps the session lock when it cannot
remove the table. Every package ships a ttp(1) man page.
Upgrade notes:
- Packagers: depend on polkit (
polkitdon Debian and Ubuntu), and drop
transitions(python3-transitions,python-transitions). ttp startinterrupted by Ctrl-C or SIGTERM exits1, not0.ttp stop
exits8when it cannot remove the table, and1when it cannot remove the
DNS overlay.- A session lock left by a crash is no longer recovered by
ttp start: end it
withsudo ttp stop. - With
--allow-root, root's TCP no longer goes through Tor; only its DNS to
the local resolver does.
Added
-
A
ttp(1)man page, installed by the.deb,.rpmand PKGBUILD.
packaging/make_manpage.pygenerates it from the CLI's commands, options and
help texts, and a test fails when the committed page no longer matches them.
ttp.servicenames it and the documentation site inDocumentation=. -
userunder[notifications]in/etc/ttp/ttp.confnames the desktop
recipient when no--notification-useris given.ttp.servicehas no sudo
user, so with notifications enabled it could not start a session without
editing the unit. The recipient's graphical session must already be running
when TTP starts; a session started at boot now says so plainly, rather than
"Exactly one local graphical session is required". Reported by Rafael
Dominiquini, the AUR package's maintainer.
Removed
- The
transitionsdependency, and the watchdog's state machine built on it
(#193). Since 0.5.0supervisor.pydrives the watchdog, and none of the
machine's transitions fired. Only its netlink and inotify subscriptions were
still used; they are now a plain class,ttp/watchdog/subscriptions.py, which
still engages the killswitch when it cannot subscribe. The packages get
lighter: the.debno longer depends onpython3-transitions, the.rpmand
the PKGBUILD no longer bundle atransitionswheel in
/usr/lib/transparent-tor-proxy/vendoror depend onsixfor it, and the AUR
package can droppython-transitions.ttp start --watchdogand
ttp watchdog startno longer check for it before starting. ttp startno longer recovers an "orphaned" session by itself. Only a lock
written by 0.4.x reached that path: every 0.5 session was already refused
with "Session Already Present". A lock left by a crash, of any version, is
now refused the same way and ended withsudo ttp stop. The documentation
that promised auto-recovery after akill -9is corrected. The lock also no
longer recordswatchdog_activeandwatchdog_pid, which nothing read:
ttp watchdog statusasks systemd.
Changed
-
ttp start --helpsays where--notification-usercomes from when it is
not given:notifications.userin/etc/ttp/ttp.conf, else the sudo user. It
still said the option was required for a direct root invocation. -
assets/ttp.conf.examplehas every value commented out. A package that
installs it as/etc/ttp/ttp.conf, as the AUR package does, no longer pins
the defaults of the day once an administrator edits one key. Thanks to Rafael
Dominiquini for the discussion of where the file belongs. -
An inconclusive Tor check at
ttp startnow says what holds meanwhile: the
nftables table was read back from the kernel as applied, and it blocks
non-exempt traffic rather than sending it in clear while Tor is not working. -
When the session lock does not say which UID Tor runs as,
ttp stopand
ttp start --external-daemonlook the account up among all four known
names (debian-tor,toranon,tor,_tor), the list that Tor detection
already used, instead of onlytoranddebian-tor.
Fixed
-
ttp.servicemarked the unit failed whenttp startexited 3 (Tor not
verified) or 9 (notifications unavailable), although the session was
installed. systemd runsExecStoponly for a unit that started, so
systemctl stop ttpthen removed nothing: the table and DNS overlay stayed
untilsudo ttp stop. The unit now hasSuccessExitStatus=3 9. Found
while following up a report by Rafael Dominiquini, the AUR package's
maintainer, who testedttp.servicewith notifications enabled. -
ttp stopdeleted the session lock even when it could not remove the
inet ttptable. The table stayed (no network, or an empty table and no
protection), whilettp statusreported no session and a secondttp stop
answered "No active session found". The lock now stays, andstopexits
with8and points tottp stop --restore-only. When the DNS overlay could
not be removed,stopprinted "Session terminated" and exited0; it now
says so and exits1. Aconntrack -Fthat timed out aborted the teardown
with a traceback before the rules were removed; it is now a warning, like a
failed flush. -
The watchdog compares the live
inet ttptable with the fingerprint that
ttp startrecords (#80). Ifnftcould not list the table at that moment,
for example after a 10-second timeout,startrecorded no fingerprint and the
watchdog skipped the comparison for the whole session. A flushed table keeps
its chain names, so it then passed the remaining checks: no rules, everything
in cleartext, watchdog healthy.ttp startnow rolls back when it cannot
read back its table, and the watchdog treats a missing fingerprint, or a
table it cannot read, as a firewall failure. This replaces the chain-name and
bypass-rule checks, which the fingerprint already covers. A bypass user
deleted during a session no longer cuts off the whole host's network. -
--allow-rootexempted root only in thefilter_outchain, not in the NAT
chain that redirects to Tor. Root's TCP and DNS were still sent through Tor,
while its UDP and ICMP left in cleartext: the flag gave neither the direct
path for system updates that the documentation promises, nor full Tor
routing. Root is now exempt in both chains, like a--bypass-user. Its DNS
to the local resolver still goes to Tor. -
With no default route, as on an IPv6-only host,
ttp startrecorded the
interfaceeth0in the session and printed "DNS set via overlay on interface
eth0", even where noeth0exists. The interface is only a label: the DNS
overlay and the rules are system-wide. It is now recorded as unknown, and
--interfacesays it is for diagnostics only. Unused code went with it:
apply_dns'sinterfaceparameter, and the watchdog'sis_interface_online
andhas_default_route, which nothing called (#194). -
The
.deb,.rpmand PKGBUILD did not depend on polkit. Each creates the
ttp-watchdogaccount, so the watchdog runs as that account and restarts a
stopped or crashed Tor through polkit (50-ttp-watchdog.rules), and only
polkit's daemon reads that rule. Without it, systemd answered "Access denied"
(measured on Debian 13), the heal failed, and the watchdog engaged the
emergency killswitch. Nothing leaked, but a Tor restart left the host with no
network until the user intervened. This happens on hosts without polkit, such
as servers and minimal installs; desktops usually have it. The packages now
depend onpolkitd(Debian/Ubuntu) orpolkit(Fedora, Arch). -
The watchdog installed by a native package logged only warnings and errors.
It runs asttp-watchdog, which cannot open root's/run/ttp/ttp.log.
setup_logging()then configured no handler at all, so Python's fallback
printed WARNING and above, and INFO lines appeared nowhere, a healed Tor
among them. When systemd connects stderr to the journal (JOURNAL_STREAM),
TTP now logs INFO and above there, each line prefixed with its syslog
priority, sojournalctl -pfilters by level. A watchdog running as root
keeps its file and gains the journal. A CLI run from a terminal is unchanged. -
ttp startinterrupted with Ctrl-C or SIGTERM before it recorded its session
undid nothing and exited0. It printed "Signal received, restoring
network...", but the nftables table, the DNS overlay and the managed Tor
stayed in place.ttp statusthen reportedINACTIVE,ttp stopreported
that no session was found, and a script that trusted the0believed the
host was protected. The start is now undone asttp stop --restore-only
would undo it, including closing connections redirected during the start
before the rules go, and it exits1. Interrupted after the session was
recorded, start still stops the session, but now exits1instead of0.
A latched emergency (exit8) and a retained VPN guard (exit10) are kept
as before. The signal handler no longer tears anything down itself: it
raises, so annftorsystemctlcall in flight finishes unwinding before
the undo starts. -
ttp statusprinted its Tor AppArmor, Required VPN and diagnostic lines with
the prefix as raw Rich markup,[bold cyan]\[TTP][/bold cyan] …, because
those lines turned markup off to show their values literally. Markup stays on
now, and only the values are escaped, so a profile name or a message
containing brackets still prints as it is.
Tests
-
The chaos sweep judges its fault windows with NSE 2.7.0, and the
nseextra
requiresnetwork-sandbox-engine>=2.7.0. In the guest, six NSE streams (DNS,
UDP and TCP in each family) run as the ordinary user, and the sweep sends
NSE's clocked beacons at every phase edge.
scripts/vm/lifecycle/chaos_observer.pyreplaceschaos_capture.pyand its
own probe. The acceptance rules are the same:- every guest frame to a fixture destination between a fault's beacons is
egress, now whatever its layout, IPv6 extension headers included; - a stream idle for more than 500 ms of a fault window, by the guest's
clock, makes the run inconclusive; - both controls must see every stream;
- nothing may leak during the final hold;
- egress counted before the evidence broke is kept.
The capture is read one record at a time, keeping only the guest's frames
to the fixture destinations. The automap experiment keeps its own pcap
reader, now inscripts/vm/automap/capture.py. - every guest frame to a fixture destination between a fault's beacons is
-
scripts/vm/lifecycle/heal.shinstalls the.debin a Debian 13 VM, where
the watchdog runs asttp-watchdogas it does for anyone who installs a
package. It stopsttp-torand requires the watchdog to restart it without a
killswitch. As a control, the same fault with polkit masked must end in the
killswitch. The other VM jobs install with pip, where the watchdog runs as
root, and the chaos sweep counts a killswitch as contained, so neither could
see the missing dependency below. The package smoke tests now also require
the account, polkitd and a readable rule. -
The lifecycle VM judges its phases with NSE 2.6.0, and the
nseextra
requiresnetwork-sandbox-engine>=2.6.0. In the guest, NSE's stimulus streams
run as the non-bypassed user between two beacons that carry the guest's clocks.
scripts/vm/lifecycle/observer.pyreads QEMU's capture. An attempt on the wire
always counts. An absence counts only when:- the capture is intact and holds both beacons;
- the beacons place every attempt inside it;
- each stream's log is complete;
- no time went untested, except a gap NSE measured as a suspend.
The control, the active session and the reboot now share one continuous
capture. Previously each phase had its own file. The suspend/resume phase runs
its streams through the suspend. Before, nothing was measured until after the
move to the new network.vm_swap_networknow hands the capture to the new
network before its NIC exists, after QEMU confirms the old NIC is gone. The
power-off phase stays onegress.py: a stream its machine kills never has a
complete log, so NSE cannot vouch for its absences.
Tests
run the real agents against loopback and break one instrument at a time: a
missing beacon, a cut or joined capture, a killed stream, attempts outside the
beacons, a gap while the guest ran. Packets captured before a phase's opening
beacon are not read as its attempts. The first VM run counted an earlier
cleartext phase's packet as a leak, because NSE 2.6.0 matched it by a reused
source port although it carried another stream's probe ID. -
The
nseextra requiresnetwork-sandbox-engine>=2.5.2. Each rule load in
the zero-leak suite used to add another copy of NSE's trace rules to the
namespace, so every traced packet repeated them once per load. The
untraced-load test now also requires NSE to name the missing output trace
chain as the reason readiness is unproven. -
The lifecycle VM's capture reader (
scripts/vm/lifecycle/egress.py) no longer
reports a capture it cannot vouch for as clean. An empty or cut-short pcap
used to read as "0 probe packets", whichrun.shpassed as contained; it is
now inconclusive, as is a non-Ethernet file, a frame snapped below its
addresses and any layout the reader does not parse (a VLAN tag, an unknown
EtherType). Every scenario must also show the guest's own SSH traffic in the
same window, so a window of replies only, or of nothing, fails instead of
passing. Non-first IPv4 fragments no longer have a port read from their
payload, and IPv6 extension headers are walked to the transport header
(O02 of the leak-testing plan). -
The zero-leak suite requires NSE 2.5.1 (
network-sandbox-engine>=2.5.1;
2.5.0 never reached PyPI) and uses three of its additions. Every capture
window now ends with a beacon the sandbox sends, an Ethernet frame no IP
rule touches, and a window whose beacon never arrived is refused before any
absence is read. The DNAT positive controls (a foreign DNAT ahead of TTP,
the systemd-resolved cases) now require the probe's own packet, matched by
its probe ID after the rewrite, instead of any packet to the rewritten
address. Rule traces use NSE's output-path trace chain, replacing the one
the suite loaded by hand, and NSE's canary-proven readiness check. New
tests require a window with a dropped canary and a trace without an output
chain to fail visibly. -
The zero-leak suite builds every probe on NSE 2.4.0's stimuli instead of
scripts it wrote itself; thenseextra now requires
network-sandbox-engine>=2.4.0. Each probe carries a probe ID, so the
positive control and the same-capture canary match their own packet rather
than any packet to the same address and port. A probe that cannot run (no
interpreter, an identity that cannot be applied) now stops the test instead of
leaving an empty capture that reads as containment. The round-trip test's echo
is NSE's logging receiver, so each run says separately whether the request left,
arrived and was answered. New tests break the instrument on purpose (a capture
on the wrong interface, before and after the control; a probe with no
interpreter; an earlier canary's packet) and require the harness to fail.
The Fedora test image installsutil-linux, which ships thesetprivNSE
uses to run a probe as another UID.
Documentation
-
Arch Linux users can install TTP from the
AUR with
yay -S transparent-tor-proxy, thanks to Rafael Dominiquini, who packaged it
and maintains the package. The README and the quickstart list it next to
buildingpackaging/PKGBUILD, as a community package to review before
installing. -
Startup phases and their failure
contract states what
each phase ofttp startchanges, where the first barrier falls and what a
failure or an interruption leaves behind. It is the L01 contract of the
leak-testing plan. -
The VPN guide shows how to import a provider's WireGuard file into
NetworkManager, and what to check first. It must have one peer, a numeric
endpoint (with how to replace a hostname) and a full-tunnelAllowedIPs. The
guide also shows the explicit firewall mark TTP requires and how to handle
the private key the file contains. -
assets/social-preview.png, the image GitHub shows when the repository is
linked, andassets/gif/demo.tape, which re-records the README demo from a
real session with VHS. The README demo is re-recorded with it from a real
0.5.1 session; the old GIF showed output from before 0.5.0.
Maintenance
- The documentation site is published by the release itself. The Release
workflow creates the GitHub Release withGITHUB_TOKEN, and events caused by
that token start no other workflow, so Publish Documentation
(release: published) never ran for a tag push: 0.5.0 and 0.5.1 were
published by hand.release.ymlnow callspublish-docs.ymlwith the tag
once PyPI has the version. - Verify release runs the smoke test of the tag it verifies, not main's. The
weekly check of 0.5.1 failed on 2026-12-03: main's smoke test imports
ttp.watchdog.subscriptions, which 0.5.1 predates. The published packages
were fine. - The unit coverage floor (
COV_FAIL_UNDERinmake/python.mk) is 90%, down
from 99%. Measured coverage ofttp/is still 99.0%; the floor no longer
blocks a fix whose new branch is hard to reach in a test.
Full Changelog: v0.5.1...v0.5.2
Verifying these artifacts: see docs/verification.md