Blocking and filtering with the whitelist and blacklist

Use the whitelist and blacklist to determine which resources to send requests to and which resources contribute to the metrics and status of your application tests. Whitelists and blacklists are only available for webpage and scripted behavior tests.

The Whitelist and Blacklist fields define the resources that your test can or cannot access and the resources that contribute to the metrics and status of your tests. The Whitelist and Blacklist control which dependencies and resources contribute to the response times of your tested web applications, such as third-party metrics. You can configure your Whitelist and Blacklist when you create a webpage or scripted behavior test.

You can use the Whitelist to define allowed domains and URLs; then, use the Blacklist to block specific elements of your allowed locations.

Syntax

Use commas (,) to separate items in the Blacklist and Whitelist. Use the wildcard symbol (*) to filter elements of each URL or domain.

Whitelist

Add URLs, schemes, or domains that you want to include in request and metric calculations to the Whitelist field. You can list up to 10 items in your Whitelist. Each item length cannot exceed 200 characters. All domains, schemes, and URLs that do not match the items on your Whitelist are blocked.

For example: ibm.com, *developerworks*, *.s81c.com/*, https://www.ibm.com*, https://*

Note: If your Whitelist URL filter includes http:// or https://, you must include the wildcard symbol (*) directly after the URL, for example, https://www.ibm.com*.

Blacklist

Add URLs, schemes, or domains that you want to block from requests and metric calculations to the Blacklist field. You can list up to 20 items in your Blacklist. Each item length cannot exceed 200 characters.

For example: *.profile.*.cloudfront.net/*.png, http://*

Note: If your Blacklist URL filter includes http:// or https://, you must include the wildcard symbol (*) directly after the URL, for example, https://www.ibm.com*.

Filtering and blocking behavior

Tests can have both a Whitelist and a Blacklist. When determining which locations are allowed or blocked, the Blacklist always overrides the Whitelist. The following table displays filtering and blocking behavior for all scenarios involving the Whitelist and Blacklist.

Table 1. Filtering and blocking behavior for the Whitelist and Blacklist
Blacklist Whitelist Behavior Reason
Empty Empty Allow access No filtering rules entered.
Empty URL does not match list entry Block access URL is not in the whitelist.
Empty URL matches list entry Allow access URL is in the whitelist. No blacklist entry to block access.
URL does not match list entry Empty Allow access URL is not in the blacklist. No whitelist entry to prevent access to URLs that are not on the whitelist.
URL matches list entry Empty Block access URL is in the blacklist.
URL does not match list entry URL does not match list entry Block access URL is not in the whitelist.
URL does not match list entry URL matches list entry Allow access URL is in the whitelist. URL is not in the blacklist.
URL matches list entry URL does not match list entry Block access URL is not in the whitelist. URL is in the blacklist.
URL matches list entry URL matches list entry Block access URL is in the blacklist. The blacklist entry overrides the whitelist entry.