Control which extensions users can install
Control Code - OSS extension installation by using a ConfigMap. Enforce a fine-grained allow or deny list by using the AllowedExtensions policy.
Before you begin
- You have an active
ocsession with administrative permissions to the OpenShift cluster. See This page is not included, but the link has been rewritten to point to the nearest parent document.Getting started with the CLI.
About this task
You can also block installs through the CLI, default extensions, and the workbench.extensions.command.installFromVSIX API command. The following properties are supported:
BlockCliExtensionsInstallation— when enabled, blocks installation of extensions through the CLI.BlockDefaultExtensionsInstallation— when enabled, blocks installation of default extensions. See Pre-install extensions in every workspace.BlockInstallFromVSIXCommandExtensionsInstallation— when enabled, blocks installation of extensions through theworkbench.extensions.command.installFromVSIXAPI command.AllowedExtensions— provides fine-grained control over Code - OSS extension installation. When this policy is applied, already installed extensions that are not allowed are disabled and display a warning. For conceptual background, see Content from code.visualstudio.com is not included.Configure allowed extensions.
Procedure
Results
- Verify that the
BlockCliExtensionsInstallationproperty is applied:- Press F1, select Preferences: Open Settings (UI), and enter
BlockCliExtensionsInstallationin search. - Provide a
.vsixfile and try CLI install. The installation fails with "Installation of extensions via CLI has been blocked by an administrator".
- Press F1, select Preferences: Open Settings (UI), and enter
- Verify that the
BlockDefaultExtensionsInstallationproperty is applied:- Check Settings for the property.
- Configure default extensions and verify they are not installed on workspace start or restart.
- Verify that the
BlockInstallFromVSIXCommandExtensionsInstallationproperty is applied:- Check Settings for the property.
- The
workbench.extensions.command.installFromVSIXAPI command is blocked.
- Verify that rules defined in the
AllowedExtensionssection are applied:- Check Settings →
extensions.allowed. - Disallowed extensions display a "This extension cannot be installed because it is not in the allowed list" warning.
- Check Settings →