NULLWIRE / TECHNICAL LIBRARYDOC ID: KNW-006
SECURITY / LAB GUIDE

Detection Engineering: From Hypothesis to Alert

Design useful security detections by starting with behaviour, telemetry coverage, test cases and measurable alert quality.

STARTER FIELD NOTE / REVIEW REQUIRED

Educational reference drafted for the Nullwire archive. This is not a claim of completed training or original research; verify examples and customise before presenting it as finished work.

START OF FILEMARKDOWN / PUBLIC DOCUMENT

Objective

Build a detection that answers a clear security question rather than producing alerts for every unusual event.

Begin with a hypothesis

Example: A service account executing an unexpected interactive shell may merit investigation.

This is a hypothesis, not a universal sign of compromise. Some maintenance workflows legitimately spawn shells, and not every endpoint produces the same telemetry.

Detection design workflow

  1. Behaviour: Define what you want to observe.
  2. Data source: Identify the events required — process creation, user context or network connections.
  3. Logic: Specify conditions and exclusions.
  4. Validation: Test on synthetic or authorised lab events.
  5. Response: State what an analyst should inspect next.
  6. Tuning: Measure false positives and data gaps.

Pseudocode

WHEN process_created
IF parent_category == "service"
AND child_category == "interactive_shell"
AND host_role NOT IN approved_maintenance_hosts
THEN create_investigation_candidate

This is conceptual pseudocode, not a drop-in SIEM query. Translate it only after documenting actual event fields and expected behaviour.

Test matrix

Scenario Expected outcome
Planned maintenance on approved host No alert
Synthetic shell launch outside approved host Alert
Process lacks parent metadata Coverage gap
Routine scheduled task No alert after validation

Quality measurements

Track alert volume, false-positive rate, time to triage and detection coverage. Distinguish a rule not firing from a rule that had no matching telemetry.

Practical takeaway

A good detection package includes a threat hypothesis, required log sources, query implementation, tests, tuning notes and a response playbook.

Related: Linux Services, Processes & Logs.

⌁END OF KNOWLEDGE RECORDEOF // KNW-006