Lion Cipher Lab

Triage security alerts with k-means clustering

Why it matters

A security operations center drowns in alerts. A single mid-sized network can throw off tens of thousands of alerts a day -- a firewall rule that fires constantly, a scanner probing every port, a noisy piece of software that trips a detection over and over -- and buried in that flood are the few alerts that are a real attack. That overload has a name, ALERT FATIGUE, and it is dangerous: when nearly every alert is noise, analysts start dismissing them by reflex, and the one that mattered gets closed with the rest. You cannot hand-label a flood this size, and often nobody has labeled it at all…

What you'll learn

Steps in this lab

  1. The problem: too many alerts, no labels, and alert fatigue
  2. The words you need: unsupervised, feature, cluster, centroid, k
  3. Install scikit-learn, pandas, and matplotlib
  4. Get a set of alerts (generate one so you are never blocked)
  5. Load the alerts and scale the features (this step is not optional)
  6. Choose k with the elbow method
  7. Cluster the alerts with k-means
  8. Interpret the clusters: turn groups into a triage decision
  9. The honest limits: clustering groups, it does not judge
  10. What you can now do that most people can't

Open the full interactive lab →