Skip to content

Engineering

Forensic readiness: the logging you need before a breach

Retention, endpoint telemetry and audit trails are decided months before an incident, and they set what an investigation can ever establish.

Computing America Cyber. Security assessments, penetration testing and staff training.

Send the question
4 min readComputing America
A hard drive sealed in a clear evidence bag with a chain-of-custody tag.

In short

  • Notification clocks start at different points (becoming aware, a materiality determination, discovery), and what you must report depends on what you can establish. Without logs you can't establish it.
  • Default retention can be seven or thirty days. An intrusion noticed months after it began has already lost its initial access and scope by the time the investigation starts.
  • Reimaging a compromised host destroys the evidence that scopes the incident. Isolate it and leave it powered on, because memory doesn't survive a shutdown.
  • Decide before the incident who may disconnect a production system, whether counsel runs the investigation, and what the insurance policy requires.
  • Test readiness by picking three plausible incidents and checking, source by source, whether current logging could answer them. The gaps are the work.

During an incident the room asks whether it's over. Afterward a regulator, an insurer, a customer's security team and possibly a court ask those questions and how you know. The notification clocks start at different points, and several depend on what you can establish:

Default retention sets how far back you can look

Retention is often whatever the product's default or license tier gives you. Microsoft Entra ID keeps audit and sign-in logs for seven days on the Free license and 30 days on P1 and P2, and keeping more means exporting them, to a storage account for example (Microsoft Entra data retention (opens in a new tab)). With 30-day retention, an intruder who got in during February and was noticed in June leaves an investigation that sees only the last month, and how the intruder got in is already gone.

Set retention per source as a decision, and write the reason next to the number. PCI DSS covers cardholder-data environments, but it gives a published reference point. Requirement 10.5.1 says to "retain audit log history for at least 12 months, with at least the most recent three months immediately available for analysis" (quoted in Microsoft's PCI-DSS guidance (opens in a new tab)). Check each source against the 12-month question, keep recent data searchable and move the expensive sources to cold storage.

Fig. 1

days of log history

  • Entra ID, Free7 days
  • Entra ID, P1 and P230 days
  • PCI DSS 10.5.1 reference12 months

Entra ID keeps logs for 7 days free and 30 days on P1 and P2, so even the paid tier holds about a twelfth of the 12 months PCI DSS 10.5.1 references.

SourceMicrosoft Entra data retention; PCI DSS requirement 10.5.1 as quoted in Microsoft's PCI-DSS guidance.

The first hour is where evidence is destroyed

A competent operations team facing a compromised machine wants to reimage it and restore service. That's right for availability and catastrophic for the investigation, because the machine was the record. Volatile memory holds things that exist nowhere on disk, and it doesn't survive a power cycle.

Isolate the machine and leave it powered on. Stop log rotation on anything relevant before it rolls. Acquire before you remediate, even when it feels like a delay you can't afford, and choose and test a memory-capture tool for each operating system in advance. NIST's guide to integrating forensic techniques into incident response (opens in a new tab) (2006) says that volatile data exists only on a live system and should be collected first.

Write down what you do as you do it, so responders' actions can be told apart from the intruder's later.

What to build

Build logging to answer four investigator questions, each from its own source:

  • How did they get in? Authentication logs from the identity provider, VPN, cloud console and database. Each place a credential is accepted needs its own.
  • What was accessed? Application audit trails, which record reads as well as writes.
  • What did they do next? Endpoint process lineage: what executed, from where, with which parent.
  • What left? DNS and egress records, because exfiltration is a network event.

On Windows, Sysmon records the process lineage (Microsoft says Sysmon logs process creation with the full command line for both current and parent processes (opens in a new tab)). For DNS and egress, keep resolver query logs and firewall or proxy logs of outbound connections.

Two mechanisms make the logs usable as evidence:

  • Write-once storage for the audit trail, somewhere an administrator of the source system can't alter it. S3 Object Lock in compliance mode is one option. AWS says a protected object version "can't be overwritten or deleted by any user, including the root user in your AWS account" (Amazon S3 Object Lock (opens in a new tab)).
  • Synchronized clocks. Point every source at the same NTP servers and check the offset, so one timeline can be built across sources.

Decide three things before the incident

  • Who may disconnect a production system, and on what evidence. Otherwise you spend an hour deferring upward.
  • Whether the investigation runs under counsel, which affects the privilege position of everything it produces and is hard to arrange afterward.
  • What your cyber insurance policy requires. Some require a panel response firm or prior written approval, and engaging outside that can affect coverage.

Test it like a backup

A backup isn't trusted until it's been restored, and logging deserves the same test. Pick three incidents plausible for your business: a compromised administrator account, a departing employee taking data, ransomware reaching a file server. Write down the questions you'd have to answer for each, then check source by source whether you could.

For a harder version, have a tester do something realistic, then compare their account of what they did against what your logs show. The difference is your detection gap.

Sources

  1. 1.SP 800-86: Guide to Integrating Forensic Techniques into Incident Response (opens in a new tab), NIST
  2. 2.General Data Protection Regulation, Article 33: Notification of a personal data breach to the supervisory authority (opens in a new tab), European Union, Regulation (EU) 2016/679
  3. 3.Cybersecurity Risk Management, Strategy, Governance, and Incident Disclosure: Small Entity Compliance Guide (opens in a new tab), U.S. Securities and Exchange Commission
  4. 4.45 CFR 164.404: Notification to individuals (opens in a new tab), Electronic Code of Federal Regulations
  5. 5.Microsoft Entra data retention (opens in a new tab), Microsoft Learn,
  6. 6.Locking objects with Object Lock (opens in a new tab), Amazon Web Services

Next step

Send us one incident question.

Ask the question you would need answered after a breach, and we will tell you which systems would have to be logging today for it to be answerable at all.

Reply
A person replies, not a sequence: within one business day, from someone who would be on the engagement.

Packages

Start with a package

Four packages, each with its price on the page. Pick one and buy it online.

Billing