Skip to content

portop v0.3.0

Choose a tag to compare

@github-actions github-actions released this 18 Oct 01:35
· 26 commits to main since this release
dd24c84

The biggest release so far: portop now tells you who can reach each port and whether the firewall lets them in, names Kubernetes pods and a server's workers, shows per-connection traffic, and gains --wait, --free, Prometheus metrics, an APT repository and a documentation site. It also fixes more than twenty bugs, several of them security-related. Upgrading is recommended, especially if you use --diff from cron, expose the web dashboard with --web-addr, or run portop with sudo.

New

  • Exposure at a glance. Listening ports are colored by who can reach them: red for every interface, amber for one address, green for loopback only. New IFACE and USER columns, sorting by exposure, and scope and user in --json.

  • Firewall verdict. For ports the network can reach, portop reads the host firewall and shows allowed, restricted or blocked: ufw, firewalld and nftables on Linux (as root), the application firewall on macOS, the firewall profiles on Windows. Where it cannot tell it shows ?. --no-firewall turns it off.

  • Masters and workers. A socket shared by nginx, gunicorn, php-fpm or Apache shows as one row owned by the master, nginx +3, with the workers in the details and in JSON. On macOS this also removes the duplicate rows lsof printed for shared sockets.

  • Per-connection traffic. Established TCP connections show bytes per second, on Linux from the kernel's socket diagnostics (no root, no eBPF) and on macOS from nettop. Not available on Windows. --no-traffic turns it off.

  • Kubernetes and Podman. On nodes running containerd or CRI-O, pod processes are named namespace/pod/container from the kubelet's records; Podman's Docker-compatible sockets are used too.

  • --wait and --free. portop --wait 5432 exits 0 once something listens (1 after --timeout); portop --free 3000 stops whatever holds a port, re-checking each process's identity, and waits until the port is released (--force, --yes).

  • Prometheus metrics. The web dashboard serves /metrics: sockets by state, listening ports by exposure, one info series per listening port. With --web-auth it accepts HTTP Basic auth for scrapers.

  • Windows notifications now appear as portop, with its icon, instead of Windows PowerShell.

  • APT repository for Debian, Ubuntu and derivatives, updated on every release:

    sudo install -d -m 0755 /etc/apt/keyrings
    curl -fsSL https://apt.lucapadovan.dev/lucapadovan.gpg | sudo tee /etc/apt/keyrings/lucapadovan.gpg >/dev/null
    echo "deb [signed-by=/etc/apt/keyrings/lucapadovan.gpg] https://apt.lucapadovan.dev stable main" \
      | sudo tee /etc/apt/sources.list.d/lucapadovan.list
    sudo apt update && sudo apt install portop

Behaviour changes

  • UDP services count as listening. A bound UDP socket (UNCONN, as ss -l shows it) is now listening for --listen, --diff, --save-baseline, --watch-new, the TUI and the dashboards' Listening tab. The first --diff after upgrading may report UDP ports that were already running; run --save-baseline again once you have checked them.
  • --diff reports exposure changes. Baselines record each port's scope, so a service moving from 127.0.0.1 to 0.0.0.0 is reported, and a service on IPv4 and IPv6 is one entry. Baselines from older versions keep the previous comparison.
  • Filters match every word. portop nginx 443, or two words in a search box, narrows to rows where each word matches.
  • --compose substitutes ${VARIABLES} from .env and the environment and reads only the files Docker Compose loads.

Security fixes

  • Unicode bidirectional controls can disguise process names. Portop now neutralizes these characters to prevent deceptive process names from appearing in the TUI and kill confirmation.
  • The web dashboard bounds read, write and idle time of connections, and its sign-in lockout covers a whole IPv6 /64.
  • notify-send no longer reads a process name starting with - as an option; the clipboard copy is sanitized.

Fixes

  • The TUI no longer aborts with concurrent map writes when a scan outlasts the refresh interval, and scans no longer pile up.
  • Memory stays bounded: CPU samples of exited processes and old reverse-DNS names are dropped.
  • Docker containers are found on macOS and on rootless or Docker Desktop sockets; DOCKER_HOST is honoured.
  • Files created under sudo stay owned by your user.
  • The details view stays on its process, labels are no longer cut short, and dialogs no longer hide the table around them.
  • Zebra stripes cover the whole row; columns stay aligned with CJK and emoji names; well-known UDP ports are named.
  • The open action uses the bound address for single-interface listeners.
  • (N hidden — try sudo) no longer counts closing sockets or filtered-out rows.
  • A remapped escape key works everywhere, and the settings screen refuses a key another action already uses.
  • A kill is no longer refused because the clock moved while the confirmation was open (Linux).
  • macOS no longer shows :0 rows for unbound sockets; Windows no longer attributes TIME_WAIT connections to "System Idle Process".
  • An unreadable baseline is reported as such.

