Lesson 13 of 16 · Level 4: Expert

Monitoring, Logs and Threat Detection

  • ⏱ 13 min read
  • ❓ 4 review questions
  • ✍️ Exercise with solution
  • 📥 Downloadable template
In this lesson
  1. Why logs matter
  2. What to log
  3. Detection tools: from built-in to managed
  4. Warning signs worth investigating
  5. Triage: handling an alert in five steps
  6. Common mistakes
  7. Summary
What you'll learn
  • Why logs matter and which events every organization should record.
  • The main detection tools (built-in cloud alerts, EDR, SIEM and managed detection) and when each fits.
  • The warning signs that deserve investigation, from impossible travel to new inbox rules.
  • A five-step routine to triage an alert without drowning in false positives.
  • How to measure detection with precision, MTTD and MTTR, using a real calculation.
📥 Practice this lesson

Record every alert you escalate in the incident log with its date, category, severity and actions; the sheet calculates days open and counts open incidents for you.

Prevention eventually fails: a password gets phished, a laptop misses an update, a vendor is compromised. Detection is how you find out in minutes or hours instead of months, while the damage is still small. It rests on two things: logs, the records systems keep of what happened, and someone or something watching them for signs of trouble. This lesson covers what to log, which signals matter most, how to triage alerts efficiently and how a Milwaukee manufacturer went from ignoring 1,200 alerts a week to acting on the ones that counted.

1 yearminimum retention for critical system logs, where possible, recommended in CISA's #StopRansomware Guide
A09"Security Logging & Alerting Failures" is a category of the OWASP Top 10:2025
3% → 20%share of useful alerts after tuning, in this lesson's case study
  1. Decide what to log
  2. Centralize and keep logs
  3. Know the warning signs
  4. Triage alerts
  5. Measure and tune

Why logs matter

