-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1262 from ministryofjustice/feature/LGA-2991-hide…
…-non-prod LGA-2991 - Disable indexing and whitelisting of Non-Production environments
- Loading branch information
Showing
9 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python3 | ||
import re | ||
import requests | ||
import sys | ||
|
||
|
||
def get_pingdom_probe_ips(): | ||
ip_list = [] | ||
pingdom_link = "https://my.pingdom.com/probes/ipv4" | ||
pingdom_ips = requests.get(pingdom_link).text.split() | ||
parsed_pingdom_ip_list = ["".join([ip.strip(), "/32"]) for ip in pingdom_ips] | ||
regex = r"^(?:[0-9]{1,3}\.){3}[0-9]{1,3}/32$" | ||
|
||
for ip in parsed_pingdom_ip_list: | ||
if re.match(regex, ip) is not None: | ||
ip_list.append(ip) | ||
return ip_list | ||
|
||
|
||
if __name__ == "__main__": | ||
ips = r"\,".join(get_pingdom_probe_ips()) | ||
sys.stdout.write(ips) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters