Are there any examples on how to set up an alert in v20.1.2 to call a PowerShell script (I think this would be the same for CMD script)?
In v19.1, I would create an alert and then choose EXEC and enter the path to my script like this;
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe “&{D:\Qdx_work\Custom_Scripts\CloverleafInterfaceRecycle.ps1}”
I’ve upgraded our DEV system to v20.1.2 and the alert is no longer working.
From the CL Release Notes:
External commands on exec alert do not need full path
(25728)
Changing each “exec” alert so that there is the full path is cumbersome when there are many alerts.
However, this is required for CIS 19.1 and newer, due to the Security Whitelist feature.
Global variables can now be added to the whitelist. This requires the user to update the command path
in one place instead of the previous scheme that required each entry to be updated.
The external command must first be added to the whitelist, and then it must be added to one of the
env PATH folder.
There is no more requirement to add a full path for external commands when configuring an alert.
I added the example below to the Whitelist.
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
But I still have to enter the full path in the EXEC section. If I don’t enter the PowerShell path, my alert will not work.
IE: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe “&{D:\Qdx_work\Custom_Scripts\CloverleafInterfaceRecycle.ps1}”
After reading the release notes, I’m thinking I don’t have to enter the full path of PowerShell, just this:
D:\Qdx_work\Custom_Scripts\CloverleafInterfaceRecycle.ps1
I tried adding this to the PowerShell location to the environment variables, PATH
C:\Windows\System32\WindowsPowerShell\v1.0
Then rebooted, but I cannot enter the shortened EXEC in the alert. It will not fire.
Am I misunderstanding the release notes, or missing a configuration?