Skip to content
curvecoderPublic

About

Network flow audit for Windows and Linux: per-process connection history, terminal dashboard, firewall rule matrices, offline HTML topology maps and Draw.io diagrams.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Language / Langue: English · Français

PortAtlas

PortAtlas logo
Support curvecoder on Ko-fi

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.

Why

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…).

PortAtlas terminal dashboard

PortAtlas HTML topology map

Install

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-x64

Use -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-x64

Use

Audit the machine with the terminal dashboard (as administrator on Windows, with sudo on Linux):

PortAtlas audit

The 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.html

The 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 5

rules.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.

Documentation

Tutorial Getting started
How-to guides Run as a service · Map several machines · Export firewall rules · Audit isolated servers · Diagnose a missing host name · Use the graphical interface · Upgrade from 1.x · Upgrade from 2.x to 3.0 · Upgrade from 3.x to 4.0 · Upgrade from 4.x to 5.0 · Upgrade from 5.x to 6.0
Reference Command line · Configuration file · Output formats · Terminal dashboard
Explanation How PortAtlas works · Graphical interface · Architecture decisions

Development

./verify.ps1 runs formatting, the Release build with warnings as errors, the tests with coverage and the SonarQube analysis.

Support

If PortAtlas helps you, you can support its maintenance on Ko-fi.

License

MIT

About

Network flow audit for Windows and Linux: per-process connection history, terminal dashboard, firewall rule matrices, offline HTML topology maps and Draw.io diagrams.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages