Skip to content

Live Packet Acquisition Live2

Chris Sutton edited this page Nov 30, 2026 · 1 revision

Published documentation mirror. Edit the source through a repository PR. See Project status.

LIVE2 — Authorized passive IPv4 header acquisition

Status: accepted; target-host and actual packet acquisition qualification passed on 2026-11-29 UTC. Builds on accepted LIVE1 and M9.5. Does not enable operational SIEM admission.

Authorization and deployment

The ordinary unprivileged graphical launch and existing LIVE1 session approval remain unchanged. An unchecked optional consent box additionally authorizes passive IPv4 header sampling involving the selected host address, including outside-prefix peers. The desktop starts the helper only after successful LIVE1 approval. No capability is installed or assigned by CMake, CI or the acceptance runner. The optional helper must be separately provisioned by an administrator after qualification at /usr/local/libexec/knetsentry-live2-sensor. The path and its ancestors must be root-owned, non-symlink and not group/other writable. The executable must be restricted to an authorized operator group. Never set capabilities on a mutable checkout executable or elevate the GUI. The operator group, not a cryptographic GUI token, is the helper's privilege boundary; an authorized group member can invoke the helper directly with an explicit current binding. Use a private trusted group, not a shared group. The installed binary must be replaced deliberately on subsequent updates.

After all automated checks and review, an administrator may install the exact qualified Release helper with root ownership, mode 0750 and the approved operator group, then assign only cap_net_raw=ep using setcap. This is a persistent administrative permission, not a running service. Remove the helper when no longer wanted; the ordinary desktop still works without it. The helper refuses root or mismatched real/effective identity, requires precisely CAP_NET_RAW effective/permitted, and closes inherited descriptors beyond stdio. It requires an explicit session argument, parent PID and exact selected interface/address/prefix. It sets non-dumpable and a parent-death signal before opening a protocol-zero cooked packet socket. It locks a kernel filter before binding to the approved interface; then clears ambient, permitted, effective and inheritable capabilities, sets no-new-privileges and installs an x86-64 seccomp allowlist. The filter rejects unrelated host addresses, non-IPv4, non-host/non- outgoing link observations, options, fragments and invalid/truncated lengths; only 20-byte base IPv4 headers or 24-byte IP/port headers cross into user space. No promiscuous mode, traffic transmission, active scanning, new sockets after confinement, packet content logging or third-party dependencies are introduced.

Sampling and limits

The M9.5 decoder independently validates scoped metadata and marks observations unauthenticated. No identities or verified routing direction are inferred. Each bounded batch examines at most 256 queued records, then waits one second; receive buffering is requested at 65536 bytes (kernel accounting may differ). Only five aggregate unsigned integers cross the stdout pipe: TCP, UDP, ICMP, outside-prefix accepted count and examined count. Nonblocking output fails closed on backpressure. Counts are not rates, complete packet totals, evidence records or proof of coverage. Queue loss and offload effects are unmeasured. No addresses, ports or packet bytes are published, stored or logged. No IPv6, VLAN decoding, fragments, options, tunneled payload parsing, mirror setup or peer-to-peer LAN visibility is claimed. Outside-prefix means outside the chosen prefix, not necessarily Internet. The initial profile observes only packets involving the exact selected host IPv4 address. Topology changes invalidate the helper epoch; the desktop independently retains LIVE1 topology checks. Stop, manager failure, desktop close or invalidation clears the session and stops its child; missing/stale/malformed helper output clears passive status without fabricating counts. No system service or agent is remotely deployed.

Qualification

knetsentry_live_packet_contract uses actual kernel socket filters on local UNIX datagram sockets to verify header truncation, scope, malformed lengths, filter lock and syscall confinement. It exercises no real LAN traffic. The administrator-requested full runner adds a disposable two-network-namespace veth fixture with no default routes, actual bidirectional UDP traffic, a temporary ambient CAP_NET_RAW grant via util-linux setpriv, post-setup capability/NoNewPrivs/seccomp checks and interface withdrawal. No file capabilities or services are installed by this test. Native filter and confinement tests are not a substitute for the actual packet socket fixture. Actual physical LAN review, Qt/Kirigami builds, analyzers, packaging and hosted CI remain required. Privileged pre-confinement setup, topology sampling races, installed helper identity and production distribution deserve later adversarial review. TB-01/TB-03, existing KS-NET scope/privacy requirements and M9.5 limitations remain applicable. No durable evidence admission, detection, asset identity correlation or alert publication is enabled by LIVE2.

Initial Analysis build correction

The first target-host Analysis build rejected the original aggregate serializer with clang-analyzer-security.ArrayBound at cursor[-1]. The fixed-size five-field loop did not establish a runtime out-of-bounds write; nevertheless, the follow-up removes backward pointer access entirely. The native shared formatter reserves the final newline, appends separators in forward order and returns zero on conversion failure. The helper refuses to publish a failed format and retains its single bounded nonblocking stdout write. The existing native contract now checks exact wire bytes for zero, mixed, maximum batch and maximum unsigned values. Compiler and analyzer gates remain unchanged. Full corrected target-host qualification, including actual isolated packet capture, is required before optional helper provisioning or merge.

Second follow-up: Clazy build correction

The first corrected target-host run passed the Analysis build and all 104 Analysis tests, the sanitizer build and all 89 sanitizer tests, and the five repeated sanitized UX2 executions. The subsequent Clazy build rejected the namespace-scope QString sensor_path with clazy-non-pod-global-static. The second follow-up returns the same absolute QStringLiteral on demand through a small function; the path check uses a local value and the process launch uses the same function. The root ownership, ancestor checks, symlink and write-permission rejection, explicit consent, restricted environment and helper lifecycle are unchanged. The existing LIVE2 source verifier checks the single fixed literal and both uses. Clazy and warnings-as-errors remain mandatory. The full target-host qualification and actual isolated packet fixture still need to pass; no helper provisioning or merge is authorized by the partial run alone.

Maintainer acceptance

The corrected target-host run on 2026-11-29 UTC passed all 214 local gates, including actual isolated packet acquisition, capability drop, confinement and withdrawal. The maintainer reported manual GUI verification, nine successful hosted checks on af916b7 and merge of the three commits. LIVE2 is accepted. Separately authorized persistence begins in the LIVE3 accepted increment.

Clone this wiki locally