filterUrlsFromScope
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
Section titled “Syntax”{scope | filterUrlsFromScope}Parameters
Section titled “Parameters”input(array): An array of objects, each containing anendpointproperty with a URL or IP address
Returns
Section titled “Returns”An array of endpoint strings that are not IP addresses
Examples
Section titled “Examples”Basic filtering
Section titled “Basic filtering”{[{endpoint: "example.com"}, {endpoint: "192.168.1.1"}, {endpoint: "api.test.com"}] | filterUrlsFromScope}// Returns: ["example.com", "api.test.com"]Processing project scope
Section titled “Processing project scope”{project.scope | filterUrlsFromScope}// Returns only domain/URL endpoints from project scopeMixed endpoints
Section titled “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
Section titled “Using in tables”{assessment.targets | filterUrlsFromScope | joinWith:", "}// Returns comma-separated list of non-IP targetsUse Cases
Section titled “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