Skip to content

Network Activity M97

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

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

M9.7 — Suspicious network activity detections (#84)

Status: accepted native offline rule foundation (203 local gates, 643 configured CTests, 88 structural verifiers, nine hosted checks and maintainer review/merge reported on 2026-11-29). No operational ingestion, scheduler, alert publication, or GUI integration is enabled.

Input and authorization

detection::network::evaluate accepts one immutable snapshot of up to 128 M9.5 passive observations and a trusted, explicitly enabled detection policy. The caller must establish authorization, verify stored evidence and bind the snapshot to a nonzero store identifier and revision. The evaluator does not open a store or authenticate the broker. The evidence IDs are opaque references in that store; a caller must resolve them against that exact revision, not the existing authentication-only event store by assumption. The policy has a nonzero revision and current M9.5 sensor binding, explicit collection consent and numeric segment. No rule is enabled by default. The detector does not accept syslog messages, M9.3 socket snapshots, or fabricated GUI graph observations.

The whole input is validated before any finding is emitted. Evidence IDs must be nonzero and strictly ascending; broker observation times must be nonzero and nondecreasing. Revalidation checks current sensor generation, sensor ID, namespace cookie, interface, numeric prefix, IPv4 address tail, family, protocol/port presence, packet length, scope and external-peer consent. Prefix membership is not packet routing or direction proof. The caller must provide an immutable policy and input, assure store freshness, prevent replay and protect the integrity and lifetime of the snapshot. No independent integrity or freshness proof is inferred from the caller's boolean attestation.

Version 1 deterministic rules

Pattern Explicit configuration Meaning
WatchedLocalService Nonzero local TCP destination port Both addresses in approved segment; contact metadata, not proof of lateral movement
WatchedExternalService Nonzero external TCP destination port Local-prefix source and external destination; watched service observation
ProhibitedExternalService Nonzero prohibited external TCP destination port Same scope as watched external; conflicts with same watched port rejected
LocalPeerFanout 2–16 distinct local destinations Same local source address, TCP, distinct non-self local destinations in window
PacketBurst 2–128 observed packet records Same local source address, any supported protocol in window

All thresholds and ports are administrator-selected; zero disables each rule. The window is 1–600000 ms, inclusive at its oldest boundary. There is no statistical baseline, service recognition, handshake detection, byte-rate estimate, account correlation or verified host attribution. Inbound-only observations do not trigger these source-local rules. Normal external traffic is not a violation by default. The policy rule refers to this separately configured detection policy, not a firewall or M3 transport permit.

Each single-record match retains its evidence ID. Aggregates emit at most once per numeric source address per pattern per snapshot, using the newest required matching records and distinct peers for fan-out. Evidence IDs are returned in ascending order, with the triggering record last. The report includes store, snapshot and policy revisions and sensor binding; findings have version 1. No raw addresses or ports are emitted in finding payloads. Records are counted, not unique packets or connection attempts; retransmission or duplicated sensor observations can influence counts. Overlapping snapshots can repeat findings. No finding establishes a compromised asset or a successful connection.

The evaluator is stateless, has no I/O or clock, and bounds work by 128 input records, 16 distinct peers and at most three findings per observation (one service rule plus two aggregates). Invalid, denied and unverified inputs yield no partial findings or report identifiers. An evaluated empty snapshot is not proof of safety or monitoring coverage. Allocation failure propagates and must not be interpreted as a negative detection.

Qualification and remaining scope

knetsentry_network_activity_contract covers all five rules, exact ordered references, deterministic replay, normal traffic, inbound traffic, UDP exclusion, repeated destinations, distinct source isolation, expiry and inclusive window, consent, malformed rows, stale binding, invalid policy, capacity, IPv6 and synthetic adapter composition. Run in all seven presets, repeat Release and sanitized fixtures, and verify native independence. No network interface is opened by the new evaluator or fixtures. No new dependency, privilege, packet payload, network transmission, storage mutation, or response action is added. Existing TB-01/TB-03, M3 monitoring authorization, M9.2 correlation and M9.5 source trust requirements remain unchanged. No additional trust boundary is claimed or existing rule relaxed.

Keep #84 open for actual authorized network evidence admission, durable store and revision validation, M9.3 and other source integration, bounded scheduling, replay suppression, calibrated thresholds, alert lifecycle/evidence resolution, GUI presentation and operational performance/false-positive qualification. See M9.5 and M9.6.

Clone this wiki locally