-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Allowed Extension policy not working as expected #236429
Comments
@isidorn I have created a new issue, I tried to add screenshots but failed, hope you guys understand the steps to reproduce the problem! |
Just found out that if the settings.json file contains extensions.allowed section, the entire content will be wiped when the policy is being applied!! |
@rtpub88 thanks for filling this issue
Well that is expected. The policy has priority. And should be documented @ntrogh But from your initial comment it looks like this is a real issue, that users can enhance the policy by adding additional extensions via settings.json allowed list. This should not be allowed. This contradicts with your last comment - are you sure that the policy is indeed getting applied in your case? |
@isidorn I don't know why I cannot upload images in here, but I have screenshots to prove that user can indeed enhance the policy by adding extensions in settings.json; if you follow through the repo steps, you should see that:
I think the settings will remain active until the next user logon where the settings.json will be wiped clean!! (not just the extension settings) |
Can you please share the following logs
|
@sandy081 I have tried the following:
Here is the Main log
and Windows log
Here is the Main log
and Windows log
|
@rtpub88 Thanks for the logs. Looks like we would need trace information. Sorry for not mentioning this earlier. Can you please enable log level to trace and share the logs again?
|
@sandy081 here are the logs for reference Main log Window log |
* recovery fix for #236429 * fix tests * fix tests
* recovery fix for #236429 * fix tests * fix tests
This comment has been minimized.
This comment has been minimized.
@rtpub88 thank you very much for reporting this issue and providing great details! |
Does this issue occur when all extensions are disabled?: Yes/No
Steps to Reproduce:
1. Set up a group policy with AllowedExtensions enabled
In Computer Configuration > Administrative Templates > Visual Stuudio Code > Extensions set
AllowedExtensions = '{ "ms-vscode.powershell": "stable", "ms-vscode.hexeditor": "stable" }'
2. Apply policy to the PC
Run "gpupdate /force" on the PC and confirmed that the enabled extensions are applied in VS Code
3 - Edit user's settings.json using VS Code
In the user's settings.json file, add the following section:
"extensions.allowed": {
"ms-vscode.PowerShell": true,
"ms-vscode.hexeditor": [ "1.11.1", "1.11.0" ],
"redhat": "stable:",
}
After the changes, verify that the added section is dimmed in VS Code (when hovering the mouse pointer over the added section the popup message should read "This setting cannot be applied because it is configured in the system policy. ..."
4. Search extensions and check results
Search for "redhat" in VS Code extension UI and in this example setup, all extensions by Red Hat can be installed
The text was updated successfully, but these errors were encountered: