feat: add various infrastructure check and automation scripts

This commit is contained in:
2026-11-15 17:17:41 -05:00
parent 336b7759d0
commit b301aa3ece
232 changed files with 8274 additions and 298 deletions

View File

@@ -0,0 +1,25 @@
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 {}
res = s.get('https://14.44.4.1/proxy/network/v2/api/site/default/firewall-policies', headers=headers)
policies = res.json()
compute_net_id = "1748bb1d-f674-4dcd-85d0-f58109a02e77"
for p in policies:
src_nets = p.get('source', {}).get('network_ids', []) or []
dst_nets = p.get('destination', {}).get('network_ids', []) or []
if compute_net_id in src_nets or compute_net_id in dst_nets:
print(f"Policy: {p.get('name')} (Index {p.get('index')}) | Action: {p.get('action')} | Type: {p.get('connection_state_type')}")
print(f" Src: {p.get('source')}")
print(f" Dst: {p.get('destination')}")