redcanaryco / surveyor

A cross-platform baselining, threat hunting, and attack surface analysis tool for security teams.
MIT License
173 stars 61 forks source link

[BUG] SentinelOne Site Id filters are ignored when specified in commandline with PQ #155

Closed xC0uNt3r7hr34t closed 8 months ago

xC0uNt3r7hr34t commented 9 months ago

Describe the bug

Filtering via site-id or account-id is ignored when specified in the cmdline params for SentinelOne. Using the config works as expected.

What side of Surveyor is impacted?

What product is impacted?

Steps to reproduce

run surveyor with an account id specified in the config then run using a site-id filter.

What did you do?

What is the command line you're running that is causing the error? Command line 'py .\surveyor.py --profile dfir --deffile .\definitions\rmm.json s1 --creds credfile.ini --site-id 1533494755586512471'

Expected behavior

When using the site-id filter in the cmdline params the site id should be added and used to filter down the results, however this is not being added and utilized when the api calls are being made.

Logfile output

[2023-12-15 10:02:47,910] [DEBUG ] [surveyor.s1 ] [sentinel_one.py :294 ] Site IDs: [ ] [2023-12-15 10:02:47,910] [DEBUG ] [surveyor.s1 ] [sentinel_one.py :295 ] Account IDs: ['1257393871178784542']

Additional context

It was also identified that the code checking for needing account ids when using power query is unneeded based on the current settings of the api. It was also identified that it was not functioning correctly as it was written.