From a72ef42a706c67a21186cb7339812e147ef432ab Mon Sep 17 00:00:00 2001 From: Carlos Romero <98657335+carom93@users.noreply.github.com> Date: Mon, 23 Mar 2026 14:04:41 -0600 Subject: [PATCH] Fix SSL verification for self-signed cert --- deploy_to_wazuh.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/deploy_to_wazuh.py b/deploy_to_wazuh.py index 55ea918..d5b7af0 100644 --- a/deploy_to_wazuh.py +++ b/deploy_to_wazuh.py @@ -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"] @@ -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}") @@ -55,4 +55,4 @@ def main(): print("\nšŸŽ‰ All rulesets deployed successfully.") if __name__ == "__main__": - main() + main() \ No newline at end of file