Skip to content

Instantly share code, notes, and snippets.

@keyboardcrunch
Last active April 13, 2021 16:54
Show Gist options
  • Select an option

  • Save keyboardcrunch/16b6765bda571f1aba0314d422c38a7c to your computer and use it in GitHub Desktop.

Select an option

Save keyboardcrunch/16b6765bda571f1aba0314d422c38a7c to your computer and use it in GitHub Desktop.
Export SentinelOne Watchlist Queries with PowerShell.
<#
Update the console_address with your subdomain, change the query limit on the filters_api if you wish, and update the
YOUR_API_TOKEN with a token that has the correct API permissions.
$json is the pure json results off the API, but the script will convert the json and export to csv.
You can do this within your console from the API Doc page. Just navigate to Filters > Get Deep Visibility Filters.
Change your limit and run from console to get the json output.
https://YOUR_CONSOLE.sentinelone.net/api-doc/api-details?category=filters&api=get-deep-visibility-filters
#>
$console_address = "https://YOUR_CONSOLE.sentinelone.net"
$filters_api = $console_address + "/web/api/v2.1/filters/dv?limit=300"
$headers = @{"Authorization" = "APIToken YOUR_API_TOKEN"; "Content-Type" = "application/json"}
$request = Invoke-WebRequest -Uri $filters_api -Headers $headers
$Json = $request.Content | ConvertFrom-Json
$Json.data | Export-CSV DVWatchlist_Queries.csv -NoClobber -NoTypeInformation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment