-
Notifications
You must be signed in to change notification settings - Fork 23
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
Protected Event Logging is breaking execution #188
Comments
I'm not having much success with the repro for this issue. The following image shows some basic info from my test rig.. You can see that applying Also Protected Event Logging is enabled and encrypting events as expected: The main thing that perplexes me right now is how the encryption of the logs is correlated with the output of the PowerShell provider. |
When Protected Event Logging and PowerShell Script Block logging are enabled together the SystemRoot environment variable is a requirement. If it is removed as part of the environment purge it causes the PowerShell process to crash, therefore breaking the pipe between Ruby and the remote PowerShell session. This commit fixes the issue by creating a filtered list of environment variables which does not include the SystemRoot environment variable. This list can then be purged safely.
When Protected Event Logging and PowerShell Script Block logging are enabled together the SystemRoot environment variable is a requirement. If it is removed as part of the environment purge it causes the PowerShell process to crash, therefore breaking the pipe between Ruby and the remote PowerShell session. This commit fixes the issue by creating a filtered list of environment variables which does not include the SystemRoot environment variable. This list can then be purged safely.
Fixed in #189 For each run we reset the session environment to a last known good state. We did this by removing all environment variables, then re-setting them from a cached set we took at the start of the run. It appears that when ScriptBlock Logging and Protected Event Logging are both enabled, removing the I'm unclear at this time what the dependency is but suspect that there is a process that is consuming $env:\SystemRoot when building a path to an executable. I was able to replicate by manually invoking A bit of trial and error narrowed it down to #189 fixes the issue by filtering out The questions remaining for me are:
|
(GH-188) Filter current environment variables
Both DSC resources and anything with a
provider => powershell
is immediately erroring out with errors as follows:See Slack thread for more discussion and a link to the ZenDesk ticket.
The text was updated successfully, but these errors were encountered: