Skip to content

Detection Recovery M78

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

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

M7.8 — Deterministic rule and alert regression tests

Issue #67. Offline, synthetic, bounded qualification of the existing M7.1–M7.7 foundations. No new runtime authority, source collection, GUI functionality or dependency. A finding is not proof of compromise; benign controls are negative controls for the specified rules, not a universal safety assessment.

Composed contract

knetsentry_detection_recovery_contract executes actual first-party code. The memory and SQLite backends receive the same synthetic records with fixed receiver timestamps. The expected results are independent of the production rule catalog and not generated by the evaluator being tested.

Case Expected
Exact authentication failure pair at 100 ms No repeated-failure finding at window 99; exact IDs 1 and 4 at 100 and 101
Success at 101 ms from first failure Success-after-failures only at window 101; exact IDs 1, 4, 5
Separate endpoint and exact unit No cross-scope correlation
Redacted observation Breaks authentication sequence
Invalid-user and unspecified-activity failure Distinct low-severity observations with exact evidence
Exact duplicate with changed receiver timestamp Original ID and immutable revision retained
Same cursor, changed payload; malformed input Conflict/invalid, no new event
All 18 supported Audit types Fixed rule identity, version, severity, evidence ID and partial coverage
Five unsupported Audit types and another endpoint No corresponding finding in the scoped report
Repeated snapshot scan Identical complete report
Unverified evidence Refused
Disabled scheduler No state mutation
Publish, reopen SQLite, replay before scheduler ACK Exact retry; unchanged ledger
Interval minus one Not due
Suppression minus one / exact boundary First candidate suppressed; second emits exact evidence IDs
Acknowledgement and stale revision Durable revision 2; stale mutation refused; independent second alert remains open
Lifecycle mutation Original SQLite database bytes unchanged
Checkpoint replay and future receiver time No duplicate; atomic refusal with unchanged scheduler and ledger; recovery at valid clock

The scheduler's threshold counts matching failures; unlike the M7.3 success-after-failure detector, its configured predicate does not reset on an intervening nonmatching success. The regression explicitly tests this distinction. The Audit catalog is a fixed ABI type allowlist, not a determination that an operation succeeded or was malicious. Existing M7.1/M7.2 typed predicate and rule validation, M7.3/M7.4 page faults, M7.5 interrupted writes and state protections, M7.6 ledger failures and retention, and M7.7 manager/GUI authorization tests remain required; this suite complements rather than replaces them.

Execution and limits

ctest --preset linux-release -R '^knetsentry_detection_recovery_contract$' --verbose --no-tests=error

Run across all seven required configurations. Fixtures use private mkdtemp directories in /var/tmp, an owner-only umask, fixed synthetic identifiers and explicit caller clocks; no live authentication attempts, network, journal access, elevated permissions or installed service changes. No actual analyst data is printed. SQLite reopen is tested in-process; process-level restart and fault injection remain covered by the existing suites. Target inventory increases by one per preset. No production analyst RBAC, multi-scope operation, coordinated retention or unattended detection is claimed; issues #63–#66 remain outstanding.

Clone this wiki locally