Hosted EDR: How to Create Ingress Filters from Windows using Powershell
book
Article ID: 287749
calendar_today
Updated On:
Products
Carbon Black EDR (formerly Cb Response)
Show More
Show Less
Issue/Introduction
To create an ingress filter from Windows using Powershell
Environment
Hosted Cloud: All Versions Microsoft Windows: All Supported Versions Microsoft Powershell: Version 3
Resolution
Collect the Global API Token .Review the fields that are available for use.Configure Powershell for TLS v1.2:
Create a new filter and replace <GlobalApiTokenHere>, <ServerHostnameHere>, and set any additional filter fields:
Use Invoke-RestMethod.
$JSON = @'
[
{
"descendant_filtering_level": -1,
"id":"test2",
"global": false,
"group_ids": [1, 2],
"os_mask":1,
"path_filters":["*\\unimportant.exe"]
}
]
'@
$response = Invoke-RestMethod -Headers @{"X-Auth-Token" = "<GlobalApiTokenHere>"} -ContentType "application/json" -Method POST -Uri https://<ServerHostnameHere>/api/v1/ingress_whitelist -Body $JSON
If option A does not work then use Invoke-WebRequest.
$JSON = @'
[
{
"descendant_filtering_level": -1,
"id":"test2",
"global": false,
"group_ids": [1, 2],
"os_mask":1,
"path_filters":["*\\unimportant.exe"]
}
]
'@
$response = Invoke-WebRequest -Headers @{"X-Auth-Token" = "<GlobalApiTokenHere>"} -ContentType "application/json" -Method POST -Uri https://<ServerHostnameHere>/api/v1/ingress_whitelist -Body $JSON | Select-Object -Expand Content
Press Enter. If no response is received then the ingress filter has been added successfully. Confirm the filter has been added - https://community.carbonblack.com/t5/Knowledge-Base/CB-Response-Cloud-How-to-Check-Current-Ingress-Filters-from/ta-p/69742
Additional Information
If an error occurs after step 5,
validate that the JSON is correct and that the current ID is not in use. Only the JSON format is validated and not the fields used.
Feedback
thumb_up
Yes
thumb_down
No