Hello,
I have been trying to integrate Jira with Wazuh. I followed the blog post and tried to replicate the configuration but somehow it is not doing anything.
Below is a snip from my configuration.
cat /var/ossec/etc/ossec.conf <!-- ### Integration with JIRA ### --> <integration> <name>custom-jira</name> <hook_url>https://myorg.atlassian.net/rest/api/3/issue/</hook_url> <api_key>m...@myorg.com:API-HASH</api_key> <level>10</level> <!-- <group>multiple_drops|authentication_failures</group> --> <alert_format>json</alert_format> </integration>Here is the python script taken from the blog.
cat /var/ossec/integrations/custom-jira #!/var/ossec/framework/python/bin/python3 import sys import json import requests from requests.auth import HTTPBasicAuth # Read configuration parameters alert_file = open(sys.argv[1]) user = sys.argv[2].split(':')[0] api_key = sys.argv[2].split(':')[1] hook_url = sys.argv[3] # Read the alert file alert_json = json.loads(alert_file.read()) alert_file.close() # Extract issue fields alert_level = alert_json['rule']['level'] ruleid = alert_json['rule']['id'] description = alert_json['rule']['description'] agentid = alert_json['agent']['id'] agentname = alert_json['agent']['name'] agentip = alert_json['agent']['ip'] # path = alert_json['syscheck']['path'] # Set the project attributes ===> This section needs to be manually configured before running! project_key = 'WAZUH' # You can get this from the beggining of an issue key. For example, WS for issue key WS-5018 issuetypeid = '11000' # Check https://confluence.atlassian.com/jirakb/finding-the-id-for-issue-types-646186508.html. There's also an API endpoint to get it. # Generate request headers = {'content-type': 'application/json'} issue_data = { "update": {}, "fields": { "summary": 'Wazuh Alert: [' + description + ']', "issuetype": { "id": issuetypeid }, "project": { "key": project_key }, "description": { 'version': 1, 'type': 'doc', 'content': [ { "type": "paragraph", "content": [ { "text": '- State: ' + description + '\n- Rule ID: ' + str(ruleid) + '\n- Alert level: ' + str(alert_level) + '\n- Agent: ' + str(agentid) + ' ' + agentname, "type": "text" } ] } ], }, } } # Send the request response = requests.post(hook_url, data=json.dumps(issue_data), headers=headers, auth=(user, api_key)) print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": "))) # <--- Uncomment this line for debugging sys.exit(0)I enabled debugging from by uncommenting line from above script but I am not able to understand where the debug logs are getting printed.
I checked the permissions too which are as desired.
Executing the script gives below error -
sudo -u wazuh python /var/ossec/integrations/custom-jira Traceback (most recent call last): File "/var/ossec/integrations/custom-lentra-jira", line 5, in <module> import requests ImportError: No module named requestsAny guidance will be highly appreciated.
Thanks, KS

Hi..
I just came here to update you and found that I have have got a reply! :)
Yeah.. the issue got fixed. Installed python-requests package using yum which did the job! May I request you to update the blog so that it can clearly say that python-requests package is a prerequisite. It will be helpful for non-coders like me.
Thank you again for your support!
KS
--
You received this message because you are subscribed to a topic in the Google Groups "Wazuh mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wazuh/djaONs4kUbM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wazuh+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wazuh/4453b76a-5b0f-4e9c-b316-df1835b62573n%40googlegroups.com.
