The three approaches compared
PCI SSC’s penetration testing guidance defines them by knowledge of the target’s internal structure, design and implementation: none for black box, partial for grey box and full for white box. NIST SP 800-115 and the OWASP Web Security Testing Guide use the same idea. In practice the difference shows up in what you hand over.
| Approach | What testers receive | Who it simulates | Strengths | Limits |
|---|---|---|---|---|
| Black box | Targets only: a URL, app store listing or IP range. No accounts, documentation or code. | An outside attacker with no prior access. | Shows what is exposed and discoverable from the internet. Little preparation for your team. | Time goes on discovery. Features behind login, admin functions and role boundaries may get little or no coverage. |
| Grey box | Test accounts for each role, API documentation and a short architecture briefing. | A registered user, customer or partner, or an attacker who has stolen a login. | Best coverage per testing day for most web apps and APIs. Tests authorization, tenant isolation and business logic directly. | Depends on good test accounts and data. Does not review code or configuration behind the interface. |
| White box | Everything in grey box, plus source code, configuration, infrastructure-as-code or read-only cloud access. | An insider, or an attacker with long-term, detailed knowledge. | Finds issues that are hard to reach from outside and points to root causes in code. Confirms whether a fix covers every instance. | More preparation and approvals. Reading code takes tester time, so the scope must allow for it. |
Cost and time trade-offs
Most penetration tests are time-boxed: the provider prices a number of tester days against an agreed scope. The approach decides how those days are spent.
- Black box spends time on discovery. Testers map the application, look for registration paths and guess at hidden endpoints before they can test the features that matter. PCI SSC notes that a pure black-box test “may require more time, money, and resources” to meet PCI DSS requirements. If you want the same depth as a grey box test, expect a larger scope, not a cheaper one.
- Grey box spends time on testing. With accounts and an API description, testers start on authorization, tenant isolation, payment and approval workflows on day one. For most web applications and APIs this gives the best coverage for the budget.
- White box adds review time and preparation. Reading code finds problems that black box testing may never reach, such as a missing permission check on a rarely used endpoint, and it shows whether a flaw repeats elsewhere. It also needs repository access, approvals and enough tester time to read the relevant code.
The cheapest option is not always the one with the smallest price. A black box test that never logs in can produce a short report while missing the access control issues customers and auditors care about most.
Which should you choose?
- Choose black box to check your external attack surface: what an outsider can find and reach with no account, such as exposed services, forgotten subdomains and unauthenticated endpoints. It suits external network testing and a first look at an unfamiliar estate.
- Choose grey box for most web application, API and mobile app tests, and for SaaS products where customers ask whether one tenant can see another’s data. It also suits SOC 2 evidence, and PCI SSC says PCI DSS tests are typically grey or white box.
- Choose white box for high-risk code such as authentication, payments or cryptography, for cloud configuration reviews, after an incident, or when you need to confirm that a class of bug is fixed everywhere.
- Combine them when needed: an unauthenticated pass to see what an outsider finds, followed by authenticated testing with documentation. The proposal should state the order and how time is split.
What to share with testers
For a grey or white box test, prepare these before the start date. If accounts or documentation are missing on day one, testers spend the first days waiting or rediscovering what you could have sent.
Test accounts
At least one account per role, and two accounts in the same role so testers can check whether one user can reach another’s data. For multi-tenant products, accounts in two separate tenants.
API description
An OpenAPI file, GraphQL schema or Postman collection, including internal and admin endpoints that are in scope.
Environment details
Which environment to test, any rate limits or WAF rules, IP allowlisting, and whether destructive actions such as deletes, refunds or emails are safe to trigger.
Test data
Realistic records the accounts can create, edit and delete without affecting real customers.
Architecture overview
A diagram or a few sentences on the main components, third-party services and where sensitive data is stored.
Code or configuration (white box)
Read-only access to the relevant repositories, infrastructure-as-code or cloud console, limited to what is in scope.
Contacts and boundaries
A technical contact during testing, an emergency contact, and a written list of what is out of scope.
Do not share real customer credentials, production secrets or personal data the test does not need. Send access details through an agreed secure channel, not in the request for proposal. The penetration test scope checklist covers authorization, safety limits and reporting in more detail.
Black, grey and white box testing FAQs
Is black box testing more realistic?
It matches one kind of attacker: an outsider with no access. Real attackers often have more time, sign up for accounts, buy stolen credentials or work with insiders. In a time-limited test, giving testers accounts and documentation usually finds more of what a determined attacker would find.
Which approach is best for PCI DSS?
PCI SSC’s penetration testing guidance says PCI DSS tests are typically performed as white-box or grey-box assessments, and that a pure black-box test may require more time, money and resources to meet the requirements. Agree the approach with your QSA.
Is grey box the same as an authenticated penetration test?
Mostly. An authenticated test gives testers valid logins, which is the core of grey box testing. Grey box usually also includes documentation such as API specifications or an architecture overview.
Does white box testing mean a full code review?
Not necessarily. In a white box penetration test, testers use code and configuration to guide and confirm their testing. A full secure code review of a large codebase is a separate, larger piece of work, so the scope should say which one you are buying.
Is it safe to give testers source code or credentials?
Use dedicated test accounts, not real user or admin logins, and grant read-only access limited to the code in scope. Revoke access when testing ends. Confirm in the contract how the provider stores and deletes your data.
Pick the approach in the written scope
RootDarth’s proposals state the testing approach, the roles and access testers will use, and what is out of scope. Published USD packages start at $999 for one web application or API, $2,500 for a Standard web application and API test, and from $5,000 for Comprehensive engagements.
Not sure which approach fits?
Describe the application, the user roles and what you are worried about. RootDarth will recommend an approach and send a written scope, fixed price and timeline.
Request a proposal