Python API for Cb ThreatHunter does not retrieve correct device IP information #240
Comments
|
@crahan Can you provide the sample code you are using to execute this query? Additionally are you using your PR with the new process search v2 routes? |
|
Hi, The above findings are for the v1 search with the below sample script (and without the v2 search PR applied): from cbapi.psc.threathunter import CbThreatHunterAPI
from cbapi.psc.threathunter.models import Event, Process
cb = CbThreatHunterAPI(profile='profile-name')
query_result = cb.select(Process).where('process_guid:ORGKEY-011e05ee-0000044c-00000000-1d648aca4504395')
for process in query_result:
print(process)Depending on the process search result being enriched or not enriched the output is as described above. When I run this with the changes from the v2 search API I do get an internal and an external IP address for the single process search result from the above script (as the v2 search API aggregates all enriched process information for a specific process GUID into a single object). I've run the above script 3 times with the v2 changes and while the device record in the UI still reports the IP information similar to the above UI screenshot, the result from the above sample script were different for each run: Run 1
Run 2
Run 3
v2 API run 1: both IP addresses are different from what is reported in the device record in the UI. It does not appear that the v2 search API resolves this issue, except for the |
|
This item is being tracked through an EA for backend teams to triage the API service |
When retrieving process details for a process query using the Python API on Cb ThreatHunter, it does not return the proper IP information as part of the process object properties.
Regular non-enriched process

Enriched process

UI device details

The device in the screenshots has both an internal and external IP address (per the device details in the UI). However, while looping over the query results for a specific GUID (process_guid:ORGKEY-011e05ee-0000044c-00000000-1d648aca4504395) and retrieving process information the following can be observed:
device_external_ipfield and nodevice_internal_ipfield.device_internal_ip(which is incorrectly set to the device's external IP) and it is missing adevice_external_ipfield.Expectation: both enriched and non-enriched process search results should contain the
device_internal_ipanddevice_external_ip fieldswhich are set to the correct IP values (as indicated by the device details in the UI for that endpoint).The text was updated successfully, but these errors were encountered: