What is chain of custody in a pentest

Updated November 12, 2026. Author: Manuel, founder and security engineer.

Chain of custody in a pentest is the documented, tamper-evident record that shows which evidence was collected, when, by whom and within what authorized scope. It keeps the report defensible: if the client disputes a finding, if an audit asks for proof, or if you need to reconstruct what happened, chain of custody answers those questions without relying on your word. It is not the same as signing the final PDF: a signature proves who issued the document, but not that each piece of evidence is intact, ordered in time and within scope. A verifiable chain links each element to its hash, seals it with an independent time source and keeps the record append-only.

This guide is written for anyone who produces or receives pentest reports: small consultancies, red teams, ISO 27001 or ENS auditors, and clients who want to know whether the report they receive proves anything. Written by Manuel, founder of NODO. You can see how we understand scope and authorization on our ethics page. Everything that follows applies only to engagements with express, written authorization.

What is chain of custody and why does it matter in a pentest?

Chain of custody is a forensic concept: the chronological, continuous record of how a piece of evidence has been handled from the moment it is collected until it is presented, so that it can be shown that it was not altered or substituted along the way. The NIST SP 800-86 guide on forensic techniques frames it as an integrity principle: you must be able to trace who had access to the evidence and when, and prove that it arrived intact.

In a pentest, the "evidence" is the proof behind each finding: the request and response that trigger a vulnerability, the screenshot, the output of a command, the result of an exploit. A report is only worth what you can demonstrate. And the situations where you are asked for this are more common than they seem: a client claims you touched a system outside scope, an incident coincides in time with your testing window, an auditor needs traceable evidence, or simply a critical finding that the client wants to confirm before spending money on remediation. Without a chain of custody, in all those cases you only have your word against theirs.

What should a chain of custody record in a pentest?

A useful chain of custody answers, for each piece of evidence, a fixed set of questions. If any is missing, there is a gap through which doubt can creep in. The table summarizes what is recorded and why.

Question it answersWhat is recordedWhat it is for
What evidence is it?The item itself and its content hash (for example SHA-256)Fixes the evidence: any later change alters the hash and is detected
When was it collected?A timestamp from an independent source, not the operator's clockPlaces the evidence on the engagement timeline and against external incidents
Who collected it?The operator's identity, bound to a signatureAttributes the action to a specific person or key
Under what authorization?The reference to the agreed scope and testing windowShows that the action was permitted
In what order?An append-only sequence in which each record references the previous onePrevents reordering or deleting items without breaking the chain

What matters is not filling in a form, but that this data is bound to the evidence in a way that cannot be changed later without leaving a trace. A text notebook with those columns is better than nothing, but it does not stop someone from rewriting a row. The difference between a log and a chain of custody is precisely that: the second can be verified by a third party.

Why is a signed PDF not enough?

Signing the final report with a certificate is useful, but it covers less than it seems. A digital signature on the PDF proves two things: who issued it, and that the document has not been modified since it was signed. It proves nothing about what happened before signing.

Specifically, a signature on the final document does not show when each piece of evidence was collected, that no material was added, removed or reordered before the PDF was generated, that everything collected was within scope, or that the timeline the report presents is real. Trust remains with the issuer: you have to take it on faith that the process was clean.

This is the difference between signing and attesting. Signing validates the result. Attesting validates the process: each piece of evidence, individually, with its hash, its time and its signature, in a record that cannot be rewritten after the fact. A well-built chain of custody moves trust from "trust whoever signs" to "check it yourself".

How is a verifiable chain of custody built?

Nothing exotic is required. Four components are combined, all using proven tools and standards:

  • Content hash. A cryptographic digest (for example SHA-256) is computed for each piece of evidence. If the file changes by a single bit, the hash changes completely, so the hash makes the evidence tamper-evident: recomputing it is enough to tell whether it is the same.
  • Chained, append-only log. Each log entry includes the hash of the previous entry, like the links of a chain. This prevents reordering, deleting or inserting items without breaking the sequence, with no need for any public blockchain.
  • Ed25519 signature. Each entry is signed with a private key, so it is attributed to a specific operator or system, and anyone with the public key can verify the signature.
  • RFC 3161 timestamp. An independent Time Stamping Authority (TSA) signs a token proving that a piece of data existed before a given instant. The standard is described in RFC 3161. Anchoring time to an external source avoids having to trust the operator's clock.

With those four components, a third party can verify the work without trusting you: they recompute the hashes, check that the chain is not broken, validate the signatures with the public key and confirm the timestamps. This is exactly how TRACEZ signs each piece of evidence that enters a case with Ed25519 and seals it with RFC 3161, and how ATTEST lets you verify a report independently.

What do audits (ISO 27001, ENS) require regarding evidence?

The framework that most often comes up is ISO/IEC 27001:2022, whose control 5.28, "Collection of evidence", calls for procedures for the identification, collection, acquisition and preservation of evidence. In practice, an auditor wants to see that evidence is preserved with integrity and traceability, not a loose PDF. In the Spanish public sector, the Esquema Nacional de Seguridad (ENS, National Security Framework) points in the same direction with record-keeping and traceability of activity.

A verifiable chain of custody fits these requirements almost naturally: the hash covers integrity, the chained log covers traceability and order, and the timestamp covers chronology. It is not about adding bureaucracy, but about storing the proof you already generate while working in a form that holds up to close scrutiny.

Frequently asked questions

Is chain of custody only needed if the case goes to court?

No. Although its origin is forensic and judicial, in a commercial pentest it serves something more everyday: backing up the report if the client disputes what was done, when, or whether something fell outside scope, and getting through an audit. Any engagement with a report that someone could challenge benefits from a chain of custody, whether or not it goes to a court.

Isn't it enough to sign the final report with my certificate?

The PDF signature proves who issued the document and that it was not altered after signing, but it does not prove when each piece of evidence was collected, that nothing was added, removed or reordered before signing, or that everything was within scope. That is the difference between signing the result and attesting the process: chain of custody covers the latter.

What happens if the client questions a piece of evidence months later?

With a verifiable chain, a third party can recompute the evidence hash, check that it matches the one recorded, and validate the timestamp and signature without having to trust your word. Without it, you only have your claim against theirs.

Do I need a blockchain for this?

No. It is enough to chain each record by the hash of the previous one in an append-only log, sign each entry with an Ed25519 key and anchor the time with an RFC 3161 timestamp from an independent authority. That gives verifiable integrity, order and date without any public blockchain.

If you want to deliver reports whose evidence can be checked without trusting you, you can verify a signed report at verify.no-do.dev and see how TRACEZ signs each piece of evidence with Ed25519 and an RFC 3161 timestamp within the case.