How to scope a penetration test
Published · By National Front Corp.
Scope a penetration test by starting from the question you need answered, then writing down the targets that answer it, the user roles to test, how much the testers will know in advance, when they may test and who can stop them. Those decisions go into rules of engagement that you sign before testing begins. They determine what the test can prove, and they are the main driver of how much effort it takes.
Here is how to make each decision.
What question should the test answer?
A good scope starts with one or two plain questions, for example:
- Can an outsider reach customer data through our customer portal?
- If an employee’s laptop is compromised, can the attacker become a domain administrator?
- In our multi-tenant platform, can one customer see another customer’s data?
- If a developer’s cloud access key leaks, how far does it reach?
Each question points to specific targets, starting points and user roles. Without one, a scope tends to become a list of every address the organization owns, each tested thinly. If you do not yet know which systems matter most, a security assessment is the better first step.
Black box, grey box or white box?
The box describes how much the testers know before they start.
- Black box. Testers get little more than a company name or a list of targets. This mirrors an opportunistic outsider, but a real attacker has unlimited time and testers have a fixed window. Time spent on discovery is time not spent testing.
- Grey box. Testers receive accounts for the user roles in scope and some documentation, such as an API specification or an architecture overview. It is the most common choice for applications because it gives the broadest coverage for the effort.
- White box. Testers see source code, architecture and configuration. It finds flaws that outside testing would miss, such as weak cryptography or flawed business logic, and it suits high-value applications, but it needs more preparation from your team.
Giving testers information is not cheating. It compensates for the time limit and lets them spend the engagement finding weaknesses rather than rediscovering what you already know.
Which targets belong in scope?
List each target precisely, and list the exclusions just as precisely.
- External perimeter. Public IP ranges, domains and subdomains. Confirm that each one is actually yours, especially addresses in shared hosting.
- Internal network. A starting point inside, such as a standard workstation or a network port, to test what an attacker could do after a successful phishing email.
- Web applications. Each application and environment, with the functions that carry the most risk: payments, file uploads, account recovery and administration.
- APIs. The endpoints, their documentation, the authentication method and the back ends of mobile applications.
- Cloud. The accounts, subscriptions or projects in scope, with read access to review identity and access permissions, exposed services and the paths between them.
How do user roles and testing windows shape the test?
Many serious application flaws involve access control, so roles matter. Provide test accounts for each role in scope, such as anonymous visitor, customer, manager and administrator, and ideally two accounts per role, so testers can check whether one user can reach another user’s data and whether a lower role can perform higher-level actions. In a multi-tenant platform, provide accounts in at least two tenants. Decide how test accounts will handle multi-factor authentication, and load realistic test data.
Testing windows balance risk and speed. During business hours your team can respond quickly if something misbehaves; off-hours windows protect fragile systems but slow the work. Name the blackout dates, such as month-end close or a product launch, and any rate limits. Denial-of-service testing is normally excluded. Tell the testers about planned changes to the targets during the window, or freeze those changes.
What goes into the rules of engagement?
The rules of engagement are the signed document that makes the test authorized. They should cover:
- Authorization from someone with authority over every system in scope, and written permission from any third party that hosts one of them.
- Targets and exclusions, down to IP addresses, URLs and accounts.
- Permitted and prohibited techniques.
- Dates, hours and time zone.
- The testers’ source IP addresses, so your team can recognize the traffic.
- Contacts on both sides, including a stop contact who can be reached throughout testing and can halt it at once.
- Critical findings, reported immediately rather than held for the report.
- Data handling: what testers may view, how evidence is stored and destroyed, and how the report is delivered.
Cloud providers have their own rules. The major providers generally let customers test their own resources, in most cases without prior approval, under published policies that restrict activities such as denial-of-service testing and forbid any attempt to reach other customers or the provider’s own infrastructure. The policies differ between providers and change over time, so check the current policy of each provider in scope and reference it in the rules of engagement.
What should the report contain, and how does scope drive effort?
A useful report contains:
- an executive summary in plain language: what was tested, when, and what matters most;
- the scope, dates, approach and limitations, including anything that could not be tested;
- for each finding, the affected asset, its severity, the evidence of what was reached, enough detail for the owner to confirm it and a recommended fix;
- attack narratives showing how findings combined;
- a prioritized fix list.
Agree on the retest in advance. After your team applies the fixes, the testers verify each finding and issue an updated status, which is often what a customer or auditor asks to see.
Effort follows scope: the number of live hosts, applications, user roles, API endpoints and cloud accounts; the box type; the testing windows; any on-site work; and the retest. A narrow scope that answers the real question produces more value than a broad one tested thinly.
Our penetration testing team writes the scope and rules of engagement with you before any testing starts, and the findings are closed through vulnerability management. If you are preparing a test, an exploratory meeting is a good place to shape the questions it should answer.
Questions we hear often
- Should we test production or a staging environment?
- It depends on what you need to prove. Production shows the real configuration, data flows and defences, but testing there must be more careful and some techniques may be excluded. A staging environment allows more aggressive testing, but it only tells you about production if the two are genuinely identical. Many organizations test web applications in a faithful staging copy and the external perimeter in production.
- Can a SaaS application or hosted system we do not own be in scope?
- Only with the permission of its owner. Testing a system you do not own without authorization from its operator can breach your contract and may be illegal. Many software-as-a-service vendors forbid customers from testing their platform. What you can usually test is your own configuration of the service, such as user roles, sharing settings and single sign-on, and the integrations you built around it.
- Should we tell our IT team and security operations about the test?
- Usually yes, at least the people who need to recognize the testers and respond if something breaks. An unannounced test, where only a small group knows, can measure whether your monitoring detects and escalates suspicious activity. If you choose that option, write into the rules of engagement who knows, how testers identify themselves if challenged and how a real incident is told apart from the test.
- Can phishing or other social engineering be part of the scope?
- Yes, but only with explicit written approval and careful design. Human resources and legal should review the plan, the targeted groups should be defined, and personal accounts and devices stay out of scope. Results should be reported as patterns and lessons for training rather than as the names of individuals who clicked, so the exercise improves behaviour instead of damaging trust.