Documentation

  • A new documentation site with a page per topic, search, and a platform support table of what works where.
  • A shorter README, a refreshed project page, and a new demo recording.
  • Each release is announced to the Go module proxy, so pkg.go.dev shows it right away. The Linux package description is now in English.

Changelog

Features

  • 333bb3f feat(notify): show Windows toasts as portop with its logo
  • b1b55f8 feat(ui): color listening ports by exposure at any width
  • 4ed1cce feat(web): expose Prometheus metrics at /metrics
  • 267fbc1 feat: add --wait and --free for scripts
  • 20da32a feat: name Kubernetes pods and Podman containers
  • 046fc5a feat: show per-connection traffic on Linux and macOS
  • 1e54cf0 feat: show whether the host firewall lets traffic reach exposed ports
  • 8219d15 feat: show who can reach each port and which user owns it
  • c0cf91d feat: tell a server's master from its workers

Fixes

  • 7c9ef30 fix(app): serialize scans and drop CPU samples of exited processes
  • 52722cb fix(baseline): report exposure changes and stop duplicate drift lines
  • b658dfb fix(compose): audit only the files Docker Compose loads
  • bc7e60d fix(compose): substitute variables in Compose files before auditing
  • 0699124 fix(dnscache): expire reverse DNS names and bound the cache
  • c998692 fix(docker): find containers on macOS and on per-user Docker sockets
  • 8ebbdf9 fix(notify): never block the TUI and end notify-send option parsing
  • 5ac5168 fix(procinfo): keep a process's start time stable on Linux
  • 7bb97b9 fix(scanner): do not name TIME_WAIT sockets after the idle process on Windows
  • e68a069 fix(scanner): skip sockets lsof lists without a port
  • f0426f5 fix(traffic): read nettop rows without a time column
  • b313bb9 fix(ui): carry the zebra stripe across the whole row
  • 6c02576 fix(ui): do not count closing or filtered-out sockets as hidden
  • 8fba42e fix(ui): honour a remapped escape key and refuse conflicting bindings
  • f6419aa fix(ui): keep the details view on the process it was opened for
  • 73f0efb fix(ui): keep the table visible beside dialogs and show alternative keys clearly
  • 25dff0c fix(ui): measure table cells in terminal columns, not runes
  • 01e8335 fix(ui): name well-known UDP ports in the PORT column
  • 639198d fix(ui): open a service bound to one interface at its own address
  • 8a84ec2 fix(ui): run one scan at a time instead of queuing one per tick
  • b3f5310 fix(ui): sanitize the process name copied to the clipboard
  • 06c36ce fix(ui): stop truncating detail labels and wrap values in their column
  • f6ae0f0 fix(web): apply the sign-in lockout to the whole IPv6 /64
  • 858c315 fix(web): bound read, write and idle time of dashboard connections
  • b25b82f fix(web): show the firewall verdict once in the details dialog
  • 2a0b94f fix: count bound UDP sockets as listening in the dashboards and ARM test
  • b27f0f5 fix: keep config and baseline files owned by the user under sudo
  • 5b66529 fix: match every word of a filter instead of the whole phrase
  • 701c04d fix: stop bidirectional controls from disguising process names
  • 4c0dc0e fix: treat bound UDP sockets as listening

Other changes

  • 2e4e9f7 build: describe the Linux packages in English
  • 0df8e92 ci: announce each release to the Go module proxy and pkg.go.dev
  • 646747d ci: leave Homebrew updates to BrewTestBot
  • 4fed1c5 ci: pass the tarball checksum to the Homebrew bump
  • a5286ba ci: rebuild the APT repository after each stable release
  • 2a5629e ci: report failing tests as annotations and keep both macOS jobs running
  • fc7ac69 docs: add a documentation site
  • a7a2432 docs: add the winget badge
  • dfb7427 docs: centre the README header and add install badges
  • b60e015 docs: describe which Compose files and variables --compose reads
  • 91d77f1 docs: document the APT repository
  • fb89ccc docs: give the project page more colour
  • bb1c488 docs: link the Microsoft Store listing directly
  • 8268171 docs: list APT, Snap and Homebrew on the project page
  • 97f57c2 docs: list the new features on the project page and link the docs
  • 6b15934 docs: record the demo and dashboard again
  • 67c496d docs: redesign the project page
  • 1f9e2cd docs: rewrite the README around the documentation site
  • e918588 docs: show winget as in review until the package is published
  • 34167f2 docs: type the headline's second line and keep labels unselectable

What's Changed

  • ci: pass the tarball checksum to the Homebrew bump by @padovanl in #18
  • merga master in develop by @padovanl in #19
  • Develop by @padovanl in #20
  • Develop by @padovanl in #21
  • docs: give the project page more colour by @padovanl in #22
  • docs: type the headline's second line and keep labels unselectable by @padovanl in #23
  • Release 0.3.0: exposure, firewall, workers, traffic, --wait/--free, metrics and a documentation site by @padovanl in #25

Full Changelog: v0.2.1...v0.3.0