Skip to content
Tutorials Center
My learning

Topics

Lesson 2 of 53 ยท Foundations and Ethics

Law, Scope and Rules of Engagement

Learn why written authorization matters, how computer misuse laws work in general terms, what a scope document contains, and the rules of bug bounty programs.

The most important skill in ethical hacking is not technical. It is knowing when you are allowed to act. Two people can type exactly the same commands; one is doing their job and the other is committing a crime. What separates them is a document, a set of boundaries, and the discipline to respect both.

This lesson explains the legal ideas in general terms, what a proper authorization contains, how scope is written down, and how bug bounty programs work. It is education, not legal advice: laws differ by country and change over time, and a real engagement should always be reviewed by a lawyer.

Before any test starts

Authorization Signed by someone who can grant it.
Scope Exact systems, dates and methods.
Rules What is forbidden, who to call.
Safe harbor Protection when you follow the rules.

If any of the four is missing, do not start.

1 / 2

What the law generally says

Almost every country has laws against unauthorized access to computer systems, against damaging data or services, and against intercepting communications. Examples you may have heard of include the Computer Fraud and Abuse Act in the United States, the Computer Misuse Act in the United Kingdom, and the Budapest Convention that many countries use as a model. The details differ, but several themes repeat:

  • Authorization is the key word. Access "without authorization" or "exceeding authorized access" is the core offence. Technical barriers like a password make it obvious, but even an open door is not an invitation.
  • Intent often does not excuse. Testing without permission "to help" is usually still unauthorized.
  • Damage and disruption are separate offences. Crashing a service, even by accident, can be treated as its own harm.
  • Tools and data matter too. Possessing or distributing certain tools with intent to commit offences, and accessing personal data, can bring additional liability under privacy laws.
  • Jurisdiction is messy. The tester, the server and the owner may be in three different countries, and each may have its own rules.

This is not legal advice. The statements above are general patterns. Before testing anything for money, have a lawyer review the contract. For learning, use only your own lab and platforms built for practice.

Written authorization

A professional engagement starts with a contract and a signed authorization letter (sometimes called a "get out of jail free" letter, though it protects only if it is correct). Verbal permission is not enough: in a dispute, only paper counts. A good authorization states:

  • Who is granting permission and that they have the authority to do so for every system involved.
  • Who is being authorized (named people or company).
  • What may be tested (the scope) and what may not.
  • When: start and end dates, and allowed hours.
  • How: permitted techniques and forbidden ones.
  • Contacts: an emergency number at the client and the tester's own contact.

The owner problem

You can only authorize testing of what you own or control. A company can approve a test of its own servers, but not of the cloud provider's infrastructure beneath them, a payment processor's API it calls, or a partner's network. Cloud providers publish their own testing policies, and some activities need separate approval. The same applies to a company's employees: phishing tests need explicit approval and usually involve HR and legal.

The scope document

The scope lists exactly what is in and out. Vague scope is dangerous for both sides, so it is written precisely:

Part Example
In scope app.example.test, the network 10.20.0.0/24
Out of scope production payment servers, third-party services, the CEO's laptop
Allowed methods scanning, authenticated web testing, password policy checks
Forbidden methods denial of service, destroying data, social engineering of staff
Window weekdays 22:00 to 06:00 local time
Data handling do not copy real customer data; stop and report if you see it

Notice the use of example.test and a private network range here: the course uses reserved and private names so that no example ever points at a real third party.

The rules of engagement add the operational details: how to report a critical finding immediately, what to do if you accidentally access something out of scope (stop, record it, tell the client), and how to stop everything if the client asks. Treat a "stop" request as absolute.

What you never touch

Even inside a valid engagement, some things need extra care or are normally excluded:

  • Real personal data, health records and payment card numbers beyond the minimum needed to prove a flaw.
  • Systems that keep people safe (medical, industrial, vehicles) unless that is the explicit, carefully planned goal.
  • Other tenants on shared infrastructure.
  • Anything that causes denial of service, unless specifically agreed and scheduled.
  • Everything outside the scope list, even if it is "obviously connected".