Logs serve three purposes. They detect (an alert fires when something suspicious happens), they investigate (after an incident, logs show how the attacker got in, what they touched and when), and they prove (to an insurer, a regulator or a client, logs show what was and wasn't accessed). Without logs, a breach investigation often can't rule anything out, which can turn a small incident into a large notification.

What to log

You don't need to log everything. Start with the events that matter most for detecting the attacks from earlier lessons:

SourceEvents to recordWhy it matters
Identity provider and email (Microsoft 365, Google Workspace)Sign-ins (success and failure), MFA changes, new inbox rules and forwarding, admin role changesAccount takeover and business email compromise show up here first
Endpoints (laptops, servers)Security alerts, new software, disabled protection, unusual processesMalware and ransomware activity
Firewall and VPNAllowed and blocked connections, VPN logins, configuration changesRemote access abuse, data leaving the network
DNSLookups, especially of newly registered or known-bad domainsMalware often uses DNS to reach its operators
Cloud and SaaS appsAudit logs: file sharing, downloads, permission changes, new app connectionsData exposure and misuse of third-party apps
Critical business appsChanges to bank details, vendor records, payrollFraud that never touches "IT" systems

Two practical rules make logs trustworthy. First, synchronize clocks on every system (NTP, port 123 from lesson 6): if timestamps disagree by minutes, reconstructing an attack becomes guesswork. Second, centralize and protect logs by sending them to a separate system attackers can't easily erase, and keep them long enough to investigate. CISA's #StopRansomware Guide recommends centralizing logs and retaining critical system logs for at least one year where possible. Check your cloud plan: some entry-level plans keep audit logs for a short time unless you upgrade or export them.

1. During an investigation, the firewall, email and laptop logs show times that differ by up to 7 minutes. What should have been in place?

  • Time synchronization (NTP) on all systems
  • Longer log retention
  • More firewall rules

Without synchronized clocks, you can't reliably put events in order across systems. NTP keeps every device's time consistent, which makes correlation possible.

Detection tools: from built-in to managed

Built-in alertsMicrosoft 365, Google Workspace, firewalls
Cost
●●●●
Coverage
●●●●
Best for
Every organization: turn them on and route them to a monitored inbox.
Start here
EDR / XDREndpoint detection and response
Cost
●●●●
Coverage
●●●●
Best for
Spotting malicious behavior on devices and isolating them remotely.
Core control
SIEMSecurity information and event management
Cost
●●●●
Coverage
●●●●
Best for
Collecting and correlating logs from many sources; needs people to tune and watch it.
Mid-size and up
MDRManaged detection and response
Cost
●●●●
Coverage
●●●●
Best for
Small and mid-size firms that need 24/7 eyes without hiring a security team.
Outsourced SOC

Detection methods fall into three groups: signatures match known bad files or patterns; behavioral or anomaly detection flags activity that's unusual for a user or system (like a login at 3 a.m. from another continent); and threat intelligence matches indicators such as known malicious domains. Security teams often map their detections to MITRE ATT&CK, a public knowledge base of adversary tactics and techniques that gives defenders a common language for what they can and can't see.

Warning signs worth investigating

These signals catch a large share of real attacks against small and mid-size organizations, and most cloud platforms can alert on them out of the box:

Impossible travel

The same account signs in from two distant places within a time no one could travel.

Likely: stolen password or session.

New inbox rules

Rules that forward mail to an outside address or hide messages containing "invoice" or "payment."

Likely: business email compromise in progress.

New or changed admins

Someone becomes an administrator, especially at night or from an unusual device.

Likely: an attacker securing a foothold.

Mass file changes

Thousands of files renamed, encrypted or downloaded in minutes.

Likely: ransomware or data theft. Act immediately.

Others worth an alert: repeated MFA prompts (MFA fatigue), security tools being disabled, logins to dormant accounts, large uploads to unfamiliar cloud storage and changes to vendor bank details.

2. An alert shows that an accounts payable clerk's mailbox has a new rule forwarding every email containing "invoice" to an outside Gmail address. What is the best interpretation?

  • A normal productivity rule; no action needed
  • A strong sign of account compromise and possible business email compromise; escalate now
  • A spam filter setting created by IT

Attackers who take over a mailbox often create forwarding or hiding rules to monitor payments and intercept replies. Disable the rule, reset credentials, revoke sessions and check for fraudulent payment requests.

Triage: handling an alert in five steps

  1. ReceiveAcknowledge and timestampNote when the alert arrived and who's handling it, so nothing falls through the cracks.
  2. ValidateCheck the contextIs the user traveling? Is there a change ticket? Did IT schedule maintenance? Ask the user through a known channel.
  3. ScopeLook around itOther alerts for the same user or device? Same activity elsewhere? What data could be involved?
  4. DecideClose, monitor or escalateFalse positive: close with a note. Unclear: monitor. Likely malicious: escalate to incident response (lesson 14).
  5. ImproveDocument and tuneRecord the outcome and adjust the rule if it fires too often for harmless reasons.

Metrics that keep detection honest

Precision = true positives ÷ total alerts
MTTD (mean time to detect) = average time from start of incident to detection
MTTR (mean time to respond) = average time from detection to containment

Low precision means analysts spend most of their time on noise, which leads to alert fatigue: people start ignoring alerts, including the real ones.

Case: a Milwaukee manufacturer tunes its alerts

Lakefront Precision Parts, 120 employeesMilwaukee, Wisconsin · two-person IT team (a fictional example)

The team received about 1,200 alerts a week, and only 36 were worth action (3%). At about 3 minutes each, reviewing them all would take 60 hours a week, so most went unread. Over a month they tuned rules (excluding the backup server's normal mass file activity, adding the vulnerability scanner's address to an allowlist, grouping duplicate alerts) and moved the rest to an MDR provider for nights and weekends.

Before tuning

Alerts per week1,200
Review hours per week60
Precision3%

After tuning

Alerts per week180
Review hours per week9
Precision20%

The same 36 real issues per week, found in 9 hours instead of 60: precision rose from 3% to 20%.

The calculation: 36 ÷ 1,200 = 3% before and 36 ÷ 180 = 20% after. Review time went from 1,200 × 3 = 3,600 minutes (60 hours) to 180 × 3 = 540 minutes (9 hours). Tuning didn't hide real threats; it removed predictable noise so people could see them.

3. A security tool generated 240 alerts last month, and 12 turned out to be real incidents. What was its precision?

  • 20%
  • 12%
  • 5%

12 ÷ 240 = 0.05, or 5%. Nineteen out of every twenty alerts were noise, a strong signal that the rules need tuning.

Common mistakes

Collecting logs that nobody ever looks at.

Route alerts to a named person or service with a response time, not a shared inbox.

Keeping logs only on the device that produced them.

Centralize them; attackers often delete local logs to cover their tracks.

Turning off a noisy rule instead of tuning it.

Add exceptions for known, documented activity and keep the rule for everything else.

Assuming default retention is enough.

Check how long each system keeps logs and export or extend critical ones.

4. Three incidents last quarter were detected 6, 10 and 2 hours after they began. What is the MTTD?

  • 6 hours
  • 2 hours
  • 18 hours

(6 + 10 + 2) ÷ 3 = 18 ÷ 3 = 6 hours. Track it every quarter: falling MTTD means your detection is improving.

Practice exercise

Triage these six events from one morning at a Baltimore marketing firm. Label each benign, monitor or escalate, and give the first action.

  1. Three failed logins, then a success, for a designer at 8:02 a.m. from her usual office laptop.
  2. A successful login for the CFO from another country 40 minutes after his login from Baltimore.
  3. A new rule in the bookkeeper's mailbox forwards messages with "wire" to an external address.
  4. About 4,000 files on the file server renamed in 3 minutes by a single user account.
  5. The update service on all PCs restarted at 2:00 a.m. during the scheduled patch window.
  6. A new global admin account, "support-temp," was created at 11:48 p.m. by an admin who's on vacation.
See solution
  • 1. Benign (likely typos). Close with a note; investigate only if it repeats or comes from a new device.
  • 2. Escalate (impossible travel). Revoke the CFO's sessions, reset his password from a trusted device, confirm by phone and review recent mailbox activity.
  • 3. Escalate (likely business email compromise). Remove the rule, reset credentials, revoke sessions, warn finance to pause pending wires and check for spoofed payment requests.
  • 4. Escalate immediately (possible ransomware). Isolate the user's device and disable the account, then start incident response.
  • 5. Benign. Matches the documented patch window; consider tuning the alert to skip it.
  • 6. Escalate. Disable the new account, contact the admin through a known channel, check his account for compromise and review what "support-temp" did.

Log events 2, 3, 4 and 6 in the incident log, with time detected and actions taken.

Summary

  • Logs let you detect, investigate and prove what happened; start with identity, email, endpoints, firewall, DNS and cloud audit logs.
  • Synchronize clocks, centralize logs and keep critical ones for at least a year where possible.
  • Built-in alerts are the starting point; EDR, SIEM and MDR add depth as you grow.
  • Impossible travel, new inbox rules, new admins and mass file changes are high-value warning signs.
  • Triage in five steps and track precision, MTTD and MTTR; tune rules to fight alert fatigue.

Next lesson: Incident Response, Step by Step. You'll learn the incident response lifecycle, what to do in the first hour and which U.S. reporting deadlines may apply.

🎓 Save your progress and get a free certificate

Create your account in 30 seconds, mark your lessons and download your certificate at the end.

Enroll for free