Created
August 25, 2021 05:57
-
-
Save davidobrien1985/16b5f9c57dc208f9efa51746b3e6c8cb to your computer and use it in GitHub Desktop.
ARGOS API query example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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