PaloAltoNetworks / panhandler

Panhandler is a tool to manage config snippets and Skillets for PAN-OS devices
Apache License 2.0
41 stars 19 forks source link

type hint fqdn_or_ip doesn't filter for FQDN #101

Closed rrega closed 5 years ago

rrega commented 5 years ago

Regex looks for hostname only (not very useful for enterprise or cloud environments)

Possible solution

Replace current regex on validators.py line 18 to hostname_re = r'(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{1,63}(?<!-).)+[a-zA-Z]{2,63}$)$' Instead of current hostname_re = r'a-z0-9$'

rrega commented 5 years ago

validators.py with new regex validated on my environment validators.zip

nembery commented 5 years ago

fixed via commit b89c86f