liveBook · Manning

Supervised learning

As explained in Cyber Threat Hunting

Supervised machine learning learns a mapping from labeled examples to predictions or decisions.

Supervised learning builds a model from labeled examples so it can predict a label for new records. In DNS threat hunting, the prediction can distinguish normal traffic from DNS tunneling; labels such as tunneled and normal provide the ground truth for learning. section 9.2

Its value depends heavily on the training set. Features used for training must match those submitted in production, and labels, recency, relevance, and class balance all affect whether predictions will be useful. Training data also needs maintenance and periodic retraining as conditions change. section 9.2 section 9.2.1

Use supervised learning for a threat-hunting investigation in a repeatable sequence:

  • Collect and process relevant events, such as DNS queries and responses from endpoints. section 9.0 section 9.1
  • Acquire or build labeled examples whose features are available in the production data. section 9.2 section 9.2.1
  • Train a model on the features and labels, then use it to identify initial clues for investigation. section 9.0 section 9.2
  • Evaluate whether the preparation and maintenance cost makes supervised learning the appropriate analytical tool. section 9.7

DNS tunneling classification

A labeled DNS data set can separate regular domain names from traffic generated by dns2tcp, dnscapy, Iodine, and tuns. These tunneling classes may be preserved for finer classification or combined into one tunneling label for a binary normal-versus-tunneled prediction. section 9.2.1

Figure 9.2 The process of threat hunting with supervised ML

Use the process diagram to orient data processing, training-set preparation, model learning, and prediction within a supervised threat-hunting workflow. section 9.2

How Cyber Threat Hunting covers it

How deep it goes
Defines labels, ground truth, features, and training-data constraints while treating Random Forest and XGBoost only at a high level.
Examples
Uses Zeek DNS events and a labeled domain-name data set containing regular traffic and four tunneling-tool classes.
What it assumes
Assumes processed event data and teaches the added need for acquiring, labeling, and maintaining training sets.
What you can do after
Apply it via Random Forest or XGBoost to investigate DNS tunneling when reliable labeled data is available.
How it connects
Connects training sets, labels, ground truth, features, DNS tunneling, Random Forest, XGBoost, and unsupervised learning.

Also explained in

Compare how 19 books explain supervised learning →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Cyber Threat Hunting. The section links point to the parts of the book it draws on.