carlodicelico
11/12/2018 - 8:42 PM

Get GCP netblocks for firewall rules

Get GCP netblocks for firewall rules

for name in $(nslookup -q=TXT _spf.google.com 8.8.8.8 | grep -oe '_netblocks[1-9]*.google.com'); do nslookup -q=TXT $name 8.8.8.8 | grep -oe '[0-9]*.[0-9]*.[0-9]*.[0-9]/[0-9]*'; done