Closed datorr2 closed 2 months ago
Thanks for the report!
It looks like GET /alerts/queries/alerts/v2
returns 10,000 ids, but POST /alerts/entities/alerts/v2
only accepts a maximum of 1,000. PSFalcon isn't breaking up the identifier list into groups of 1,000. Until I fix that, you can work around the problem by retrieving the available alerts like this:
Get-FalconAlert -Limit 1000 -Detailed -All
I've implemented a fix to ensure that only 1,000 ids are submitted per request when retrieving details of alerts. This fix will be included in the next PSFalcon release. If you'd like to resolve it for your local module before release, you can replace public\alerts.ps1
and private\Private.ps1
using the steps outlined below.
Import-Module -Name PSFalcon
$ModulePath = (Show-FalconModule).ModulePath
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/CrowdStrike/psfalcon/a6a777a3a3e52462ee572d869990beb93b5bc838/public/alerts.ps1 -UseBasicParsing).Content > (Join-Path (Join-Path $ModulePath public) alerts.ps1)
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/CrowdStrike/psfalcon/a6a777a3a3e52462ee572d869990beb93b5bc838/private/Private.ps1 -UseBasicParsing).Content > (Join-Path (Join-Path $ModulePath private) Private.ps1)
Once these steps have been completed, please close and re-open PowerShell and re-import PSFalcon to ensure that the issue is resolved. Leaving this open for others to apply the fix until the next release.
This fix is included in the 2.2.7 release.
Describe the bug
Get-FalconAlert -All -Detailed
produces an HTTP error413 - Request Too Large
To Reproduce
Get-FalconAlert -All -Detailed
Expected behavior All Falcon alerts returned with details.
Environment (please complete the following information):
Additional context Ran command with
-Verbose
flag and then copied thePOST
body to check the length. The length of the request was 1058849 bytes, which is over 1 MiB.Transcript content