first commit
This commit is contained in:
58
get_security_policy_link11.py
Executable file
58
get_security_policy_link11.py
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/bin/python
|
||||
from env import *
|
||||
import requests
|
||||
import json
|
||||
import pprint
|
||||
|
||||
# === Konfiguration ===
|
||||
CONFIG_ID = "prod"
|
||||
|
||||
# Proxy Templates – nur einen aktiv lassen
|
||||
PROXY_TEMPLATE = "f4bf25a205a5"
|
||||
# PROXY_TEMPLATE = "andere_template_id"
|
||||
|
||||
# Security Policies – nur einen aktiv lassen, dieses dient als Vorlage
|
||||
SECURITY_POLICY = "secpol-shop022-jtl-hosting-de" # z. B. Shop022
|
||||
# SECURITY_POLICY = "3f7a521c6570" # Shop023
|
||||
# SECURITY_POLICY = "9cc8dd695d5c" # Shop024
|
||||
# SECURITY_POLICY = "1f707fb18483" # Shop028
|
||||
|
||||
# Backend Services, nur einen aktiv lassen
|
||||
BACKEND_SERVICE = "backend-shop022-jtl-hosting-de"
|
||||
|
||||
# === Header für alle Requests ===
|
||||
HEADERS = {
|
||||
"Authorization": f"Bearer {API_TOKEN}",
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
|
||||
|
||||
def get_security_policy(policy):
|
||||
url = f"https://jtlwaap.app.reblaze.io/api/v4.0/conf/{CONFIG_ID}/security-policies/{policy}"
|
||||
|
||||
response = requests.get(url, headers=HEADERS,)
|
||||
|
||||
if response.status_code == 200:
|
||||
print(f"[✓] Abfrage von Security policy '{policy}' erfolgreich.")
|
||||
else:
|
||||
print(f"[✗] Fehler bei ({policy}): {response.status_code} → {response.text}")
|
||||
#print(response.text)
|
||||
res=json.loads(response.text)
|
||||
pprint.pp(res)
|
||||
'''
|
||||
for key,value in res.items():
|
||||
if ( key != "map" ):
|
||||
print (key, value, "\n")
|
||||
else:
|
||||
print(key)
|
||||
for items in value:
|
||||
for key2, value2 in items.items():
|
||||
print(key2, value2)
|
||||
'''
|
||||
|
||||
def main():
|
||||
get_security_policy(SECURITY_POLICY)
|
||||
|
||||
# === CSV-Datei einlesen ===
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user