aCyberSec Logo
Skip to article
Inside this article · 06 sections
AI in SecurityField Guide

Machine Learning Security Analytics: Detecting Anomalies in Logs, Users, and Network Traffic

Anomaly detection with a labeled synthetic mini-dataset, feature calculations, and investigation steps analysts can rehearse.

Suman Lama2 min read06 sectionsMay 26, 2026 · Updated November 16, 2026
100%
Machine Learning Security Analytics: Detecting Anomalies in Logs, Users, and Network Traffic

Reader task

Reproduce the feature calculations on the synthetic mini-dataset below, then follow the investigation steps. This is a teaching exercise, not production telemetry from ACyberSec or a customer.

What security analytics adds

Security analytics turns raw logs into features, baselines, and ranked anomalies. ML may be a simple z-score, isolation forest, or a vendor UEBA engine—the investigation discipline matters more than the brand name.

Synthetic mini-dataset (labeled)

SYNTHETIC ONLY — five hosts, one business day, outbound bytes to external IPs (illustrative):

Host | Mean hourly outbound MB (14-day baseline) | Stdev | Event hour outbound MB | Destination rarity (0=common,1=never seen)

web-01 | 120 | 25 | 130 | 0.05

web-02 | 110 | 20 | 105 | 0.10

db-01 | 15 | 5 | 18 | 0.00

laptop-77 | 8 | 3 | 95 | 0.92

laptop-12 | 10 | 4 | 11 | 0.15

Feature calculations (z-score on outbound volume):

z = (event − mean) / stdev

web-01: (130−120)/25 = 0.40

web-02: (105−110)/20 = −0.25

db-01: (18−15)/5 = 0.60

laptop-77: (95−8)/3 = 29.0

laptop-12: (11−10)/4 = 0.25

Composite illustrative risk = 0.7normalize(|z|) + 0.3destination_rarity (normalize |z| capped at 1.0 for |z|≥5).

laptop-77 dominates: extreme volume z-score plus rare destination.

Investigation steps (follow in order)

  1. Confirm clock sync and that laptop-77’s logs are complete for the hour.
  2. Identify the process responsible for the bytes (endpoint EDR or host firewall).
  3. Resolve the rare destination (passive DNS / WHOIS / internal allowlist)—do not block solely on reputation screenshots.
  4. Check user intent: approved large upload, backup client, or unexpected cloud sync?
  5. If malware suspected: isolate host per playbook, capture volatile evidence, reset credentials used on that host.
  6. If benign: document the business reason and add a time-bounded suppression or baseline update.
  7. Record whether the rarity feature or the volume feature drove the prioritization—feeds model tuning.

Synthetic resolution for teaching: laptop-77 ran an unsanctioned personal backup client uploading design files to a consumer cloud—policy violation, not ransomware. Action: remove client, user coaching, keep detection (precision preserved).

Benefits and limits in one place

Benefits: ranks sparse signals across users and network flows; makes volume+rarity combinations visible.

Limits: baselines break during migrations; encrypted traffic hides payload; shared NAT can attribute bytes to the wrong user; without process context, analysts guess.

CISA’s logging guidance and NIST SP 800-92 (log management) remain foundational—analytics cannot invent missing logs.

Conclusion

Anomaly analytics is feature engineering plus disciplined investigation. Practice on synthetic tables like the one above before trusting opaque vendor scores in production.

About the author

Suman Lama

Founder of ACyberSec. Writes practical guides on secure development, data protection, and privacy-conscious cybersecurity workflows.

View author profile

Your next read

Keep building your knowledge.

All articles

AI in Security

Machine Learning for Threat Detection: How Cybersecurity Teams Detect Unknown Attacks

2 min read

Read guide

AI in Security

Cyber Threat Detection Using Machine Learning: Benefits, Examples, and Limitations

2 min read

Read guide

Back to top