Security Playbook
25 · OperationsOWASP A09:20256 min read

Logging and alerting: would you notice?

Breaches are often discovered months later, by someone else. Security logging is about recording the few events that matter, alerting on the patterns that signal an attack, and keeping logs where an intruder can't erase them.

In one sentence

Log security events (auth, permission changes, exports), alert on a small set of high-signal patterns, and ship logs to an append-only store outside the servers they describe.

The same attack, with and without visibility

Would you notice this attack?
02:10412 failed logins for 38 accounts from 185.220.x.xlogged → deleted by the attacker
02:31Successful login: ops@shop.test from a new country, no MFA promptlogged → deleted by the attacker
02:34ops@shop.test grants itself the admin rolenot logged
02:40Export of 52,000 customer rows to CSVnot logged
02:47Local log files deleted on app-01not logged

✕ Never (found months later by a customer)

Detected at
—
Evidence after the attack
Gone
Logs without alerts are an archive; alerts without logs are guesses. Log security events (auth, permissions, exports), alert on the few patterns that matter, and keep logs where an attacker on the server can't delete them.
A simulated intrusion. Turn on logging, alert rules and off-host shipping and compare when (and whether) you'd notice.

What to log, what to alert on

LogAlert when
Logins, failures, MFA changes, password resetsMany failures from one IP or across many accounts; login without MFA from a new country
Role and permission changesAnyone becomes admin; changes outside the normal process
Data exports and bulk readsVolume far above the user's normal
Secret / key usage, new API keysA key used from an unexpected network or region
Security tool healthLogging or agents stop reporting

Key takeaways

  • 01Logs without alerts are an archive; alerts need the right logs.
  • 02Focus on authentication, permissions and data access events.
  • 03Keep logs off-host and append-only so attackers can't erase them.
  • 04Alert on a few high-signal patterns and on monitoring going silent.

Check your understanding

1 of 3

Which events matter most to log for security?

Related concepts