filterIpsFromScope
The filterIpsFromScope function processes an array of scope items and returns only those that are valid IPv4 addresses.
Syntax
Section titled “Syntax”{scope | filterIpsFromScope}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 valid IPv4 addresses
Examples
Section titled “Examples”Basic filtering
Section titled “Basic filtering”{[{endpoint: "example.com"}, {endpoint: "192.168.1.1"}, {endpoint: "10.0.0.1"}] | filterIpsFromScope}// Returns: ["192.168.1.1", "10.0.0.1"]Processing project scope
Section titled “Processing project scope”{project.scope | filterIpsFromScope}// Returns only IP address 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"}] | filterIpsFromScope}// Returns: ["10.0.0.1", "255.255.255.255", "192.168.100.50"]Using in network diagrams
Section titled “Using in network diagrams”{infrastructure.assets | filterIpsFromScope | joinWith:", "}// Returns comma-separated list of IP addressesValid IP ranges
Section titled “Valid IP ranges”{[ {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"]Use Cases
Section titled “Use Cases”- Network infrastructure assessments
- Creating IP-only target lists
- Firewall rule documentation
- Network segmentation reporting
- Infrastructure penetration test scoping