feat: add infrastructure audit and diagnostic helper scripts
This commit is contained in:
49
scripts/inspect_semaphore.py
Normal file
49
scripts/inspect_semaphore.py
Normal file
@@ -0,0 +1,49 @@
|
||||
import paramiko
|
||||
import urllib.request
|
||||
import ssl
|
||||
import json
|
||||
import sys
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
ctx = ssl.create_default_context()
|
||||
ctx.check_hostname = False
|
||||
ctx.verify_mode = ssl.CERT_NONE
|
||||
|
||||
token = "SnarfNetPermanentAutomationToken2026"
|
||||
headers = {
|
||||
"Authorization": f"Bearer {token}",
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
|
||||
def api_call(url):
|
||||
req = urllib.request.Request(url, headers=headers)
|
||||
with urllib.request.urlopen(req, context=ctx, timeout=8) as resp:
|
||||
return json.loads(resp.read().decode('utf-8'))
|
||||
|
||||
print("=== Provider 10 in Authentik ===")
|
||||
try:
|
||||
p10 = api_call("https://authentik.snarfnet.net/api/v3/providers/oauth2/10/")
|
||||
print("OAuth2 Provider 10:")
|
||||
print(json.dumps(p10, indent=2))
|
||||
except Exception as e:
|
||||
print("Not OAuth2:", e)
|
||||
try:
|
||||
p10 = api_call("https://authentik.snarfnet.net/api/v3/providers/proxy/10/")
|
||||
print("Proxy Provider 10:")
|
||||
print(json.dumps(p10, indent=2))
|
||||
except Exception as e2:
|
||||
print("Not Proxy either:", e2)
|
||||
|
||||
# Check Semaphore deployment in Spaceport
|
||||
key_path = r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet'
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect('140.44.4.41', username='root', key_filename=key_path, timeout=10)
|
||||
|
||||
stdin, stdout, stderr = ssh.exec_command("k3s kubectl get deployment -n infrastructure semaphore -o yaml")
|
||||
print("\n=== Semaphore Deployment YAML ===")
|
||||
print(stdout.read().decode())
|
||||
|
||||
ssh.close()
|
||||
|
||||
Reference in New Issue
Block a user