Hi,
I’m reaching out for assistance with an integration I’m currently working on between Wazuh and the Ivanti Neurons API. While I’ve made progress in setting up the integration, I’m encountering an issue with viewing the output on the Wazuh dashboard.
Integration Setup:
1. Configuration in `ossec.conf`:
<integration>
<name>custom-ivanti_neurons</name>2. Python Script (`ivanti_neurons.py`):
#!/usr/bin/env python
import sys
import json
import requests
# Read configuration parameters
alert_file = open(sys.argv[1])
bearer_token = sys.argv[2]
neurons_url = sys.argv[3]
# Read the alert file
alert_json = json.loads(alert_file.read())
alert_file.close()
# Extract necessary fields from the alert
agent_id = alert_json['agent']['id']
agent_name = alert_json['agent']['name']
alert_description = alert_json['rule']['description']
rule_id = alert_json['rule']['id']
alert_level = alert_json['rule']['level']
# Define the query parameters for the Ivanti Neurons API
querystring = {"PageSize": "10", "Filter": "LastScannedDate ge '2024-05-23'", "OrderBy": "LastScannedDate desc", "PageNumber": "1"}
# Set the request headers
headers = {
"Authorization": f"Bearer {bearer_token}",
"X-RapidAPI-Key": "22782fef8dmsh9791fdc24384aacp197616jsn9209917d441d",
"X-RapidAPI-Host": "neurons-for-patch-management.ivanti.rapidapi.com",
"Content-Type": "application/json"
}
# Send the request to Ivanti Neurons API
response = requests.get(neurons_url, headers=headers, params=querystring)
# Print or process the response
if response.status_code == 200:
neurons_data = response.json()
print(json.dumps(neurons_data, indent=4))
else:
print(f"Error {response.status_code}: {response.text}")
sys.exit(0)
Current Status:
What I’ve Tried:
Request for Assistance:
Thank you in advance for your help. I’m eager to resolve this issue and would be grateful for any insights or suggestions from the community.
Hi Hasitha,
Currently, I don't have enough time to troubleshoot this issue, so I'll be exploring the microservice scripting approach instead.
I've observed that my integration uses a dynamic token, which needs periodic refreshing.
If I were to implement this using the Integrator Tool, could you let me know which parameter field would control the POST REQUEST to obtain the token and then proceed with running the query parameters?
Thank you.