-
Notifications
You must be signed in to change notification settings - Fork 74
[ BUG ] Add-FalconSensorTag
and Remove-FalconSensorTag
not working on Linux hosts
#421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Add-FalconSensorTag
and Remove-FalconSensorTag
not working on Linux hosts
Thanks for the report! I can confirm the same behavior in my test environment. It seems like something with the command line syntax for the |
I believe I've narrowed this issue down to the transmission of the scripts used to manipulate FalconSensorTags through Real-time Response. I made some changes to those scripts, and also some optimizations to the Can you please follow the steps mentioned below and let me know if this resolves your issue? Once you update the Import-Module -Name PSFalcon
$ModulePath = (Show-FalconModule).ModulePath
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/CrowdStrike/psfalcon/2f562468a36820cf4b5a13f41b91faba3c5413ee/public/psf-sensors.ps1 -UseBasicParsing).Content > (Join-Path (Join-Path $ModulePath public) psf-sensors.ps1)
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/CrowdStrike/psfalcon/2f562468a36820cf4b5a13f41b91faba3c5413ee/script/add_sensortag.sh -UseBasicParsing).Content > (Join-Path (Join-Path $ModulePath script) add_sensortag.sh)
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/CrowdStrike/psfalcon/2f562468a36820cf4b5a13f41b91faba3c5413ee/script/add_sensortag.zsh -UseBasicParsing).Content > (Join-Path (Join-Path $ModulePath script) add_sensortag.zsh)
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/CrowdStrike/psfalcon/2f562468a36820cf4b5a13f41b91faba3c5413ee/script/remove_sensortag.ps1 -UseBasicParsing).Content > (Join-Path (Join-Path $ModulePath script) remove_sensortag.ps1)
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/CrowdStrike/psfalcon/2f562468a36820cf4b5a13f41b91faba3c5413ee/script/remove_sensortag.sh -UseBasicParsing).Content > (Join-Path (Join-Path $ModulePath script) remove_sensortag.sh)
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/CrowdStrike/psfalcon/2f562468a36820cf4b5a13f41b91faba3c5413ee/script/remove_sensortag.zsh -UseBasicParsing).Content > (Join-Path (Join-Path $ModulePath script) remove_sensortag.zsh) |
Thank you for feedback. SensorTag is still not added/removed. Please find outputs below. I also attached commands run by RTR as found in RTR Audit (screenshots) Add-FalconSensorTag -Id $device -Tag $tag FIRST RUN: cid : *** CONSECUTIVE RUNS: query_time powered_by trace_id Remove-FalconSensorTag -Id $device -Tag $tag query_time powered_by trace_id |
Add-FalconSensorTag
and Remove-FalconSensorTag
not working on Linux hostsAdd-FalconSensorTag
and Remove-FalconSensorTag
not working on Linux hosts
Add-FalconSensorTag
and Remove-FalconSensorTag
not working on Linux hostsAdd-FalconSensorTag
and Remove-FalconSensorTag
not working on Linux hosts
Your new issue looks to be a problem specific to |
You can take the
Which you'd run like this in the console:
Or like this with PSFalcon (replace the backslashes with ``` characters):
|
I confirm the following works:
Output: |
I managed to sort that one out by converting \r\n to \n in |
Ha nice one, but if powershell transparently adds CRLF line endings when parsing text you're in for a good debug time :P |
Last comment, if |
Thank you! I figured it was something to do with the formatting (which is why I latched on to the single line replacement script) but wasn't able to narrow down the exact cause. I might be able to do some RegEx replacement when loading the script from disk before sending it to Real-time Response to replace any |
Unfortunately I don't make those calls... 😄 I can shift the text manipulation from happening in the SensorTag script to happening in the PSFalcon code to produce the output. That will remove the need to use |
This fix has been included in the 2.2.8 release which is now available on GitHub. I'm going to leave this issue open until the PowerShell Gallery release is also available. I'm still planning on relocating the |
PSFalcon: version 2.27
PSVersion: 5.1.19041.4780
OS: LNX RHEL 8.x
Host already has SensorTags configured
Enabled RTR with custom scripts and run.
When I try to REMOVE a SensorTag with Remove-FalconSensorTag it fails with below output:
When I try to ADD a SensorTag with Add-FalconSensorTag it fails with following output:
The text was updated successfully, but these errors were encountered: