-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
wsl.exe attempts to load despite Windows Subsystem for Linux being disabled #11716
Comments
This is by-design. We need to call Hmm. Okay well the bot must have been on a nap because v1.10.2714.0...v1.11.2921.0 suggests that f9a844d is in 1.11 stable. |
UNLESS the registry lookup failed, and that caused us to fallback to the old method. I totally forgot I left that in there. What's in |
Thanks for the quick response, @zadjii-msft. The
The path of Windows Terminal that is attempting to launch
Are there any additional repro steps you'd recommend I try? Thanks! |
Ah okay. I see the issue now. The So perhaps a durable fix would be to also check in HKLM. A s short term fix for me personally, I confirmed that the event no longer surfaces after I created an |
Thanks a lot for that hint Matt - i really needed that, too, because WDAC rocks and this was really annoying in the Operational Log ;-) |
Thanks for chiming in, @SebCT. I'm glad I wasn't the only one who found this to be obnoxious. And good on you for deploying Microsoft's recommended block list! 🤜🤛 |
Hello Matt! Thank you, without your Twitter and blog postings i couldn't do WDAC - so it makes lots of fun now ;-) Actually i found out, that VSCODE also triggers WSL.exe (on my WDAC test system) if the following happens: I start my VS Code with the "PowerShell integrated console V2021.10.2" because i installed the official PowerShell VS Code Add-On from Microsoft for scripting in PowerShell ISE Style on VS Code - in the operational log of WDAC i get a 3076 event (only once when starting): "Code Integrity determined that a process (\Device\HarddiskVolume15\Windows\System32\cmd.exe) attempted to load \Device\HarddiskVolume15\Windows\System32\wsl.exe that did not meet the Enterprise signing level requirements or violated code integrity policy" Can you confirm that behaviour on your system(s), too (in case you use the VS Code PS Add-On)? I don't have a solution now for finding out why that happens, because the LXSS Regkey is set, but it doesn't help in this case. Of course it's not a big problem and i can live with it, but would be curious why that happens and if you can confirm that. Thanks in advance for your help and looking forward for your answer 😊 Update: found out the problem: i had wrong/old profile settings in my extension, i resetted it with the help of this article: https://code.visualstudio.com/docs/editor/integrated-terminal#_terminal-profiles - now no more WSL.exe in WDAC Event Log :-) |
Good to hear you discovered the solution, @SebCT! I have yet to attempt building an allowlist for VSCode. You are brave! Haha. I run it in a VM when I need to do stuff locally. Otherwise, vscode.dev in meeting my basic needs. |
Thanks for that hint with vscode.dev - totally forgot that, it's a very interesting solution for locked down devices, nice! 👌👍 Well, unfortunately my workaround didn't work, after a restart or two if VSCode i had the same thing again - so i used SysMon to find out wht's going on - here is the result, maybe you will find it interesting. I must admit i don't know how to solve it now, but will live with it - i think it's a VSCode thing, in bold text you see the Command Line in the event log: Sysmon Event Log: Image: C:\Windows\System32\cmd.exe It's invoked because of the PowerShell Add-On, which starts the VSCode Terminal - interesting thing.... |
Interesting. Thanks for that context, @SebCT. To an extent, I've accepted that some things will fill up the logs. For example, I get events all the time of mscorsvw.exe being prevented from loading Microsoft.Build.Framework.dll. When I audit events from the CodeIntegrity event log, I can filter those events out based on a verification error code of 26 (Explicitly denied by WDAC policy) in the 3089 events. In the WDACTools module, I can filter them out with the following: Get-WDACCodeIntegrityEvent -SinceLastPolicyRefresh -Enforce -SignerInformation -IgnoreDenyEvents Note: there's a bug where VerificationError 26 doesn't populate when you're in audit mode which is annoying. I hope that helps! |
Thanks for that Matt, that really helps me for future Audits, very nice! 👍👌😊 |
The main result of this fallback is that we attempt to launch wsl.exe when the user hasn't installed or interacted with WSL. On our test machines, that results in the creation of a wsl.exe process that tells us precisely nothing; on WDAC managed machines it results in an Event Log entry about spawning another (possibly blocked) process. The registry is more reliable, and if the "API" it provides changes we can just rev terminal. Closes #11716
The main result of this fallback is that we attempt to launch wsl.exe when the user hasn't installed or interacted with WSL. On our test machines, that results in the creation of a wsl.exe process that tells us precisely nothing; on WDAC managed machines it results in an Event Log entry about spawning another (possibly blocked) process. The registry is more reliable, and if the "API" it provides changes we can just rev terminal. Closes #11716
The main result of this fallback is that we attempt to launch wsl.exe when the user hasn't installed or interacted with WSL. On our test machines, that results in the creation of a wsl.exe process that tells us precisely nothing; on WDAC managed machines it results in an Event Log entry about spawning another (possibly blocked) process. The registry is more reliable, and if the "API" it provides changes we can just rev terminal. Closes #11716 (cherry picked from commit f025c53) Service-Card-Id: 83892843 Service-Version: 1.14
The main result of this fallback is that we attempt to launch wsl.exe when the user hasn't installed or interacted with WSL. On our test machines, that results in the creation of a wsl.exe process that tells us precisely nothing; on WDAC managed machines it results in an Event Log entry about spawning another (possibly blocked) process. The registry is more reliable, and if the "API" it provides changes we can just rev terminal. Closes #11716 (cherry picked from commit f025c53) Service-Card-Id: 83892844 Service-Version: 1.15
🎉This issue was addressed in #13436, which has now been successfully released as Handy links: |
🎉This issue was addressed in #13436, which has now been successfully released as Handy links: |
Windows Terminal version (or Windows build number)
1.11.2921.0
Other Software
wsl.exe (10.0.22000.1)
Steps to reproduce
Loading Windows Terminal will launch
wsl.exe
despite Windows Subsystem for Linux (WSL) being disabled.This is problematic as I explicitly deny execution of
wsl.exe
per Microsoft recommended block rules in my Windows Defender Application Control (WDAC) policy. As a result, every time I launch Windows Terminal, aMicrosoft-Windows-CodeIntegrity/Operational
event ID 3077 event is generated. Example event message:Steps to confirm that WSL is disabled:
There is also nothing in my
settings.json
configuration that would explicitly launch any component of WSL. Here is mysettings.json
for reference:Expected Behavior
When Windows Subsystem for Linux is disabled, Windows Terminal will not execute
wsl.exe
.Actual Behavior
When Windows Subsystem for Linux is disabled, Windows Terminal executes
wsl.exe
.The text was updated successfully, but these errors were encountered: