Report templatesFunctions
filterUrlsFromScope
Filter out IP addresses from a scope list, returning only URLs/domains
Usage
The filterUrlsFromScope
function processes an array of scope items and returns only those that are not IP addresses (i.e., returns domains and URLs).
Syntax
{scope | filterUrlsFromScope}
Parameters
input
(array): An array of objects, each containing anendpoint
property with a URL or IP address
Returns
An array of endpoint strings that are not IP addresses
Examples
Basic filtering
{[{endpoint: "example.com"}, {endpoint: "192.168.1.1"}, {endpoint: "api.test.com"}] | filterUrlsFromScope}
// Returns: ["example.com", "api.test.com"]
Processing project scope
{project.scope | filterUrlsFromScope}
// Returns only domain/URL endpoints from project scope
Mixed endpoints
{[
{endpoint: "10.0.0.1"},
{endpoint: "subdomain.example.org"},
{endpoint: "255.255.255.255"},
{endpoint: "localhost"},
{endpoint: "192.168.100.50"}
] | filterUrlsFromScope}
// Returns: ["subdomain.example.org", "localhost"]
Using in tables
{assessment.targets | filterUrlsFromScope | joinWith:", "}
// Returns comma-separated list of non-IP targets
Use Cases
- Separating domains from IPs in scope definitions
- Creating domain-only target lists for web assessments
- Filtering for DNS-based testing
- Generating reports that distinguish between domain and IP targets
- Building URL lists for web application testing