A penetration testing contract needs seven things: written authorization from someone with the legal authority to give it, a defined scope, rules of engagement, a schedule with emergency contacts, terms for handling data, a statement of liability and insurance, and an agreed reporting format. Without the first, the test is unauthorized access under the law.
Why does a penetration test need a contract at all?
Because the contract is the only thing that separates a tester from an intruder. In the United States the Computer Fraud and Abuse Act, 18 U.S.C. 1030, makes it a crime to access a protected computer without authorization. The technical actions of a penetration test and a real attack are often identical. The difference is permission, and permission that is not in writing is hard to prove at two in the morning.
The risk is not theoretical. In September 2019 two penetration testers employed by Coalfire, working under a contract with Iowa’s state court administration, were arrested at the Dallas County courthouse and spent a night in jail. The charges were later dropped. The dispute turned on a question the paperwork had not settled clearly enough: who had the authority to approve physical testing of a county-owned building.
What should the scope section say?
Scope names exactly what may be tested and, just as clearly, what may not. List the IP ranges, domains, applications, cloud accounts, wireless networks, and physical sites that are in scope. List the exclusions. State whether social engineering is allowed and against whom. If any system in scope is hosted by a third party, the client must confirm that the provider permits testing, because a client cannot authorize an attack on infrastructure it does not own.
What are rules of engagement?
Rules of engagement are the operating limits of the test. NIST Special Publication 800-115, the Technical Guide to Information Security Testing and Assessment, describes them as detailed guidelines and constraints for the execution of testing, established before the test begins, and it includes a template for them. At a minimum they should cover:
- Testing dates and permitted hours
- Techniques that are prohibited, such as denial of service
- Named contacts on both sides, with phone numbers that are answered at night
- What the tester must do on finding evidence of a real, prior compromise
- How and when testing may be paused or stopped
Who has to sign it?
Someone with authority over every system and site in scope. This is the lesson of the Iowa case. A signature from the IT manager does not cover a building owned by another entity or a server run by a vendor. When ownership is divided, get a signature from each owner, and have the tester carry a copy of the authorization letter during any physical work.
What else belongs in the paperwork?
The Penetration Testing Execution Standard devotes its first section to pre-engagement, and the PCI Security Standards Council’s Penetration Testing Guidance (version 1.1, September 2017) does the same for cardholder data environments. Between them the remaining items are plain: confidentiality terms, how client data found during the test will be stored and destroyed, limits of liability and proof of insurance, payment and retesting terms, and the form of the final report, which should include an executive summary, each finding with its severity and evidence, and a recommended fix.
This article is general information, not legal advice. Have counsel review any testing agreement before work begins.
Alfred Basta is a professor, author and musician. He is a co-author of Pen Testing from Contract to Report (Wiley, 2024), which follows an engagement from the first agreement to the final report.