Retrieve a List of Root Causes for Rules
Endpoint URL: https://<your server>/rest/v2/customRules/rootCauses
Endpoint URI: v2/customRules/rootCauses
Action: GET
Returns a list of all Elements you can use for a root cause for a Malop generated from this custom rule.
Note
Ensure that you have logged into the Cybereason platform. For details, see Log in with the API.
Request Headers
You must add an Content-Type:application/json header with the request.
Note
If you are using cURL, add the authorization cookie details or the path to the file with cookie details with every request.
Request Body
None
Request Parameters
URL/URI parameters: none
Request Body Parameters: none
Response Status Codes
This request can return the following status codes:
200: Success OK
Response Success Schema
The response includes a list of the supported Elements for the root cause:
self: The Element specified as the beginning point of the custom rule
imageFile
parentProcess
Response Failure Schema
None
Important Response Fields
The response contains a list of all root causes in one field.
Example: Get a list of available root causes
Request
curl --request GET \
--url https://12.34.56.78/rest/v2/customRules/rootCauses \
--header 'Content-Type:application/json' \
Response
["self","imageFile","parentProcess"]
Request
Depending on your browser settings, this linked file may open in a separate tab instead of downloading directly to your machine. If this happens, use the Save As option in your browser to save the file locally.
import requests
import json
# Login information
username = "[email protected]"
password = "mypassword"
server = "yourserver.com"
port = "443"
data = {
"username": username,
"password": password
}
headers = {"Content-Type": "application/json"}
base_url = "https://" + server + ":" + port
login_url = base_url + "/login.html"
session = requests.session()
login_response = session.post(login_url, data=data, verify=True)
print (login_response.status_code)
print (session.cookies.items())
# Request URL
endpoint_url = "/rest/v2/customRules/rootCauses"
api_url = base_url + endpoint_url
api_headers = {'Content-Type':'application/json'}
api_response = session.request("GET", api_url, headers=api_headers)
your_response = json.loads(api_response.content)
print(json.dumps(your_response, indent=4, sort_keys=True))
Response
["self","imageFile","parentProcess"]