feat: add various infrastructure check and automation scripts
This commit is contained in:
26
scripts/check_zones.py
Normal file
26
scripts/check_zones.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import requests
|
||||
import urllib3
|
||||
import json
|
||||
|
||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
|
||||
s = requests.Session()
|
||||
s.verify = False
|
||||
|
||||
r = s.post('https://14.44.4.1/api/auth/login', json={'username': 'snarf', 'password': 'Katzir476!!!'})
|
||||
csrf = r.headers.get('x-csrf-token') or r.cookies.get('csrf_token')
|
||||
headers = {'X-CSRF-Token': csrf} if csrf else {}
|
||||
|
||||
# Try various firewall zone endpoints
|
||||
for ep in [
|
||||
'/proxy/network/v2/api/site/default/firewall/zones',
|
||||
'/proxy/network/api/s/default/rest/firewallzone',
|
||||
'/proxy/network/v2/api/site/default/firewall-policies',
|
||||
'/proxy/network/v2/api/site/default/firewall/rulesets',
|
||||
'/proxy/network/api/s/default/stat/routing'
|
||||
]:
|
||||
res = s.get('https://14.44.4.1' + ep, headers=headers)
|
||||
print(ep, res.status_code)
|
||||
if res.status_code == 200:
|
||||
print(res.text[:500])
|
||||
|
||||
Reference in New Issue
Block a user