/docs/security/localhost-binding
Security & SandboxingZero-Trust webtop-manage v1.0.0

Zero-Trust Localhost Binding

Why strict 127.0.0.1 loopback binding and stateless container labels guarantee zero unauthorized network exposure.

Zero-Trust Localhost Binding

Standard Docker port mappings often bind to 0.0.0.0, exposing desktop sessions and management APIs to everyone on your local Wi-Fi, office LAN, or public IP.

webtop-manage is built around Zero-Trust Loopback Isolation.


๐Ÿ”’ The Inbound Threat Model

code
                 [ Coffee Shop Wi-Fi / LAN ]
                             โ”‚
                             โœ• (Blocked by 127.0.0.1 Binding)
                             โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Host Machine (Developer Laptop / Server)                   โ”‚
โ”‚                                                            โ”‚
โ”‚  Management Dashboard โ”€โ”€โ–บ http://127.0.0.1:8080            โ”‚
โ”‚  Webtop Desktops      โ”€โ”€โ–บ http://127.0.0.1:3000, 3001...   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Why Default Docker Bindings Are Dangerous

When a container port is published as -p 3000:3000, Docker automatically binds to 0.0.0.0:3000. Anyone on the same network subnet can open your desktop session in their browser without authentication.

The webtop-manage Defense

  1. Management Daemon (8080): Docker Compose binds explicitly to 127.0.0.1:8080:8080.
  2. Workstation Desktop Ports (3000+): During container creation, webtop-manage configures port bindings using explicit loopback host IPs:
    go
    nat.PortMap{
        "3000/tcp": []nat.PortBinding{
            {
                HostIP:   "127.0.0.1", // Enforces loopback binding
                HostPort: strconv.Itoa(cmd.HostPort),
            },
        },
    }
    
  3. Connection Refused: Any external connection attempt to http://<lan-ip>:<port> is immediately rejected at the kernel networking layer.

๐Ÿ“ฆ 100% Stateless Zero-DB Architecture

webtop-manage eliminates database synchronization issues, schema migrations, and database corruption risks by storing all workstation metadata directly in Docker Container Labels:

yaml
Labels:
  webtop.managed: "true"
  webtop.owner: "sonic-ubuntu-850"
  webtop.preset: "ubuntu-xfce"
  webtop.distro: "ubuntu"
  webtop.desktop: "xfce"
  webtop.egress_policy: "full"
  webtop.gpu: "false"

Key Architectural Advantages

  • Instant Recovery: If the host restarts, webtop-manage reconstructs the entire dashboard state on boot in < 50ms.
  • Zero Orphan State: Deleting a container in Docker CLI instantly synchronizes with the web UI upon the next poll or refresh.
  • Portable Snapshots: You can backup, export, or migrate your Docker volumes without touching external database dump files.