Skip to content

filterIpsFromScope

The filterIpsFromScope function processes an array of scope items and returns only those that are valid IPv4 addresses.

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

An array of endpoint strings that are valid IPv4 addresses

{[{endpoint: "example.com"}, {endpoint: "192.168.1.1"}, {endpoint: "10.0.0.1"}] | filterIpsFromScope}
// Returns: ["192.168.1.1", "10.0.0.1"]
{project.scope | filterIpsFromScope}
// Returns only IP address 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"}
] | filterIpsFromScope}
// Returns: ["10.0.0.1", "255.255.255.255", "192.168.100.50"]
{infrastructure.assets | filterIpsFromScope | joinWith:", "}
// Returns comma-separated list of IP addresses
{[
{endpoint: "0.0.0.0"},
{endpoint: "255.255.255.255"},
{endpoint: "192.168.1.256"}, // Invalid - out of range
{endpoint: "10.10.10.10"}
] | filterIpsFromScope}
// Returns: ["0.0.0.0", "255.255.255.255", "10.10.10.10"]
  • Network infrastructure assessments
  • Creating IP-only target lists
  • Firewall rule documentation
  • Network segmentation reporting
  • Infrastructure penetration test scoping