Should You Disable VS Code Workspace Trust | Code Editor Security Settings

WebStylePress
WebStylePress
21.1 هزار بار بازدید - 3 سال پیش - 'Workspace Trust' in Visual Studio
'Workspace Trust' in Visual Studio Code lets you decide whether your project folders should allow or restrict automatic code execution. If I open a project in Visual Studio Code, I get this popup with a message:

- Do you trust the authors of the files in this folder?

If you trust the project, it will open normally. Otherwise it will open in restricted mode.

In restricted mode, certain tasks, debugging, workspace settings and extensions are disabled or offer limited functionality. If you open a project in restricted mode. You can allow trust later on. Also you can use workspaceUnsupported filter for extensions to see which extensions are disabled. You can selectively enable extensions by hitting gear icon next to extension name.

You can disable Workspace Trust via the VS Code command line by passing this command
--disable-workspace-trust
This switch only affects the current session.
But this switch did not work for me for some reason.

If you want to permanently disable the 'Workspace Trust' you can use use settings file.

"security.workspace.trust.startupPrompt": "never",
"security.workspace.trust.enabled": false,

But this is not recommended. There is so much source code available on public repositories. No matter the coding task or problem, there is probably already a good solution available somewhere. It is also great that there are so many powerful coding tools available to help you understand, debug, and optimize your code in shape of extensions. However, using open-source code and tools does have risks, and you can leave yourself open to malicious code execution and exploits.

The VS Code extensions ecosystem is incredibly rich and diverse. People have created extensions to help with just about any programming task or editor customization. Most extensions run code on your behalf and could potentially do harm. Some extensions have settings that could cause them to act maliciously if configured to run an unexpected executable. For this reason, extensions that have not explicitly opted into Workspace Trust are disabled by default in Restricted Mode.

So, 'Workspace Trust'
Is it a good security feature?
Are you using it or have you disabled it and and why?
let us know in comments

Thank You!
👍 LIKE VIDEO
👊 SUBSCRIBE
🔔 PRESS BELL ICON
✍️ COMMENT

Channel: webstylepress
Website: https://www.webstylepress.com
FaceBook: Facebook: webstylepress
Twitter: Twitter: webstylepress
GitHub: https://github.com/webstylepress
#webstylepress #tutorials #webdevelopment #vscode #CodeEditor #security
3 سال پیش در تاریخ 1400/07/07 منتشر شده است.
21,145 بـار بازدید شده
... بیشتر