Skip to content

v0.5.2

Latest

Choose a tag to compare

@github-actions github-actions released this 03 Dec 18:30
· 12 commits to main since this release
v0.5.2
952c69c

[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 (polkitd on Debian and Ubuntu), and drop
    transitions (python3-transitions, python-transitions).
  • ttp start interrupted by Ctrl-C or SIGTERM exits 1, not 0. ttp stop
    exits 8 when it cannot remove the table, and 1 when it cannot remove the
    DNS overlay.
  • A session lock left by a crash is no longer recovered by ttp start: end it
    with sudo 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, .rpm and PKGBUILD.
    packaging/make_manpage.py generates it from the CLI's commands, options and
    help texts, and a test fails when the committed page no longer matches them.
    ttp.service names it and the documentation site in Documentation=.

  • user under [notifications] in /etc/ttp/ttp.conf names the desktop
    recipient when no --notification-user is given. ttp.service has 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 transitions dependency, and the watchdog's state machine built on it
    (#193). Since 0.5.0 supervisor.py drives 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 .deb no longer depends on python3-transitions, the .rpm and
    the PKGBUILD no longer bundle a transitions wheel in
    /usr/lib/transparent-tor-proxy/vendor or depend on six for it, and the AUR
    package can drop python-transitions. ttp start --watchdog and
    ttp watchdog start no longer check for it before starting.
  • ttp start no 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 with sudo ttp stop. The documentation
    that promised auto-recovery after a kill -9 is corrected. The lock also no
    longer records watchdog_active and watchdog_pid, which nothing read:
    ttp watchdog status asks systemd.

Changed

  • ttp start --help says where --notification-user comes from when it is
    not given: notifications.user in /etc/ttp/ttp.conf, else the sudo user. It
    still said the option was required for a direct root invocation.

  • assets/ttp.conf.example has 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 start now 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 stop and
    ttp start --external-daemon look the account up among all four known
    names (debian-tor, toranon, tor, _tor), the list that Tor detection
    already used, instead of only tor and debian-tor.

Fixed

  • ttp.service marked the unit failed when ttp start exited 3 (Tor not
    verified) or 9 (notifications unavailable), although the session was
    installed. systemd runs ExecStop only for a unit that started, so
    systemctl stop ttp then removed nothing: the table and DNS overlay stayed
    until sudo ttp stop. The unit now has SuccessExitStatus=3 9. Found
    while following up a report by Rafael Dominiquini, the AUR package's
    maintainer, who tested ttp.service with notifications enabled.

  • ttp stop deleted the session lock even when it could not remove the
    inet ttp table. The table stayed (no network, or an empty table and no
    protection), while ttp status reported no session and a second ttp stop
    answered "No active session found". The lock now stays, and stop exits
    with 8 and points to ttp stop --restore-only. When the DNS overlay could
    not be removed, stop printed "Session terminated" and exited 0; it now
    says so and exits 1. A conntrack -F that 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 ttp table with the fingerprint that
    ttp start records (#80). If nft could not list the table at that moment,
    for example after a 10-second timeout, start recorded 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 start now 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-root exempted root only in the filter_out chain, 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 start recorded the
    interface eth0 in the session and printed "DNS set via overlay on interface
    eth0", even where no eth0 exists. The interface is only a label: the DNS
    overlay and the rules are system-wide. It is now recorded as unknown, and
    --interface says it is for diagnostics only. Unused code went with it:
    apply_dns's interface parameter, and the watchdog's is_interface_online
    and has_default_route, which nothing called (#194).

  • The .deb, .rpm and PKGBUILD did not depend on polkit. Each creates the
    ttp-watchdog account, 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 on polkitd (Debian/Ubuntu) or polkit (Fedora, Arch).

  • The watchdog installed by a native package logged only warnings and errors.
    It runs as ttp-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, so journalctl -p filters by level. A watchdog running as root
    keeps its file and gains the journal. A CLI run from a terminal is unchanged.

  • ttp start interrupted with Ctrl-C or SIGTERM before it recorded its session
    undid nothing and exited 0. It printed "Signal received, restoring
    network...", but the nftables table, the DNS overlay and the managed Tor
    stayed in place. ttp status then reported INACTIVE, ttp stop reported
    that no session was found, and a script that trusted the 0 believed the
    host was protected. The start is now undone as ttp stop --restore-only
    would undo it, including closing connections redirected during the start
    before the rules go, and it exits 1. Interrupted after the session was
    recorded, start still stops the session, but now exits 1 instead of 0.
    A latched emergency (exit 8) and a retained VPN guard (exit 10) are kept
    as before. The signal handler no longer tears anything down itself: it
    raises, so an nft or systemctl call in flight finishes unwinding before
    the undo starts.

  • ttp status printed 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 nse extra
    requires network-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.py replaces chaos_capture.py and 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 in scripts/vm/automap/capture.py.

  • scripts/vm/lifecycle/heal.sh installs the .deb in a Debian 13 VM, where
    the watchdog runs as ttp-watchdog as it does for anyone who installs a
    package. It stops ttp-tor and 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 nse extra
    requires network-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.py reads 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_network now hands the capture to the new
    network before its NIC exists, after QEMU confirms the old NIC is gone. The
    power-off phase stays on egress.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 nse extra requires network-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", which run.sh passed 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; the nse extra 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 installs util-linux, which ships the setpriv NSE
    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
    building packaging/PKGBUILD, as a community package to review before
    installing.

  • Startup phases and their failure
    contract
    states what
    each phase of ttp start changes, 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-tunnel AllowedIPs. 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, and assets/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 with GITHUB_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.yml now calls publish-docs.yml with 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_UNDER in make/python.mk) is 90%, down
    from 99%. Measured coverage of ttp/ 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