Skip to content

Blacklisting domains in mobile scans

This guide walks through excluding domains from mobile scans by configuring the scan scope.

Mobile scans use Scope URLs regexes to define which domains or URLs are considered in scope. To blacklist or exclude a domain, provide a regular expression that matches the URLs you want to keep in scope and does not match the domain you want to exclude.

Go to report.ostorlab.co

1. Click "New Scan"

Click the New Scan icon in the top bar.

Click New Scan

2. Select the asset type

Choose where the app comes from, for example PlayStore, AppStore, Android App or iOS App (a file you upload), or iOS TestFlight. For this example, we'll select PlayStore.

Select the asset type

3. Select the application

Search for the app by its name or package name, then pick it from the results and click Continue. The Extra Context step that follows is optional; click Continue again to skip it.

Select the application

4. Choose a scan profile

Select a scan profile, for example Full Scan, then click Continue.

Choose a scan profile

5. Add test credentials (optional)

Add test credentials if the app needs a login, or click Continue to skip this step.

Test credentials

6. Provide the domain exclusion regex

Open Advanced Settings. In Scope URLs regexes, enter a regular expression that excludes the domain from the scan scope.

For example, to exclude example.com and its subdomains, add the following regex:

^https?://(?!(?:[^/?#:]+\.)?example\.com(?::\d+)?(?:[/?#]|$)).*

This keeps example.com, www.example.com, api.example.com, and other example.com subdomains out of scope for the scan.

Provide the domain exclusion regex

Regex examples

Exclude example.com and all its subdomains:

^https?://(?!(?:[^/?#:]+\.)?example\.com(?::\d+)?(?:[/?#]|$)).*

Exclude only the root domain example.com, while allowing subdomains:

^https?://(?!example\.com(?::\d+)?(?:[/?#]|$)).*

Exclude only one subdomain, such as staging.example.com:

^https?://(?!staging\.example\.com(?::\d+)?(?:[/?#]|$)).*

Exclude multiple domains, such as example.com and test.example.org:

^https?://(?!(?:(?:[^/?#:]+\.)?example\.com|(?:[^/?#:]+\.)?test\.example\.org)(?::\d+)?(?:[/?#]|$)).*

Allow only trusted production domains, which is often simpler than using blacklist-style regexes:

^https?://api\.example\.com(?::\d+)?(?:[/?#]|$).*
^https?://auth\.example\.com(?::\d+)?(?:[/?#]|$).*

When adding multiple lines, each line is treated as a scope regex. Direct allowlist examples can be entered one per line. Blacklist-style exclusions should be written as a single regex that excludes the domain from the matched scope.

7. Click "Start scan"

Click Start scan in the summary panel on the right to create the scan. The remaining steps (Prompts, Custom Checks, Tags and Execution window) are optional.

Click Start scan

8. Scan created confirmation

The scan's page opens with a Scan created message. To monitor the scan's progress in the scans list, click the Scans icon in the top bar.

Scan created confirmation

9. List of scans

The scan is listed in the scans table. It is queued first, then runs.

List of scans

This guide walked through excluding domains from mobile scans using Scope URLs regexes.