VerifyValidIP
Verifies if the given input contains valid IP addresses (IPv4 or IPv6).
python · Common Scripts
Details
| ID | VerifyValidIP |
|---|---|
| Language | python |
| From Version | 6.10.0 |
| Docker Image | demisto/python3:3.12.13.11879924 |
| Tags | Utility IP Validation |
README
VerifyValidIP
Summary
Verifies if the given input contains valid IP addresses (IPv4 or IPv6).
Script Data
| Name | Description |
|---|---|
| Script Type | python3 |
| Tags | Utility, IP, Validation |
| Cortex XSOAR Version | 6.0.0+ |
Inputs
| Argument Name | Description | Required |
|---|---|---|
| input | IP address or list of IP addresses to validate | Required |
Outputs
| Path | Description | Type |
|---|---|---|
| VerifyValidIP.Results | List of boolean values indicating if each input IP is valid | List |
Script Example
!VerifyValidIP input="192.168.1.1,2001:db8::1,invalid_ip,10.0.0.1"
Script Results
The script returns a list of boolean values:
Truefor valid IP addressesFalsefor invalid IP addresses
Example Output
[true, true, false, true]
Notes
- Supports both IPv4 and IPv6 address validation
- Uses Python’s built-in
ipaddressmodule for accurate validation - Input can be a single IP address or a comma-separated list
- Invalid entries will return
Falsein the corresponding position
commonfields: id: VerifyValidIP version: -1 name: VerifyValidIP script: '-' type: python tags: - Utility - IP - Validation comment: Verifies if the given input contains valid IP addresses (IPv4 or IPv6). enabled: true args: - name: input required: true description: IP address or list of IP addresses to validate. isArray: true defaultValue: '' scripttarget: 0 subtype: python3 dockerimage: demisto/python3:3.12.13.11879924 runas: DBotWeakRole engineinfo: {} runonce: false timeout: 0ns outputs: - contextPath: VerifyValidIP description: Dictionary with IP addresses as keys and validation results as boolean values. type: Unknown tests: - No tests (auto formatted) fromversion: 6.10.0