There is a specific, sinking feeling in incident response: you have the attacker in your sights, you know roughly what they did, and the log that would confirm it does not exist: it was never enabled, it aged out, or it was overwritten. A logging strategy is the work you do before that moment. You decide in advance which questions an investigation will need to answer, and you make sure the data to answer them survives until you ask.

Most logging is designed for operations (debugging a service, tracing a slow request) and then pressed into security duty during an incident, where it turns out to be missing the fields, the sources, or the retention that an investigation needs. A security logging strategy inverts the design: it starts from the investigative questions ("who authenticated as this account and from where?", "what did this process do after it launched?", "what left the network, to where?") and works backward to the sources and fields that answer them.

Retention is a security control

A Logging Strategy That Pays Off in an IncidentDiagram with these labels, in reading order: forward off-host; query during IR; protects; Log sources; hosts · apps · cloud ·; identity; Forward off-host; as events occur; Central store; retained past dwell time; Append-only / RBAC; integrity controls; Investigation; weeks or months later; Local log the; attacker can edit or; delete; Retention shorter; than dwell time →; evidence aged out.forward off-hostquery during IRprotectsLog sourceshosts · apps · cloud ·identityForward off-hostas events occurCentral storeretained past dwell timeAppend-only / RBACintegrity controlsInvestigationweeks or months laterLocal log theattacker can edit ordeleteRetention shorterthan dwell time →evidence aged out
Log strategy is written for the investigation you haven't had yet.

Dwell time is how long an attacker is present before discovery, and it can run to weeks or months. If your high-value logs roll off after seven days, the evidence of how many breaches began is gone by the time they are detected. Retention sets how far back an investigation can see. The sources that reconstruct an intrusion (authentication, process execution, network flow, cloud control plane) need retention sized to a realistic dwell time instead of last month's storage bill.

Why it matters: An attacker who has been in your environment for six weeks is invisible to logs that only go back one. When retention is shorter than dwell time, the start of a long intrusion cannot be recovered.

Log integrity, or the attacker edits the record

Logs that a compromised host can alter or delete are logs an attacker will alter or delete, because clearing traces is a standard step in a competent intrusion. Ship logs off the source system quickly, to storage the source cannot reach back into. Centralized, append-only, tamper-resistant logging means the record you investigate is the record of what happened, and the attacker does not get to choose what you see.

  • Design logging around investigative questions. For each source ask: ‘what incident does this help me reconstruct?’ If there is no answer, it is operations logging.
  • Ship logs off-host immediately. Anything that lives only on the machine that generated it is one attacker command away from deletion. Centralise fast.
  • Set retention against dwell time. Keep the sources that reconstruct an intrusion long enough to cover how long attackers actually stay, and tier cheaper storage so cost is not the reason you can’t look back.
  • Capture the fields investigations need along with the event. A login event without the source IP, or a process event without the command line, is a headline with the story torn out.
  • Verify the pipeline end to end. Logs silently stop flowing all the time. A source everyone assumes is covered but hasn’t reported in weeks is the gap you find at the worst moment.

Nobody thanks you for a retention policy on a quiet Tuesday, and everybody needs it during a breach. Design your logging for the investigation you hope never to run. You can only investigate what you recorded.

Back to the knowledge baseRequest an assessment