Language / Langue: English · Français
PortAtlas records which services a Windows or Linux machine talks to, over days or weeks, and which program is responsible. It reads the socket tables of the operating system at a fixed interval, attributes each socket to its process, and keeps one line per flow in a CSV log. From those logs it draws offline HTML topology maps, Draw.io diagrams and firewall rule matrices.
Note
PortAtlas started as a way to see what really ran and talked on a personal setup (Proxmox servers, a Windows PC, a Linux desktop). It is shared in the hope that it helps someone else.
Moving a self-hosted service to another machine, writing firewall rules for a home network or checking what a computer does in the background raises the same question: what does this machine connect to, and what listens on it? Packet capture needs a driver and produces large files without the process behind each connection; netstat shows one instant and misses scheduled jobs; logging every connection floods the disk. PortAtlas runs in the background, without driver, and keeps a deduplicated history with the program, its command line and the application it launched (java -jar, python, powershell…).
Download the archive for your system from the releases page (PortAtlas-<version>-win-x64.zip or PortAtlas-<version>-linux-x64.tar.gz) and extract it. The executable includes the .NET runtime.
On Windows, PortAtlas.Gui-<version>-win-x64.zip contains a graphical interface that builds the command line of every command except audit from a form and runs it; see Use the graphical interface. The archive does not contain the PortAtlas executable: extract PortAtlas-<version>-win-x64.zip and PortAtlas.Gui-<version>-win-x64.zip into the same folder. The Linux releases do not include the interface; it can be built from source, as shown below.
To build from source (.NET 8 SDK):
dotnet publish PortAtlas.Cli/PortAtlas.Cli.csproj -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true -o publish/linux-x64Use -r win-x64 for Windows.
The graphical interface builds the same way; put the PortAtlas executable in the same folder:
dotnet publish PortAtlas.Gui/PortAtlas.Gui.csproj -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -o publish/gui-linux-x64Audit the machine with the terminal dashboard (as administrator on Windows, with sudo on Linux):
PortAtlas auditThe dashboard shown above opens and lists each new flow; Q stops the audit and leaves the flows in portatlas_audit.csv.
Draw a map from the audit logs of several servers:
PortAtlas map -i "collected/audit_*.csv" --html homelab.htmlThe command prints Topology map generated: <path> (<servers> servers, <flows> flows). homelab.html opens offline in a browser, as in the second picture above.
Export the internal flows seen at least five times as a firewall rule matrix. Run in the folder of the example homelab, whose logs are in logs:
PortAtlas export rules -i logs -o rules.csv --zone internal --min-observations 5rules.csv holds one rule per source, destination, port and process, such as:
| RuleId | Direction | SourceHost | DestinationHost | Protocol | DestinationPort | ObservationCount |
|---|---|---|---|---|---|---|
| RULE-002 | Inbound | laptop.home.arpa | nas | TCP | 445 | 240 |
| RULE-004 | Inbound | laptop.home.arpa | pve | TCP | 8006 | 310 |
| RULE-008 | Outbound | pve | nas.home.arpa | TCP | 873 | 96 |
The SSH session opened once on nas and the NTP and DNS over TLS flows to the Internet are left out. The firewall rule guide shows what each option changes.
./verify.ps1 runs formatting, the Release build with warnings as errors, the tests with coverage and the SonarQube analysis.
If PortAtlas helps you, you can support its maintenance on Ko-fi.

