Hello Reviewers team,
I am requesting classic confinement for the fnmap snap (com.krioltech.fnmap).
fnmap is an open-source graphical frontend for the Nmap network scanner, built with Flutter. It was previously published in the Snap Store under strict confinement (version 1.3.4.1), but transitioning to classic confinement is required to support privileged scanning capabilities (SYN stealth scans, OS detection, UDP scans, ICMP sweeps, and traceroute).
Metadata
- Snap name:
fnmap - Upstream: https://github.com/gmckesey/fnmap
- Snapcraft.yaml:
snapcraft.yamllocated in the root of the upstream repo (github.com/gmckesey/fnmap/blob/master/snapcraft.yaml) - Upstream relation: Author and maintainer
- Category: Debug / diagnostic & network administration tools
Technical Justification & Why Strict Confinement is Insufficient
Nmap provides unprivileged scans (e.g., standard TCP connect scans via -sT), but its diagnostic capabilities require elevated privileges:
- Raw network sockets (
CAP_NET_RAW/CAP_NET_ADMIN) - Root access (
geteuid() == 0) for raw packet crafting, SYN stealth scanning (-sS), OS fingerprinting (-O), and UDP scanning (-sU).
We previously attempted to make this work under strict confinement, but encountered fundamental architectural blockers inherent to strictly confined desktop GUI applications:
-
network-control& Ambient Capabilities Limitation: Even when pluggingnetwork-controlandnetwork-observe, the interface only broadens the AppArmor profile. Because the GUI application executes as an unprivileged desktop user (UID 1000) and snapd processes do not inherit ambient capabilities,nmapdetectsgeteuid() != 0and immediately halts with:"You requested a scan type which requires root privileges. QUITTING!" -
PR_SET_NO_NEW_PRIVSBlocks In-App Elevation: In standard native Linux desktop apps, a GUI prompts the user for privilege escalation usingpkexecorsudoto spawn the privileged helper process. Under strict snap confinement,snap-confineenforcesPR_SET_NO_NEW_PRIVSand mounts filesystems withnosuid. As a result, the application cannot invokepkexecorsudofrom within the sandbox to run privileged scans. -
Running the Full GUI as Root is Impractical and Unsafe: While CLI snaps can be executed via
sudo <snap-name>, running a Flutter/GTK desktop application withsudois strongly discouraged and fails on modern Wayland display sessions (No protocol specified/ display connection refused), in addition to risking user configuration permissions under X11. -
Lack of Polkit Desktop Portal in Snapd: Unlike Flatpak (which offers a host execution portal via
flatpak-spawn --host pkexec ...), Snapd does not currently provide a Polkit portal allowing strictly confined GUI snaps to request host privilege elevation for spawned helper commands.
Why Classic Confinement Resolves the Issue
With classic confinement, fnmap runs in the global mount namespace. When the user requests a privileged scan in the GUI, the application can cleanly invoke pkexec nmap (or fallback to user-authenticated sudo), triggering the desktop environment’s native PolicyKit authentication modal to perform privileged network diagnostics safely.
Thank you for your time and consideration!