Skip to content

Instantly share code, notes, and snippets.

@davidobrien1985
Created August 25, 2021 05:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidobrien1985/16b5f9c57dc208f9efa51746b3e6c8cb to your computer and use it in GitHub Desktop.
Save davidobrien1985/16b5f9c57dc208f9efa51746b3e6c8cb to your computer and use it in GitHub Desktop.
ARGOS API query example
# Use https://dev.argos-security.io/ for more information about browsing the API
# Go to https://app.argos-security.io/account/security to generate or get your personal API key
$headers = @{"Ocp-Apim-Subscription-Key"="____________________replace_________________"}
$result = Invoke-WebRequest -Headers $headers -Uri https://oapi.argos-security.io/argos-prod-fn/detections | ConvertFrom-Json
$detections = $result.data.detections
$openDetections = $detections | Where-Object -FilterScript {$_.status -eq "open"}
$azureDetections = $detections | Where-Object -FilterScript {$_.cloud -eq "azure"}
$azureOpenDetections = $detections | Where-Object -FilterScript {$_.cloud -eq "azure" -and $_.status -eq "open"}
Write-Output "We found a total of $($detections.Count) detections."
Write-Output "We found a total of $($openDetections.Count) open detections."
Write-Output "We found a total of $($azureDetections.Count) total detections on Azure."
Write-Output "We found a total of $($azureOpenDetections.Count) total detections on Azure."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment