Platform

Platform overview How it works Authorization testing Evidence & reports Private scanning Integrations

Solutions

Security agencies Product teams Regulated industries Partner programme

Learn

Blog Knowledge hub Compare

Resources

Pricing Documentation Help centre FAQ Security & data What we haven’t proved

Company

About Contact Careers Sign in to the platform Start a $199 pilot →

Home / Blog / Tutorials / Focus and avoid rules

Tutorials

How to set focus and avoid rules on a scan profile

Focus rules point a scan at what matters; avoid rules keep it away from what must not be touched. This guide covers all seven rule types with examples.

Cyberlop Labs · Updated · 9 min read

Illustration for How to set focus and avoid rules on a scan profile
Quick answer

Focus and avoid rules narrow what a Cyberlop scan tests. On the Scope section of a scan profile, click + Add rule, add a Description, pick a Type (Url Path, Subdomain, Domain, Method, Header, Parameter or Code Path), enter a Value and Save. Focus points the scan at an area; avoid keeps it out.

Quick how-to
  1. Open the profile Click Scan Profiles, then + New profile, or the pencil icon to edit one.
  2. Go to Scope rules On the Scope section, scroll to Scope rules.
  3. Add a rule Click + Add rule under Focus rules or Avoid rules.
  4. Describe it Type a Description that says why the rule exists.
  5. Choose the type Pick Url Path, Subdomain, Domain, Method, Header, Parameter or Code Path.
  6. Enter the value Type the path, host, method, header, parameter or code path.
  7. Preview and save Click Preview YAML to validate and read the rules back, then click Save.
  8. Check the result Run the scan and compare the Sitemap tab with what you meant to include or skip.
Key takeaways
  • Focus rules say where to concentrate; avoid rules say where not to go.
  • Each rule has a Description, one of seven Types and a Value.
  • Rules are optional: with none, the scan covers its target's URLs.
  • Treat avoid rules as a second layer; prefer a non-production copy of the app.
  • Check the Sitemap tab after a run to confirm coverage matched your intent.

Focus and avoid rules are the scope rules on a Cyberlop scan profile. To add one, open the Scope section, click + Add rule under Focus rules or Avoid rules, write a Description, choose a Type (Url Path, Subdomain, Domain, Method, Header, Parameter or Code Path), enter a Value and click Save. A focus rule points the scan at something; an avoid rule keeps it away.

What are focus and avoid rules?

Focus and avoid rules are optional lines on a scan profile that narrow what a scan looks at. A focus rule names an area the scan should concentrate on. An avoid rule names an area it should stay out of. Both live under Scope rules, at the bottom of the Scope section, and both start empty: the form shows "No rules." until you add one.

They answer the same question a human tester asks before starting: what is in scope, and what is off limits? In security testing this is called the pentest scope, and the limits you agree sit alongside your rules of engagement. NIST's SP 800-115 is a guide to planning and conducting technical security tests, and the agreed limits of a test belong in that planning.

Table 1. Focus rules and avoid rules side by side

Focus ruleAvoid rule
IntentSpend the scan's effort here.Keep the scan away from here.
Typical useA new checkout flow, an API version, a billing module.Logout, account deletion, payment callbacks, a third-party host.
Without itThe scan covers the target's URLs as a whole.Nothing is excluded by rule.
Where you set itScope section, Focus rules.Scope section, Avoid rules.

Neither kind is required. A profile with no rules scans its target's URLs, which you set on the target, not on the profile.

How do you add a focus or avoid rule?

Rules are part of the profile form, so they are saved with the profile and you can add as many as you need. You do not need to run anything first.

Scope rules area of the new profile form with an empty focus rule row showing description, type and value
A rule row: Description, Type and Value. 1 + Add rule: Add a focus rule for this scan. 2 Rule type: Choose Url Path or another type. 3 Save: Save the profile when done.. Sensitive details are blurred.
  1. Open Scan Profiles, then click + New profile. To change an existing profile, click the pencil icon on its row.
  2. Stay on the Scope section and scroll to Scope rules.
  3. Under Focus rules or Avoid rules, click + Add rule. A row appears.
  4. Type a Description in plain words, for example Checkout is the release risk.
  5. Choose the Type from the select.
  6. Enter the Value.
  7. Repeat for each rule. Use the trash icon at the end of a row to remove one.
  8. Click Preview YAML to validate the form and read the generated configuration.
  9. Click Save.
Four steps: pick focus or avoid, choose a type, enter a value, preview and check the sitemap
From a goal to a checked rule.

What do the three boxes in a rule row mean?

Table 2. Fields in a rule row

FieldWhat to enterNotes
DescriptionA short reason a colleague will understand in six months.Free text. It is for people, so say why, not just what.
TypeOne of Url Path, Subdomain, Domain, Method, Header, Parameter or Code Path.Decides what the Value is compared against. See the next section.
ValueThe path, host, method, header name, parameter name or code path itself.Keep it as simple as the app writes it. Preview YAML shows exactly what will be saved.
Trash iconRemoves the row.Nothing is stored until you click Save.

The form does not say whether a value is matched literally or as a pattern. Start with plain values such as /checkout and check the result in Preview YAML before trying anything cleverer.

Which rule type should you use?

The Type select offers seven choices. They fall into three families: where in the web app, what kind of request, and where in the code.

Url Path, Subdomain and Domain: where in the app

Url Path

Use this for a part of one site, such as /checkout or /api/orders. It is the type you will use most, because most scope decisions are about areas of the same application.

Subdomain

Use this when one team owns api or admin and another owns the rest. Focus on the subdomain you are releasing, or avoid one that belongs to a different team.

Domain

Use this to name a whole host. It is the natural way to avoid a payment provider's or an analytics vendor's domain that your pages call. Only test hosts you own or are authorised to test.

Method, Header and Parameter: what kind of request

Method

Use this to steer by HTTP method. RFC 9110, section 9.2.1 calls methods "safe" when their defined semantics are essentially read-only, and lists GET, HEAD, OPTIONS and TRACE among them. An avoid rule on DELETE is a common first rule for a shared environment.

Header

Use this when a request header changes behaviour, for example a debug or tenant header. Name the header, not its value.

Parameter

Use this to concentrate on, or leave alone, a named input such as redirect_url or coupon. Focus rules on parameters suit a release that changed one input.

Code Path: where in the repository

Code Path relates to your source tree, so it matters for white-box targets, where Cyberlop reads a repository. A value such as src/billing/ points the analysis at one module. A black-box target has no repository, so a Code Path rule has nothing to match there.

Table 3. The seven rule types at a glance

TypeExample valueGood forWatch out for
Url Path/checkoutNarrowing to one flow, or skipping oneToo broad a path hides pages beneath it
SubdomainapiTeam or service boundariesMatch how your DNS actually names it
Domainpayments.example.comThird-party hosts you must not touchOnly hosts you are authorised to test belong in scope
MethodDELETESkipping state-changing requestsSome apps change state on GET, so check the app
HeaderX-DebugBehaviour switched by a headerName only, not the secret value
Parameterredirect_urlConcentrating on one inputThe same name may appear on many pages
Code Pathsrc/billing/White-box focus on one moduleNo effect without a repository

What do good focus and avoid rules look like?

Start from the goal, then pick the smallest rule that expresses it. The examples use neutral names; swap in your own paths and hosts.

Table 4. Goals and the rules that express them

GoalKindTypeValue
Test only the new checkout before releaseFocusUrl Path/checkout
Concentrate on the orders APIFocusUrl Path/api/orders
Do not touch the sign-out flow, so a long scan keeps its sessionAvoidUrl Path/logout
Do not send deletes to a shared staging appAvoidMethodDELETE
Leave a payment provider aloneAvoidDomainpayments.example.com
Review the billing module of a repositoryFocusCode Pathsrc/billing/
Probe one redirect input hardFocusParameterredirect_url

Keep a Description on every row. "Avoid: sign-out ends the test session" is more useful in an audit than a bare path.

How do rules fit with the rest of the profile?

Rules are one of four scope controls, and they work best when each does its own job.

  • The target sets the URLs. Rules narrow within them; they do not add new hosts.
  • Vulnerability classes choose what kinds of problem to look for. Rules choose where. See choosing vulnerability classes.
  • Run exploitation phase decides whether findings are proved against the live app. See the exploitation phase guide.
  • Rules of engagement on the Reporting section is free text for limits that a rule type cannot express, such as "avoid destructive payloads in prod". See reporting rules.
New scan profile Scope section with target, name, tags, vulnerability classes, exploitation and scan location
Rules sit at the bottom of the Scope section. 1 Name: Give the profile a clear name. 2 Vulnerability classes: Tick classes to limit; blank scans all. 3 Scan location: Cyberlop cloud or an internal agent.. Sensitive details are blurred.

If the app sits behind a login, remember that rules and roles combine: a focus rule on /admin is only useful if a role can reach it. See authentication roles.

Should you use avoid rules on production?

Prefer a non-production copy of the app, and treat avoid rules as a second layer, not the first. Exploitation sends real requests, and the form does not say how strictly an avoid rule is enforced. A test environment keeps real customers out of the blast radius whatever the rules say.

If production is unavoidable, combine three things: avoid rules for sign-out, deletion and payment paths; the Rules of engagement text; and a profile that you have reviewed in Preview YAML. Always test only what you own or are authorised to test.

Why focus at all?