flowchart TD
    A["Found a new system<br/>during testing"] --> B{"On the<br/>scope list?"}
    B -- Yes --> C["Test within the<br/>allowed methods"]
    B -- No --> D["Stop. Note it.<br/>Ask the client in writing"]
    D --> E{"Scope updated<br/>in writing?"}
    E -- Yes --> C
    E -- No --> F["Leave it alone"]

The rule is simple: a new target is out of scope until the paper says otherwise.

Bug bounty programs and safe harbor

Not every researcher can sign a contract with every company, so many organizations publish a bug bounty or vulnerability disclosure program. It is an open invitation, with published rules, to test certain assets and report what you find. Good programs include:

  • A clear list of in-scope assets and a list of exclusions.
  • Rules such as "no denial of service, no accessing other users' data, no social engineering".
  • A safe harbor statement: the company promises not to pursue legal action against researchers who follow the rules in good faith.
  • Reward information and how reports are triaged.

Safe harbor is only as good as the wording, and it covers the company's own claims, not necessarily other parties or every legal system. Read the full policy before you test, test only listed assets, use your own accounts for proof, and stop as soon as you have shown the issue exists. Do not demand payment under threat; that crosses into extortion. Report privately and give the company reasonable time to fix before discussing anything publicly. This is called coordinated disclosure.

Some sites publish a plain-text file at /.well-known/security.txt telling researchers where to report a vulnerability. Its presence is a useful sign, but it is not the same as an invitation to test; read the policy it links to.

Stand-in: checking targets against the scope

Real testing tools do not know your contract. Professional testers build a habit (and often a script) that checks every target against the written scope before anything runs. The model below checks hostnames and IPv4 addresses against an in-scope list, with explicit exclusions that always win. It is a model of the discipline, not a security product.

JS Scope checker: is this target allowed?

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Two design choices are worth copying. First, exclusions win over inclusions, so a sensitive server inside an allowed network stays protected. Second, the default answer is OUT: anything the list does not mention is not allowed. A tool that defaults to "allowed" would eventually test something it should not.

Stand-in: an engagement window

Authorization is also limited in time. Testing at 14:00 on a production system when the contract says nights only is a breach, even against an in-scope server. This second model checks a timestamp against the allowed window.

JS Is the test window open?

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The date comparison works because ISO dates sort alphabetically. A real plan would also record the time zone, since "22:00" means different instants in different places. Many incidents during tests start with exactly that misunderstanding.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A friend who runs a small shop says verbally, "Sure, go ahead and test my website." Their site is hosted on a shared cloud platform. What is the best next step?

    Verbal permission is weak evidence, and the owner of the site cannot authorize testing of the shared infrastructure underneath it.
  2. 2. In a scope document, an IP address is inside an in-scope network but is also listed as excluded. What do you do?

    Exclusions always win. The client listed that system on purpose, usually because it is fragile or sensitive.
  3. 3. What is a safe harbor clause in a bug bounty policy?

    Safe harbor protects good-faith researchers who stay inside the policy. It does not remove the need to read and follow the rules.
  4. 4. You accidentally reach a server that is not on the scope list during a test. What is the right response?

    Stopping and reporting honestly is the professional response. Continuing turns an accident into unauthorized access.

Summary

  • Computer misuse laws center on authorization; intent rarely excuses unauthorized access.
  • Always get written authorization from someone with the authority to grant it for every system involved.
  • A scope document lists targets, exclusions, methods, time windows and data handling rules.
  • Anything not listed is out of scope, exclusions override inclusions, and "stop" means stop.
  • Bug bounty and disclosure programs give legal permission only for what their published rules cover; read them first and use coordinated disclosure.
  • Build scope checks into your habits and tools, defaulting to "not allowed".

Next: Thinking Like an Attacker: Threat Modeling.