LX1.4 Evidence Integrity and Chain of Custody
Evidence Integrity: Hashing, Documentation, and Chain of Custody
Learning objective: Understand how to verify the integrity of collected evidence using cryptographic hashing, how to document the chain of custody from collection through analysis to reporting, and why these practices matter even when legal proceedings are not anticipated.
Why Integrity Matters for Every Investigation
Evidence integrity is not just a legal requirement. It is a professional standard that distinguishes reliable investigation from guesswork. When you present findings to a CISO, a legal team, or a regulator, the first question is not “what did you find?” — it is “how do you know the evidence has not been modified since you collected it?” If you cannot answer that question with cryptographic proof, your findings are assertions rather than evidence.
The mechanism is simple: cryptographic hashing. When you collect a file, you compute its SHA256 hash. When you analyze the file days or weeks later, you recompute the hash. If the hashes match, the file has not been modified — not by you, not by anyone. If the hashes differ, the file was changed after collection, and you need to determine when and how.
Hashing Collected Evidence
Every evidence file should be hashed immediately after collection. UAC does this automatically — it generates a hashes.sha256 file containing the SHA256 hash of every collected artifact. For manually collected evidence, hash each file as you collect it:
| |
For disk images, the hash is critical because a multi-gigabyte disk image cannot be visually inspected for modifications. Hash the disk image immediately after acquisition:
| |
The dc3dd tool (a forensic version of dd) computes the hash during acquisition — you get the hash at the same time as the image, with no additional pass over the data. This is the preferred method for disk imaging because it saves time and provides the hash in the acquisition log.
Chain of Custody Documentation
The chain of custody records who handled the evidence, when, and what they did with it. For a Linux investigation, the chain of custody document should include:
Collection record — for each evidence artifact: what was collected (filename or description), when it was collected (UTC timestamp), where it was collected from (hostname, IP, path), who collected it (investigator name), how it was collected (tool and command used), and the SHA256 hash at the time of collection.
Transfer record — for each handoff: who transferred the evidence, who received it, when, and how (USB drive, network transfer, cloud storage). If evidence is transferred electronically, hash verification should occur at both ends.
Storage record — where the evidence is stored (encrypted disk, evidence locker, cloud storage with access controls), who has access, and what access controls are in place.
Analysis record — who analyzed the evidence, when, what tools were used, and whether the analysis was performed on the original evidence or a working copy. Best practice: always analyze a copy, never the original. Hash the copy and verify it matches the original before beginning analysis.
| |
When Legal Proceedings Are Anticipated
For investigations that may involve law enforcement, regulatory action, or civil litigation, evidence handling standards are stricter. The key additions:
Write blockers for bare-metal disk acquisition. A hardware write blocker physically prevents any write operation to the evidence disk. Software write blockers (mounting read-only) are acceptable for cloud disk snapshots and copied evidence, but hardware write blockers are the standard for original physical media.
Two independent hashes (SHA256 + MD5, or SHA256 + SHA1). If one hash algorithm has a collision weakness (MD5 has known collision attacks), the second hash provides independent verification. SHA256 alone is sufficient for most purposes, but dual hashing is the standard for evidence that may be challenged in court.
Witness documentation. A second person witnesses the evidence collection and signs the collection log. This prevents challenges based on the investigator fabricating evidence.
Evidence sealing. Physical media (USB drives, hard drives) are sealed in tamper-evident bags with the case number, date, and hash written on the seal. If the bag is opened, it is visibly obvious.
Check your understanding:
- You collected
auth.logfrom a compromised system three weeks ago and hashed it (SHA256: abc123…). You are now beginning analysis. What is your first step before opening the file? - Why does
dc3ddprovide a more reliable acquisition process than standarddd? - The chain of custody log shows a gap — evidence was transferred on March 28 but the recipient’s verification hash was not recorded until March 31. Why is this a problem?
- You need to analyze a 50GB disk image. Should you analyze the original or a copy, and why?
You're reading the free modules of this course
The full course continues with advanced topics, production detection rules, worked investigation scenarios, and deployable artifacts. Premium subscribers get access to all courses.