Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions deploy_to_wazuh.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import os
import requests
import base64
import urllib3
from pathlib import Path

# Suppress self-signed certificate warnings
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

WAZUH_URL = os.environ["WAZUH_API_URL"]
USER = os.environ["WAZUH_USER"]
PASSWORD = os.environ["WAZUH_PASSWORD"]

# Disable SSL warnings if using self-signed cert (Wazuh Cloud uses valid certs, so this is optional)
requests.packages.urllib3.disable_warnings()

def get_token():
response = requests.get(
f"{WAZUH_URL}/security/user/authenticate",
auth=(USER, PASSWORD),
verify=True
verify=False
)
response.raise_for_status()
return response.json()["data"]["token"]
Expand All @@ -30,7 +30,7 @@ def upload_file(token, endpoint, filename, content):
headers=headers,
params=params,
data=content.encode("utf-8"),
verify=True
verify=False
)
if response.status_code == 200:
print(f"✅ Uploaded {filename}")
Expand All @@ -55,4 +55,4 @@ def main():
print("\n🎉 All rulesets deployed successfully.")

if __name__ == "__main__":
main()
main()
Loading