Repository navigation
Passive Sensor M95
Published documentation mirror. Edit the source through a repository PR. See Project status.
Status: accepted native passive sensor interface and bounded IP-header metadata adapter; no installed acquisition broker or operational capture. See network scope requirements, component catalog, verification plan and M9.4 syslog.
KnetSentry::PassiveSensor is independent of Qt/KDE and production executables.
A trusted local integration supplies a Source and immutable Policy for one
approved observation domain. The policy defaults to disabled; both explicit
sensor-integration approval and collection enablement, and a nonzero current
generation, are required before reading any source. The policy requires one
canonical numeric CIDR and a binding consisting of generation, sensor ID,
network namespace cookie and interface index (all nonzero). The source binding
must agree before and after a single read; the returned header must also match.
Old queued observations with a different binding are refused. Empty queues and
source unavailability are distinct outcomes, never evidence of safety. An explicit
ReadStatus::Invalid broker outcome is rejected as unavailable before decoding,
even when the supplied header is otherwise valid. Only Ready permits decoding.
These binding fields are trusted broker assertions, not kernel measurements by this component. The future broker must independently verify current interface attachment, namespace, source identity, observation-domain consent, and discard queues on changes/revocation. Interface index reuse, concurrent policy changes and ABA binding changes require a broker lifecycle with fresh generations and serialized reads. The caller must keep source and policy valid for the call. No default capture, interface discovery, socket opening, network transmission, active scanning, promiscuous-mode changes, firewall changes or added privileges are implemented. The callback contract is bounded and nonblocking; the adapter cannot enforce callback latency or side effects of an untrusted implementation.
One observation is read at a time. The broker supplies only a base IPv4 (20 bytes) or IPv6 (40 bytes) header, plus four TCP/UDP port bytes when applicable. The adapter accepts at most 44 bytes, requires exact logical length and zero unused storage, and compares original IP length with the IP header length field. It validates minimum transport lengths, rejects zero observation time and returns no event on denial or malformed/unsupported input. IPv4 options, fragments, IPv6 extension headers, jumbograms, and other protocols are refused. TCP, UDP, ICMP and ICMPv6 are supported; ICMP has no port metadata. This is not full packet validation: checksums, transport lengths beyond minimums, TCP flags, IP options/extension chains and actual packet completeness are not verified. The acquisition broker is responsible for removing link headers and supplying only complete supported base headers and actual IP length (no padding/FCS). Ethernet, VLAN, tunnels, mirror/tap setup and packet-acquisition support are not implemented here.
CIDR host bits must be zero; initial prefix lengths are 8–32 for IPv4 and 16–128 for IPv6. At least one observed endpoint must belong to the approved segment of the same address family. Both-local observations are allowed; exactly one local endpoint requires separate explicit external-peer metadata consent (default false). External means outside this one approved prefix, not necessarily public Internet; unrelated traffic with neither endpoint in scope is denied. IPv4 unspecified/zero-net, loopback, multicast/reserved and conventional local network/broadcast addresses, and IPv6 unspecified, loopback, multicast and IPv4-mapped addresses are rejected. Prefix membership is not proof of traffic origin, routing direction, device identity or physical location. An explicitly approved LAN segment may include unknown endpoints without agent enrollment.
The version 1 event contains binding, broker observation time, IP length, address
family, protocol, two numeric addresses and optional ports, prefix membership
classification, and explicit UnauthenticatedObservation trust. No MAC address,
packet bytes, payload, application content, names or identity are retained in
returned events. No persistence, logging, forwarding, asset merging, rule
execution or GUI integration occurs. Addresses/ports remain sensitive data.
The temporary header is not guaranteed to be securely erased from memory.
No event grants enrollment, management authority, or authenticated identity.
knetsentry_passive_sensor_contract uses a deterministic in-process synthetic
source; it verifies no reads on denied/invalid policy or mismatched source,
source rechecks, stale envelope and generation rejection, empty/unavailable
source, explicit invalid read status rejection and subsequent valid-source recovery,
exact IPv4/TCP and IPv6/UDP metadata, ICMP port omission, local and
external scope, malformed/unsupported headers and zero-tail enforcement.
It mutates each byte of both fixture headers through every byte value (22,528
calls) and checks result/event consistency; this is not comprehensive fuzzing.
The first target-host Analysis build rejected the original synthetic unnamed
enum cast (clang-analyzer-optin.core.EnumCastOutOfRange). The follow-up uses
the named invalid sentinel instead; the analyzer policy and fail-closed runtime
branch remain unchanged. It does not exercise every unnamed enum representation.
No real interface or external system is accessed by the test. The structural
verifier checks key ordering and absence of direct capture/transmit calls.
Supports TB-01/TB-03, TH-001/002/003/005/019/030/036, KS-NET-001/003/005/032/033/034/035/038/039/040/041 and TV-01/02/04/13/23 without relaxing existing requirements. MON-07 and MON-16 remain operational verification objectives. Live acquisition, independent broker attestation, privilege separation, interface revocation, kernel filtering, rate limiting, backpressure, capture-loss accounting, real mirror/tap fixtures, complete parsing, operational ingestion, retention, attribution and desktop coverage remain outstanding. Ordinary switched links cannot guarantee visibility of unrelated unicast traffic. Do not interpret absent observations as safe network coverage. Keep #82 open for remaining operational qualification.
Maintainer acceptance: 198 local gates, 632 configured CTests, 86 structural verifiers, nine hosted checks and reported graphical review/merge. See project status. Operational acquisition remains open.
Source repository · Documentation index · License policy
Documentation mirror — CC-BY-SA-4.0. KnetSentry is not an official KDE project.