Because the same few weakness classes turn up again and again. OWASP's 2021 Top 10 reports that 94% of applications were tested for some form of broken access control, and the same share for some form of injection, with 274,228 occurrences recorded. For security misconfiguration the figure is 90%. A focus rule on the paths that accept input or hold other people's data points the scan at those classes first. Narrowing also shrinks the attack surface a run has to cover, and it follows least privilege: give the scan only the reach it needs.

Bar chart: 94% tested for broken access control, 94% for injection, 90% for security misconfiguration
OWASP Top 10 2021 data: where focus rules earn their keep. Source: OWASP: Top 10 2021.

OWASP also advises, for server-side request forgery, to allow only approved URL schemes, ports and destinations, using a positive allow list. The same idea applies to scope: a short list of what is in bounds is easier to defend than a long list of exceptions. It is the thinking behind an allowlist and deny by default.

How do you check that your rules worked?

Run the profile, then read the result against your intent. Rules are easy to write and easy to get slightly wrong, so check them once.

Scan Sitemap tab listing discovered endpoints grouped by host with method badges, notes and role chips
The Sitemap tab shows what the scan reached. 1 Sitemap (118): Open endpoints found during the scan. 2 Filter by URL or method: Type to narrow discovered endpoints. 3 Export CSV: Download the endpoint list.. Sensitive details are blurred.
  1. Click Preview YAML before saving and read the rules back.
  2. Click ▷ Scan on the profile. See run a scan.
  3. Open the scan and go to the Sitemap tab. Endpoints are grouped by host, with method badges.
  4. Check that areas you focused on appear and that areas you avoided do not.
  5. Open the Diff tab on a later scan to see what changed. See compare scans.

The sitemap guide explains how to read coverage in more detail.

What are the common mistakes with scope rules?

Rules that cut too much

An avoid rule on a very short path

Avoiding /a may hide /api and /account if values match by prefix. The form does not state how values match, so prefer full paths and check the sitemap.

A focus rule that is too narrow

Focus on one path and the scan may find little elsewhere, which can look like a clean result. Treat a focused profile as a release check, and keep a broader profile for regular runs.

Rules that never match

The wrong type

A path typed into a Domain rule, or a host typed into Url Path, matches nothing. If the sitemap ignores a rule, check the type first.

Code Path on a black-box target

With no repository there is no code to match. Use a Url Path rule instead.

Putting secrets in a description

The Description is plain text on the profile. Keep passwords, tokens and keys in Authentication, where stored secrets are never shown again.

Troubleshooting checklist

Table 5. Symptom, likely cause, fix

SymptomLikely causeFix
The scan finds far less than expectedAn avoid rule is too broad, or a focus rule too narrowReview each rule, then compare the Sitemap with your expectation
An avoided path still shows in the sitemapWrong type, or the value does not match how the app writes itCheck the Type and use Preview YAML to read the value back
A focus area never appearsNo role can reach itAdd a role with enough privilege on Authentication
Preview YAML shows an errorA required field is empty, for example the profile nameFill the field named in the red message and preview again
You need to change a rule laterRules are part of the profileEdit the profile and click Save. See edit a scan profile

What should you do next?

Write your limits down in Rules of engagement with the reporting rules guide. Then give the app a context description so the scan understands your business flows: application context. If you are new to the vocabulary, the key terms guide sets out the words used here. The white-box testing entry explains why a code path rule can help when the scan also reads your repository.

Questions people ask

Focus and avoid rules: FAQs

How do I add a focus or avoid rule in Cyberlop?

Open a scan profile, go to Scope, find Scope rules and click + Add rule under Focus rules or Avoid rules. Enter a Description, choose a Type, type the Value and click Save.

What is the difference between a focus rule and an avoid rule?

A focus rule names an area the scan should concentrate on. An avoid rule names an area it should stay away from. Both use the same fields: Description, Type and Value.

What rule types are available?

Url Path, Subdomain, Domain, Method, Header, Parameter and Code Path. Url Path is the most common. Code Path relates to your repository, so it suits white-box targets.

Are rules required on a scan profile?

No. Both lists start empty and show "No rules." Without rules the scan covers its target's URLs. The URLs themselves are set on the target, not on the profile.

Can I rely on an avoid rule to protect production?

Not on its own. The form does not say how strictly an avoid rule is enforced. Prefer a non-production copy, and add limits in Rules of engagement on the Reporting section.

How can I check my rules did what I meant?

Click Preview YAML before saving, then run the profile and open the Sitemap tab of the scan. Areas you focused on should appear, and areas you avoided should not.

Can I change rules after saving a profile?

Yes. Open the profile with the pencil icon, edit the rows under Scope rules and click Save. The profile's target stays fixed, but its rules can change.

Cyberlop mark

Want help scoping your first scan?

Cyberlop reads your code while testing the running app and reports only what it exploited, with the request, the response and the line of code. Ask us to run it on one of your applications.

Or start with a $199 pilot on one application: thirty days, success criteria agreed before day one, credited against the annual if you convert.