SECURITY ENGINEERING · PART 5 · ETHICAL HACKING, STEP BY STEP · PROCESS · 59 OF 229

Pentest Scope and Rules of Engagement Explained

Before any security test, three documents decide whether it is legal, safe and useful: the scope, the rules of engagement and the authorisation letter. This episode covers what each must contain, cloud provider testing policies, third parties you cannot authorise for, what to do when you find real attacker activity or sensitive data, safe harbour in bug bounties, and the same rules seen from the company side.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 9
  9. 10
  10. 11
  11. 12
  12. 13
  13. 14
  14. 15
  15. 16
  16. 17
  17. 18
  18. 19
  19. 20
  20. 21
  21. 22
  22. 23
  23. 24
  24. 25
  25. 26
  26. 27
  27. 28
  28. 29
  29. 30
  30. 31
  31. 32
  32. 33
  33. 34
  34. 35
  35. 36
  36. 37
  37. 38
  38. 39
  39. 40
  40. 41
  41. 42
  42. 43
  43. 44
  44. 45
  45. 46
  46. 47
  47. 48
  48. 49
  49. 50
  50. 51
  51. 52
  52. 53
  53. 54
  54. 55
  55. 56
  56. 57
  57. 58
  58. 59
  59. 60
  60. 61
  61. 62
  62. 63
  63. 64
  64. 106
  65. 107
  66. 108
  67. 109
  68. 110
  69. 111
  70. 112
  71. 113
  72. 114
  73. 115
  74. 116
  75. 117
  76. 118
  77. 119
  78. 120
  79. 121
  80. 122
  81. 123
  82. 124
  83. 125
  84. 126
  85. 127
  86. 128
  87. 129
  88. 130
  89. 131
  90. 132
  91. 133
  92. 134
  93. 135
  94. 136
  95. 137
  96. 138
  97. 139
  98. 140
  99. 141
  100. 142
  101. 143
  102. 144
1 / 14

Press play to hear the narration, or step through at your own pace.

Key takeaways

  • Written permission from the real owner
  • an exact scope
  • agreed methods and hours
  • stop conditions

Notes

Why it matters

Almost every country has a law against accessing computers without authorisation: the Computer Fraud and Abuse Act in the United States, the Computer Misuse Act in the United Kingdom, the IT Act in India, and similar laws across Europe. Good intent is not a defence, and neither is finding a real problem. Permission must be in writing, and it must come from someone who actually has the authority to give it, not from a friendly developer.

The legal ground
  • US: Computer Fraud and Abuse Act
  • UK: Computer Misuse Act
  • India: IT Act, sections 43 and 66
  • EU: national laws under the cybercrime directive
  • "I was only testing" is not a defence
  • permission must come from someone able to give it

Scope

The scope is an exact list. Domains and subdomains. Address ranges, written out precisely. Applications and API hosts. Cloud accounts or projects. The test accounts and roles you are given. Which environment: production or staging. And explicit exclusions, such as the payment provider, a fragile legacy system or a database that must not be touched. If you find something that looks related but is not on the list, you stop and ask. You never assume.

A scope lists
  • domains and subdomains
  • IP ranges, by exact address
  • applications and API hosts
  • cloud accounts or projects
  • test accounts and roles given
  • environment: production or staging
  • explicit exclusions: payment provider, legacy system, a fragile database
  • when unsure: ask, do not test

Third parties

A client can only authorise testing of what they own. They cannot give you permission to attack the software services they subscribe to, a shared hosting platform, a content delivery network, their payment provider or other customers on the same platform. In the cloud, the major providers allow you to test your own resources under a published policy, usually without notice, but never denial of service and never the platform itself. Read each provider's policy before you start.

Not theirs to authorise
  • SaaS products they use: mail, CRM, helpdesk
  • shared hosting and CDNs
  • payment and identity providers
  • other tenants on a platform
  • cloud: you may test your own resources under the provider policy; no DoS, no attacks on the platform
  • check each provider's rules

Rules of engagement

The rules of engagement describe how the test is run. The dates and hours. The source addresses the testers will use, so defenders can tell the test from a real attack. Which techniques are allowed, and which are forbidden: typically denial of service, social engineering, physical access and changing data, unless specifically agreed. Rate limits for scanning. Whether the defence team is told in advance. And how findings are reported while the test is running.

The RoE covers
  • dates and testing hours
  • source IP addresses used
  • allowed: scanning, exploiting, password attacks?
  • forbidden: denial of service, social engineering, physical, data changes
  • rate limits for scans
  • is the defence team told?
  • how findings are reported during the test

The letter

The authorisation letter is the single most important document. It names who is giving permission, with their role and signature. It names who is authorised. It refers to the scope and gives the start and end dates. It lists emergency phone numbers. Every tester keeps a copy for the whole engagement, and on physical tests carries it in a pocket. There are real cases of testers arrested during authorised work because the paperwork was unclear. No letter, no testing.

Authorisation letter
  • who authorises: name, role, signature
  • who is authorised: tester names and company
  • what: the scope, by reference
  • when: start and end dates
  • emergency phone numbers
  • kept by every tester for the whole engagement
  • no letter, no testing

Stop conditions

Agree stop conditions in advance. If a service becomes unstable, you stop and call. If you find evidence that a real attacker is already inside, you stop and report, because that is now an incident, not a test. A critical weakness exposed to the internet is reported the same day, not three weeks later in the report. The same goes for illegal content, a target that turns out not to belong to the client, and regulated data such as health or card records.

Stop and report at once
  • a service becomes unstable or goes down evidence of a real attacker already inside
  • a critical finding exposed to the internet
  • illegal content
  • you realise a target is not the client's
  • you reach regulated data: health, cards, children

