portop docs

Web dashboard

The same live view in a browser, with process details and confirmed SIGTERM and SIGKILL.

Start

portop --web                  # http://127.0.0.1:8088
portop --web --web-port 9090

The dashboard lists every socket with its exposure and firewall badges, user, workers and traffic, with tabs for listening and connected sockets and a search box. The printed URL carries a per-run token: without it the table is readable, but process details and signals are refused. --listen, the --no-* flags and a filter apply here too.

The portop web dashboard with exposure badges and a process detail dialog
The web dashboard with a process's details open.

Sign-in

OptionMeaning
--web-authRequire sign-in; without a password, one is generated and printed
--web-user NAMEUsername (default portop); implies --web-auth
PORTOP_WEB_PASSWORDPassword from the environment
--web-password PASSPassword on the command line, visible to other local users in ps

Sessions last 12 hours and end when portop stops. After five failed sign-ins a client, an IPv4 address or an IPv6 /64, waits a minute. Process actions also need a per-session token, so another site cannot use a signed-in cookie.

Remote access and TLS

Only a dashboard with sign-in may listen beyond loopback:

openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-256 -nodes -days 365 \
  -subj "/CN=$(hostname)" -keyout portop.key -out portop.crt
PORTOP_WEB_PASSWORD='choose-one' portop --web --web-user admin \
  --web-addr 0.0.0.0:8088 --web-tls-cert portop.crt --web-tls-key portop.key

Without TLS the password crosses the network unencrypted; portop warns about it. An SSH tunnel to a loopback dashboard needs no certificate: ssh -L 8088:127.0.0.1:8088 host.

Prometheus metrics

/metrics serves the Prometheus text format:

MetricLabels
portop_socketsprotocol, state
portop_listening_portsprotocol, scope
portop_listening_port_infoprotocol, port, address, scope, firewall, process, pid, user, container (value always 1)
portop_scrape_duration_seconds

With sign-in enabled, /metrics accepts the dashboard credentials as HTTP Basic auth:

scrape_configs:
  - job_name: portop
    scheme: https
    basic_auth:
      username: admin
      password: choose-one
    static_configs:
      - targets: ["host:8088"]

Alert when portop_listening_ports{scope="all"} grows, or on a new portop_listening_port_info series.