How it works
After you deploy the VS Code script to your developer machines, Package Firewall handles extension installation requests as follows:1
Point VS Code at Package Firewall
The VS Code script sets the
extensionsGallery.serviceUrl in VS Code’s product.json to your Package Firewall URL. Thereafter, VS Code requests extensions from Package Firewall instead of the Microsoft Marketplace.2
Filter extension requests
Package Firewall checks each requested extension against your policy and returns only the versions that meet it. A version that does not meet the policy is never offered for installation.
Before you begin
Create an API key dedicated to the Package Firewall so that the deployment scripts can authenticate to it. You can create it through one of the following methods:- Using the Endor Labs user interface, with the Package Firewall User role. See API keys to learn more.
- Using endorctl, with the
SYSTEM_ROLE_PACKAGE_FIREWALLrole. Make sure to install and configure endorctl before you create the key.
<namespace>with your namespace.<API key name>with the name of the API key for the Package Firewall use case.<YYYY-MM-DDTHH:MM:SSZ>with the API key expiration in ISO 8601 UTC format, for example2026-12-31T23:59:59Z.
Set up the deployment script
Generate the VS Code script, then push it to your developer machines with your MDM tool. See MDM deployment for the upload steps.If you use Endor Labs with an EU tenant, select the EU region in the generator so the script uses
https://factory.eu.endorlabs.com.Enable VS Code on macOS
On macOS, the VS Code script andendor-all.sh leave VS Code unchanged by default. They print a message that explains how to enable the firewall. Linux and Windows are not affected.
To enable it in the browser generator, select Enable VS Code firewall on macOS before you download the script. For local generation, set ENDOR_VSCODE_MACOS_DAEMON=1:
/Applications/Visual Studio Code.app. Restart VS Code after initial deployment if it is open.
The daemon checks a copy of VS Code in a directory that only root can access. It patches and signs that copy with a certificate unique to the Mac, then swaps it into /Applications. This avoids breaking the installed app’s signature by editing it in place. The signing key stays in the System keychain, and you cannot export it.
When VS Code downloads an update, the daemon prepares a patched, signed copy before the updater installs it. If preparation fails, VS Code can install Microsoft’s build, and the daemon handles it afterward. Keep this possible gap in mind when planning enforcement.
At the keychain prompt for Code Safe Storage, select Always Allow to let VS Code access saved sign-ins. Denying access hides those sign-ins for that session without deleting them. The re-signed app is no longer notarized by Microsoft. The daemon refuses apps with an unexpected signer or changes beyond its own managed patch.
If a daemon from an earlier deployment is still installed, a script generated without the option leaves the daemon running, prints a warning, and exits with code 1. Regenerate with the option enabled to keep the daemon, or deploy endor-remove.sh to remove it.
Check the daemon
Run these commands as root to inspect the daemon’s status and recent log entries:Remove the daemon
Deployendor-remove.sh to restore Microsoft’s original app and remove the signing identity. If no original is available, the script restores the default gallery settings in a copy. A copy signed by the daemon stays re-signed until VS Code’s next update replaces it with Microsoft’s build.
Policy
A Package Firewall policy for VS Code extensions supports the malware and minimum package age conditions. Package Firewall removes extension versions that meet a condition from Microsoft Marketplace results. If no version remains, or a developer downloads a version directly, Package Firewall blocks the request. To always allow a specific extension, add an exception using the extension’s identifier inpublisher.name form, such as ms-python.python. This identifier appears as the unique identifier on the extension’s Marketplace page, and in the extension’s details in VS Code. You can allow all versions of the extension, a specific version, or a range of versions. See Package Firewall policy to learn more.
Limitations
Keep the following limitations in mind when using Package Firewall for VS Code extensions:- Package Firewall covers only the extensions available in the Microsoft Marketplace, the default for official Microsoft builds of VS Code. It does not cover the Open VSX registry, which is the default for VSCodium and Cursor.
- Extensions installed from a downloaded
.vsixfile do not go through the Marketplace, so Package Firewall cannot filter them. Disable file-based installation with a VS Code enterprise policy to close this gap. - For an extension that publishes thousands of versions, Package Firewall may not check the oldest ones. If Package Firewall blocks every version it checks, you cannot install the extension.