Chain of Custody and Evidence Handling for DFIR
Practical DFIR guide to chain of custody: order of volatility, forensic imaging and hashing, custody logs, and secure storage.
In this article
In digital forensics and incident response, the technical brilliance of an analysis counts for nothing if the evidence cannot be trusted. Chain of custody is the discipline that makes an artifact defensible: a continuous, documented record of who collected each item, when, how, and everyone who touched it since. Whether an investigation ends in a courtroom, an internal disciplinary process, or simply an honest root-cause report, the same principle holds: you must be able to show that the bytes you analyzed are the same bytes that existed on the system, unchanged by your handling. This guide is written for defenders and DFIR practitioners. It explains what chain of custody means, how to acquire and preserve evidence correctly, and the mistakes that quietly destroy admissibility long before anyone opens the case file.
What chain of custody means#
Chain of custody is the auditable history of a piece of evidence from the moment it is identified to the moment it is presented or destroyed. It answers a simple adversarial question: could this have been altered, and can you prove it was not. In practice it combines two things. First, integrity: a cryptographic proof, usually a hash, that the data has not changed. Second, accountability: an unbroken paper or digital trail naming each person who possessed the item, the times of transfer, and the purpose of each access. If either breaks, an opposing party can argue the evidence is unreliable. The goal is not bureaucracy for its own sake; it is to remove reasonable doubt about the authenticity of what you found.
Why the stakes are higher than they look#
Even in investigations that never reach a court, chain of custody protects everyone involved. A clean record shields the responder from accusations of tampering, protects the accused from a fabricated case, and gives leadership confidence that the conclusions rest on solid ground. When matters do become legal, sloppy handling is one of the most common reasons evidence is excluded. Regulators, insurers, and auditors increasingly expect the same rigor for breach investigations. Treating custody as optional because this one is just internal is a trap, because you rarely know at the start of an incident how far it will travel. The safest posture is to handle every acquisition as if it might one day be scrutinized by a hostile expert.
Order of volatility: collect in the right sequence#
Digital evidence decays. Some of it vanishes the instant a machine is powered off or even left running. The order of volatility tells you to capture the most fragile data first. Broadly, that means CPU registers and cache, then the contents of RAM and the state of running processes and network connections, then temporary and swap data, then the disk, and finally archival sources like backups and remote logs. In practical terms, if a system is live and you have authority to act, capturing a memory image before you pull power can preserve encryption keys, in-memory malware, and network state that a disk image alone will never show. Document the sequence you chose and why, because the acquisition order itself is part of the record.
Acquisition: imaging and hashing#
Correct acquisition is where integrity is won or lost. The principle is to work on a copy, never the original. For disks, use a write blocker and create a bit-for-bit forensic image, then compute a cryptographic hash of both the source and the image so you can prove they match. Historically MD5 and SHA-1 were used, but modern practice favors SHA-256 to avoid arguments about collision weaknesses. Record the tool, its version, the operator, timestamps, and the resulting hash values in your notes at the time of acquisition, not afterward from memory. From then on, every analysis runs against a verified working copy, and you re-hash before and after handling to demonstrate that your examination changed nothing.
Labeling, sealing, and the custody log#
Once acquired, an item must be uniquely identifiable and physically or logically controlled. Assign a unique evidence identifier, label the media or image with the case number, date, collector, and a description, and where physical media is involved use tamper-evident bags with signed seals. The custody log is the heart of accountability: every transfer records who released the item, who received it, the date and time, and the reason. Each handoff should be signed. For digital evidence stored in a system, the equivalent is an access-controlled repository with immutable audit logging so that every read, copy, and export is attributable. A gap in the log, even an innocent one, is exactly what an opposing expert looks for.
Storage and integrity over time#
Evidence often waits months before it is needed, so preservation is not a one-time act. Store images in a secure, access-restricted location, ideally with redundancy so a single disk failure does not destroy the only copy. Periodically re-verify hashes to prove ongoing integrity, and record those verifications. Restrict who can access the repository and log every access. For long-lived cases, consider write-once media or object storage with legal hold and object lock so that no one, including administrators, can silently modify or delete an item. The question you must always be able to answer is whether the artifact in storage today is provably identical to the one you acquired, and your records must make that answer trivial.
Cloud and remote evidence#
Modern incidents span systems you do not physically hold. Cloud evidence, SaaS exports, and logs from managed services require the same rigor adapted to the medium. When you export data from a provider, capture the exact API calls or console actions, the account and identity used, timestamps, and a hash of the exported artifact. Note that you are collecting a copy the provider produced, and document the provider's own integrity guarantees where they exist. Because remote logs can have short retention, prioritize preserving them early, and record the moment of collection precisely. The chain-of-custody principles do not change in the cloud; what changes is that you must also document the trust you are placing in a third party's systems and how you verified the export.
Common pitfalls#
Several errors recur and each can sink a case. Analysts examine the original media instead of a verified copy, altering timestamps in the process. Someone forgets to hash at acquisition, so there is no baseline to prove integrity later. The custody log has a gap where an item sat on a desk overnight with no entry. Notes are written from memory hours later, introducing inconsistencies a cross-examiner will exploit. Clocks across systems are never reconciled, so the timeline contradicts itself. And a subtle one: a responder acts without documented authorization to seize or access the data, tainting everything that follows. The remedy for all of these is the same discipline applied consistently, and contemporaneous documentation that never relies on recollection.
DFIR chain-of-custody checklist#
Use this as a working sequence. 1. Confirm authorization and scope in writing before touching anything. 2. Photograph and document the scene and system state. 3. Collect by order of volatility, capturing memory before power-off when appropriate. 4. Use a write blocker and create a forensic image; do not work on originals. 5. Hash source and image with SHA-256 and record the values immediately. 6. Assign a unique ID, label, and seal the evidence. 7. Maintain the custody log for every transfer, signed on both sides. 8. Store securely with redundancy and periodic hash re-verification. 9. Analyze only verified working copies and re-hash before and after. 10. Document every step contemporaneously, never from memory.
FAQ: which hash algorithm should I use for evidence?#
Use SHA-256 as the default. MD5 and SHA-1 still appear in older tooling and are not useless for a quick integrity check, but both have known collision weaknesses that a skilled opposing expert can raise to cast doubt. Computing SHA-256, and recording it at the moment of acquisition, avoids that argument entirely. It is common and reasonable to record more than one hash for defense in depth. The specific algorithm matters less than the discipline around it: hash the source and the image, record the values contemporaneously, and re-verify over time so you can always demonstrate that nothing changed under your control.
FAQ: do I have to capture memory, or is a disk image enough?#
It depends on the incident, but for a live, potentially compromised host, memory is often the most valuable and most perishable evidence you will ever get. RAM can hold encryption keys, decrypted data, injected code that never touches disk, and the live network state, all of which vanish at power-off. If you have the authority and a safe method, capture memory before shutting down. That said, memory acquisition on a live system does perturb the machine slightly, so document your method and its footprint. For a system that is already off, you work with the disk and any available logs, and you note that volatile data was unavailable by the time you arrived.
Conclusion#
Chain of custody is the quiet foundation that lets a DFIR investigation stand up to scrutiny. It rests on two pillars, provable integrity through hashing and unbroken accountability through documentation, applied from the first moment of collection to final disposition. Collect in order of volatility, work only on verified copies, hash early and re-verify often, keep a signed custody log with no gaps, and write everything down as it happens rather than from memory. Treat every acquisition as though it will face a hostile expert, and you protect not only the case but everyone involved in it. The habits are simple; the discipline of applying them every single time is what makes evidence trustworthy.


