Skip to content

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).

{scope | filterUrlsFromScope}
  • input (array): An array of objects, each containing an endpoint property with a URL or IP address

An array of endpoint strings that are not IP addresses

{[{endpoint: "example.com"}, {endpoint: "192.168.1.1"}, {endpoint: "api.test.com"}] | filterUrlsFromScope}
// Returns: ["example.com", "api.test.com"]
{project.scope | filterUrlsFromScope}
// Returns only domain/URL endpoints from project scope
{[
{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"]
{assessment.targets | filterUrlsFromScope | joinWith:", "}
// Returns comma-separated list of non-IP targets
  • 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