Handling data

During a test you will see things you should not. The rule is: prove access, do not collect. Show a row count, a redacted screenshot or a single test record. Never copy real customer data off the system. Keep your notes and evidence encrypted. Passwords you find are reported, and never tried on systems outside the scope. Evidence is deleted on an agreed date. A non-disclosure agreement covers the rest. Your trustworthiness is the service you are selling.

Data rules
  • prove access with the minimum: a row count, a redacted screenshot, one test record
  • never copy real customer data off the system
  • encrypt your notes and evidence
  • passwords found: report, do not reuse outside scope
  • delete evidence on the agreed date; sign an NDA

Bug bounty rules

Bug bounty programmes work the same way, with a public document. The programme page is the scope and the rules. A safe harbour statement is the company's promise not to take legal action against researchers who follow them. A security dot txt file on a website tells you where to report. If a company has no programme and no disclosure policy, you have no permission. And never ask for money in exchange for details of a finding. That is extortion, not research.

Policy and safe harbour
  • the programme page IS the scope and the rules
  • safe harbour: the company promises not to take legal action if you follow them
  • security.txt: where to report
  • no programme and no policy means no permission
  • never demand payment for a finding: that is extortion

From the company side

As a security engineer you will usually be on the other side, writing the scope. Start with the goal: what are you actually worried about? Include what matters, not only what is easy to test. Give the testers accounts and documentation, because grey box testing finds more. Prepare: backups verified, contacts available, monitoring on. Decide whether the operations centre knows. And reserve engineering time for fixes before the report arrives, or the report will sit unread.

Commissioning a test
  • define the goal first: what are you worried about?
  • include what matters, not only what is easy
  • give access and docs: grey box finds more prepare: backups, contacts, monitoring on decide whether the SOC knows
  • plan the fix time before the report arrives

A scope checklist

Here is a checklist of ten questions to answer before the first packet is sent. Who signed, and do they have the authority? What are the exact targets and exclusions? Have third parties and cloud policies been checked? Dates, hours and source addresses? Allowed and banned methods? Which accounts are provided? Who are the emergency contacts? How is data handled? How are findings reported, and when do we stop? And is a retest included?

Before you start
  1. who signed, and can they?
  2. exact targets and exclusions
  3. third parties and cloud policies checked
  4. dates, hours, source IPs
  5. allowed and banned methods
  6. accounts provided
  7. emergency contacts
  8. data handling and NDA
  9. reporting and stop rules
  10. retest included?

Common mistakes

Mistakes. Verbal permission only. Permission from someone who has no authority to give it. A scope that says the whole company. Testing a similar-looking domain that turns out to belong to someone else. Scanning systems that belong to a cloud or software provider. Continuing after the end date because you were close to something. Keeping client data afterwards. And holding a critical finding back for the final report instead of phoning the same day.

Avoid these
  • verbal permission only
  • permission from someone without authority
  • "the whole company" as scope
  • testing a look-alike domain that is not the client's
  • scanning a cloud or SaaS provider's systems
  • continuing after the end date
  • keeping client data
  • reporting a critical late

Say it like this

In the interview: before anything, written authorisation from someone with the authority to give it, an exact scope with explicit exclusions, and rules of engagement covering dates, hours, allowed techniques, source addresses, emergency contacts and stop conditions. I confirm third-party and cloud provider policies, because the client cannot authorise those. And I agree in advance how sensitive data is handled and that critical findings are reported immediately.

In the interview
  • "Written authorisation from someone with authority, an exact scope with exclusions, and rules of engagement: dates, methods, source IPs, contacts and stop conditions.
  • I check third-party and cloud
  • policies, and agree how data
  • and criticals are handled."

Interview questions

Q1What are rules of engagement in penetration testing?

A document agreed before testing that defines how the test will be conducted: dates and hours, permitted and prohibited techniques, source IP addresses, communication and escalation contacts, data handling requirements and conditions under which testing must stop.

Q2What is the scope of a penetration test?

The precise list of systems, networks, applications, accounts and environments that may be tested, together with explicit exclusions. Anything not listed is out of scope and must not be tested without further written agreement.

Q3What is a penetration testing authorisation letter?

A signed document from a person with authority over the target systems that grants named testers permission to test a defined scope during defined dates. It is the legal basis of the engagement and is sometimes called a "get out of jail free" letter.

Q4Do you need permission to pentest cloud resources?

You need the resource owner's authorisation, and you must follow the cloud provider's testing policy. AWS, Azure and Google Cloud allow testing of your own resources for most services without prior approval, but prohibit denial-of-service and attacks on the underlying platform or other tenants.

Q5What should a tester do if they find evidence of a real breach?

Stop testing in the affected area, preserve what was observed, and notify the client's emergency contact immediately. The situation becomes an incident response matter, and continued testing could destroy evidence or be confused with the attacker's activity.

Q6What is safe harbour in a bug bounty programme?

A statement in a vulnerability disclosure or bug bounty policy that the organisation authorises good-faith research within the policy and will not pursue legal action against researchers who comply with it.

Q7What is out of scope in most penetration tests?

Commonly denial-of-service attacks, social engineering and physical intrusion unless specifically agreed, third-party services and infrastructure the client does not own, destructive actions, and access to or exfiltration of real personal data beyond minimal proof.

Q8Is scanning a website without permission illegal?

It can be. Laws vary, but active scanning and probing of systems you do not own or have permission to test may breach computer misuse laws and service terms. Practice only on your own systems, deliberately vulnerable labs or programmes that authorise it.