Most disappointing penetration tests were decided before testing started. The tester got one account instead of four roles, a single tenant instead of two, a production URL nobody was allowed to touch, and an API nobody mentioned. The report came back thin, and the team blamed the provider. The real problem was the penetration testing scope.
Scope is the contract between you and your testers about what gets tested, how, and under what rules. Done well, it focuses expensive tester time on the parts of your product that carry real risk. Done badly, it wastes days on access problems and leaves the most important code untested. This guide walks through how to scope a SaaS pentest properly, including a template you can copy, commands to measure your attack surface, a safe way to hand over credentials, and how scope translates into effort and price.
A penetration testing scope is a written definition of the engagement. At minimum it answers five questions:
The scope document then feeds the statement of work, the rules of engagement, and the methodology section of the final report. Auditors read that section to decide whether the test counts as evidence, so a precise scope pays off long after the engagement ends.
A network pentest scope can be little more than a list of IP ranges. A SaaS scope cannot, because the risk in a SaaS product sits in places an IP list does not describe:
A vague scope such as "test app.acme.io" leaves all of this to chance. A good scope makes it explicit.
State why you are testing and what a successful outcome looks like. "SOC 2 Type 2 evidence for the period ending March 31" leads to a different engagement than "validate tenant isolation before launching our enterprise tier." The driver shapes depth, timing, and deliverables.
List every component by name and location:
Provide accounts for every role you support, in at least two tenants. Include an API client or integration credential if third parties connect to your API. This one line in the scope has more influence on the quality of findings than almost anything else.
Say where testing happens. Staging is usually preferred, as long as it runs the same code and configuration as production and holds realistic seeded data. If production is in scope, define limits: allowed hours, maximum request rate, and which actions are prohibited.
The amount of information you share changes what the test can achieve:
Gray box is the right default for SaaS. Attackers eventually obtain accounts, whether by signing up for a trial, buying a seat, or compromising a customer. Spending paid tester days rediscovering what your docs already say is a poor use of budget.
List what must not be touched: third-party services, payment processors, status pages, real customer data, denial of service testing, and social engineering unless explicitly agreed. Be specific. "No production" is clearer than "be careful in production."
Copy this template, fill in every field, and send the same file to each provider you are considering. It gives you comparable quotes and gives the testers what they need on day one.
# saas-pentest-scope.yaml
engagement:
company: Acme SaaS Inc.
drivers: [SOC 2 Type 2 evidence, enterprise security reviews]
objectives:
- Validate tenant isolation across web and API
- Validate role-based access control for all roles
- Review cloud identity paths in production AWS
window: 2027-01-11 to 2027-01-22
approach: gray box
targets:
web_apps:
- name: Customer app
staging: https://app.staging.acme.io
production: https://app.acme.io
apis:
- name: Public REST API
base_url: https://api.staging.acme.io/v2
schema: openapi-v2.json
operations: 142
- name: GraphQL API
base_url: https://api.staging.acme.io/graphql
queries: 38
mutations: 27
integrations: [Okta SAML SSO, SCIM provisioning, outbound webhooks]
cloud:
provider: aws
accounts:
- id: "111122223333"
name: prod
- id: "444455556666"
name: shared-services
external:
hosts_file: external-hosts.txt # verified as owned infrastructure
mobile: none
access:
tenants: [pentest-alpha, pentest-bravo]
roles: [owner, admin, member, read_only, api_client]
mfa: TOTP seeds supplied with credentials
role_matrix: roles-permissions.csv
credential_handoff: encrypted to tester public key
environments:
staging: full testing permitted, seeded data
production:
allowed: read-only verification of staging findings
hours: 09:00-17:00 America/Toronto, weekdays
max_rps: 5
out_of_scope:
- status.acme.io (third-party hosted)
- help.acme.io (third-party hosted)
- Stripe and other payment processor endpoints
- denial of service and load testing
- social engineering of staff or customers
reporting:
critical_findings: notify within 24 hours via shared channel and phone
deliverables: [executive summary, technical report, retest report, attestation letter]
compliance_mapping: SOC 2 CC4.1, CC7.1
retest: included
contacts:
technical: security-oncall@acme.io
escalation: cto@acme.io, +1-555-0100
[cta]
If any field is hard to fill in, that is useful information in itself. Redfox Cybersecurity offers a free 30-minute scope review that walks through this template with your team, fills the gaps, and returns a fixed quote within 24 hours.
Providers price on effort, and effort depends on size. Measuring your own attack surface before you ask for quotes prevents both overpaying and underscoping.
Each combination of path and HTTP method is an operation that has to be tested for authentication, authorization, and input handling. Count them from your specification:
# Count REST operations (path + method) in an OpenAPI document
jq '[.paths | to_entries[] | .value | keys[]
| select(test("^(get|post|put|patch|delete)$"))] | length' openapi-v2.json
# Break the count down by top-level resource to spot the large areas
jq -r '.paths | keys[] | split("/")[2]' openapi-v2.json | sort | uniq -c | sort -rn
[cta]
For GraphQL, count queries and mutations from the schema file:
# count_graphql_ops.py
from graphql import build_schema
schema = build_schema(open("schema.graphql").read())
queries = schema.query_type.fields if schema.query_type else {}
mutations = schema.mutation_type.fields if schema.mutation_type else {}
print(f"queries: {len(queries)}, mutations: {len(mutations)}")
for name in sorted(mutations):
print(" mutation:", name)
[cta]
Mutations deserve extra attention in scoping because they change data, and every one of them needs authorization checks per role and tenant.
Your external pentest scope should match what is actually reachable from the internet. Pull it directly from your cloud account rather than from memory:
# Elastic IPs and internet-facing load balancers
aws ec2 describe-addresses --query 'Addresses[].PublicIp' --output text
aws elbv2 describe-load-balancers \
--query 'LoadBalancers[?Scheme==`internet-facing`].DNSName' --output text
# CloudFront distributions and API Gateway endpoints
aws cloudfront list-distributions \
--query 'DistributionList.Items[].[DomainName, Aliases.Items]' --output text
aws apigatewayv2 get-apis --query 'Items[].ApiEndpoint' --output text
[cta]
Run the same commands in every region and account you use. Forgotten resources in a second region are a common source of external findings.
Many of your subdomains point to services you do not own, such as a help center, a status page, or a marketing platform. You cannot authorize testing of someone else's infrastructure, so these must be identified and listed as out of scope:
# Enumerate your subdomains and resolve where each one points
subfinder -d acme.io -all -silent \
| dnsx -silent -a -cname -resp -o resolved.txt
# Flag CNAMEs that point to third-party platforms
grep -Ei 'zendesk|statuspage|hubspot|cloudfront|herokuapp|vercel|netlify' resolved.txt
[cta]
Anything that resolves to infrastructure you control goes into the external hosts file. Anything hosted by a vendor goes into the out-of-scope list, along with a note to check whether the vendor allows customer-initiated testing. CloudFront and similar CDNs in front of your own origins are usually in scope, but confirm with your provider.
If you use AWS Organizations, export the full account list and mark each one as in or out of scope:
aws organizations list-accounts \
--query 'Accounts[?Status==`ACTIVE`].[Id, Name, Email]' --output table
[cta]
Cloud reviews are usually priced per account. Production and any account that can reach production, such as shared services or CI, are the ones that matter most. Sandbox accounts with no path to production can often wait.
Testers find authorization bugs by comparing what a role can do with what it should be able to do. If you do not tell them what "should" means, they have to guess from the UI. A simple role and permission matrix removes the guesswork:
action,owner,admin,member,read_only,api_client
view_projects,yes,yes,yes,yes,yes
create_project,yes,yes,yes,no,yes
delete_project,yes,yes,no,no,no
invite_user,yes,yes,no,no,no
change_user_role,yes,no,no,no,no
view_billing,yes,yes,no,no,no
update_payment_method,yes,no,no,no,no
configure_sso,yes,no,no,no,no
export_all_data,yes,yes,no,no,no
rotate_api_keys,yes,yes,no,no,yes
[cta]
Every "no" in this file is a test case. When a member can call delete_project or a read-only user can export_all_data, the tester can report it as a clear violation of your intended design rather than an opinion. The same matrix becomes a regression test suite once the engagement ends.
Test credentials for every role in two tenants, plus TOTP seeds and API keys, are sensitive. They should never be pasted into email or chat. Encrypt them to the tester's public key and share the key fingerprint through a separate channel:
# Tester shares their age public key during kickoff
TESTER_KEY="age1qz0a9g3w4l7m8x6c2v5n0p3s4d6f8h9j0k2l4m6n8p0q2r4s6t8u0w2"
# Encrypt the credentials bundle so only the tester can read it
tar czf - credentials/ | age -r "$TESTER_KEY" -o pentest-creds-2027-01.tar.gz.age
# Record a checksum and send it through a different channel
sha256sum pentest-creds-2027-01.tar.gz.age
[cta]
Give every test account an expiry date that falls shortly after the retest window. When the engagement ends, disable the accounts and rotate any API keys you shared, even if they only worked in staging.
This is the most debated line in any SaaS scope, and the honest answer is usually both, in different ways.
Staging should carry most of the testing. It lets testers create, modify, and delete data freely, try state-changing requests across tenants, and exercise integrations without touching real customers. The condition is that staging must genuinely mirror production: the same code version, the same infrastructure as code, the same identity provider configuration, and the same WAF and rate limiting rules. If staging lags production by three releases or runs with authentication relaxed for developer convenience, findings will not transfer, and real production weaknesses will stay hidden.
Production still matters for a narrow set of checks. Some issues only exist there: a CDN rule, a production-only feature flag, a DNS record, or an internet-facing host that has no staging twin. A sensible scope allows read-only verification in production, limited to business hours, with a low request rate and a named contact on call.
Write the decision into the scope explicitly, including which differences between staging and production you already know about. Testers can then plan around them instead of discovering them halfway through the engagement.
Effort grows with the number of things to test multiplied by the number of perspectives to test them from. A rough model helps you sanity check quotes:
# estimate_effort.py: rough tester-days from scope size (planning aid only)
def estimate_days(rest_ops, gql_ops, roles, tenants, integrations, cloud_accounts):
perspectives = roles * min(tenants, 2)
api_days = (rest_ops + gql_ops) * perspectives / 220
integration_days = integrations * 0.75
cloud_days = cloud_accounts * 2
reporting_days = 1.5
return round(api_days + integration_days + cloud_days + reporting_days, 1)
print(estimate_days(rest_ops=142, gql_ops=65, roles=5, tenants=2,
integrations=3, cloud_accounts=2))
[cta]
The constants are illustrative, not industry standards. The point is directional: doubling roles or adding a second tenant meaningfully increases effort, while adding marketing pages barely changes it. If two quotes for the same scope differ by a factor of five, ask each provider how many tester-days they have allocated.
For reference, these are Redfox Cybersecurity's published starting prices and the scope each one assumes:
Every package includes immediate notification of critical findings, an executive summary, a technical report, a readout call, and a free retest. Final pricing depends on scoping, which is exactly why the measurements above are worth doing first.
Different drivers need different coverage. Scope to the strictest one you face this year so a single engagement serves all of them:
Redfox Cybersecurity maps scope and findings to each of these, through dedicated SOC 2, PCI DSS, ISO 27001, and HIPAA testing, so the report does not need translating for your auditor.
/v1/ routes left out of scope.A good scoping call with a provider takes about 30 minutes and should feel like an interview about your architecture. Expect questions such as:
If a provider quotes you without asking questions like these, the quote is based on assumptions rather than your product. Redfox Cybersecurity's scoping process is built around these questions and typically takes about two weeks from first call to the start of testing, including access setup.
A strong penetration testing scope is the cheapest way to improve the results of a pentest. It focuses tester time on tenant boundaries, role boundaries, APIs, integrations, and cloud identity, which is where SaaS risk actually lives, and it turns vague quotes into comparable ones.
Start with the template above. Measure your API operations, external assets, and cloud accounts from the source rather than from memory. Separate your infrastructure from third-party services, document your role matrix, provide two seeded tenants, and hand over credentials encrypted. Then scope to your strictest compliance driver so one engagement covers the year.
When your scope file is ready, or if you would rather build it together, book a free 30-minute scope review with Redfox Cybersecurity and get a fixed quote within 24 hours.