Join our Newsletter — 33% off our NHI Course
Home› Guides› Developer Workstation and IDE Security Guide: Extensions, Dev…
Guide Software & AI Supply Chain

Developer Workstation and IDE Security Guide: Extensions, Dev Containers and Local Secrets

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 27 October 2026 16 min read
On this page

A developer laptop holds the keys to the software supply chain, and most organisations protect it no better than a sales laptop. The same machine that runs untrusted extensions, clones unfamiliar repositories and executes package install scripts also holds npm and PyPI publishing tokens, cloud CLI sessions, SSH keys and personal access tokens with write access to production repositories. This guide covers the three controls that matter most on that machine: governing IDE extensions, isolating untrusted code with Workspace Trust and dev containers, and removing long-lived secrets from the local disk. It is written for platform, endpoint and application security teams who manage developer fleets, and it uses VS Code and compatible editors as the worked example because their controls are the best documented. AI coding agents are covered separately in the AI IDE and Coding Agent Security Guide.

Key takeaways

  • Extensions run with your privileges. The VS Code extension host has the same permissions as the editor itself: it can read and write files, open network connections and start processes, so an extension is code execution, not a plug-in setting.
  • Allowlist centrally, not by guidance. The AllowedExtensions policy (backed by the extensions.allowed setting since VS Code 1.96) blocks and disables anything not explicitly allowed and overrides what users set.
  • Opening a repository can run code. Tasks, debug configurations, workspace settings, dev container lifecycle commands and package install scripts all execute on open or on first build; Workspace Trust and ignore-scripts are the brakes.
  • Dev containers isolate the project, not the developer. initializeCommand runs on the host, Git credentials are shared into the container, and privileged or a mounted Docker socket removes most of the boundary.
  • The real prize is the token. Workstation malware such as GlassWorm targets npm, GitHub and extension marketplace tokens; short-lived, hardware-bound and federated credentials limit what a compromise yields.

Why the developer workstation is a supply chain entry point

Attackers who compromise a developer machine rarely want the laptop. They want what it can publish or push. MITRE ATT&CK tracks this under T1195.001 Compromise Software Dependencies and Development Tools, and has a dedicated sub-technique, T1176.002 IDE Extensions, for persistence through editor add-ons. The incident pattern repeats: a malicious or hijacked extension or package runs on the workstation, harvests tokens from files and credential stores (T1552.001 Credentials In Files, T1555 Credentials from Password Stores), and uses them to publish more malicious versions, which is how a single infection becomes a worm.

The GlassWorm campaign showed every step. Extensions on Open VSX and the Visual Studio Code Marketplace hid code in invisible Unicode characters, stole npm, GitHub, Git and Open VSX credentials, and added remote access to developer machines. Separately, researchers found more than 550 validated secrets inside published VS Code extensions, including over 100 Marketplace personal access tokens that could push updates to existing installs, as covered in the secrets in VS Code extensions breach page. The defensive lesson: treat developer endpoints as high-value assets, closer to a privileged access workstation than to general office endpoints.

Entry pointWhat executesWhenPrimary control
IDE extension install or auto-updateExtension code in the extension host with user privilegesOn activation, often at editor startAllowedExtensions policy, private marketplace
Repository .vscode/tasks.json, launch.json, workspace settingsShell commands and tool paths chosen by the repository authorWhen tasks or debug sessions runWorkspace Trust (Restricted Mode)
devcontainer.json and image labelsinitializeCommand on the host, lifecycle commands and Feature install.sh in the containerOn "Reopen in Container" or rebuildTrust prompt, reviewed and pinned images and Features
Package manager install scriptspreinstall, install, postinstall lifecycle scriptsOn npm install and similarignore-scripts, release age delay, lockfiles
Dotfiles repositoryThe dotfiles install scriptEvery container creationOwned, reviewed dotfiles repository
Local secrets on diskNothing: the stealer just reads themWhenever any of the above runsShort-lived and hardware-bound credentials

Governing IDE extensions

Marketplace defences are real but partial. Microsoft documents that the Visual Studio Code Marketplace scans each new extension and update with several antivirus engines, runs extensions in a sandboxed clean room VM to check behaviour, blocks name squatting of official publishers and popular extensions, signs extensions at publish time and verifies the signature at install, scans new extensions for secrets, and removes extensions verified as malicious, with VS Code then uninstalling them automatically. Since VS Code 1.97 users are also asked to confirm trust in a third-party publisher on first install. None of this stops a legitimate publisher's account being hijacked, and compatible editors that use Open VSX or other registries get a different set of checks.

The allowlist

The enforceable control is the extensions.allowed setting, deployed as the AllowedExtensions policy through Group Policy, Intune, a macOS configuration profile or another device management tool. Facts from the VS Code enterprise documentation:

  • Keys: a key with no period is a publisher ID ("github": true); a key with a period is a full extension ID ("esbenp.prettier-vscode": true). "*" is the only wildcard.
  • Versions: an array pins exact versions (["3.0.0"]), with optional platform suffix such as 5.0.0@win32-x64. Ranges are not supported. The value "stable" allows releases and blocks pre-releases.
  • Precedence: the more specific rule wins, so "microsoft": true with "microsoft.cplusplus": false allows every Microsoft extension except that one.
  • Effect: anything not matched is blocked, and an installed extension that becomes blocked is disabled.
  • Enforcement: the policy overrides the user setting on managed devices. A syntax error means the allowlist is not applied at all, so check the Window log after every policy change.

Choosing an allowlist model

ModelHow it worksStrengthWeaknessFits
Publisher allowlistAllow whole publishers (your own, the editor vendor, a short list of trusted ones)Low maintenanceA hijacked publisher account ships straight throughSmall teams starting out
Extension ID allowlistAllow named extensions, any versionBlocks lookalikes and new unknown extensionsMalicious updates to an allowed extension still installMost organisations as a baseline
Version-pinned allowlistAllow named extensions at exact versionsMalicious updates blocked until reviewedHigh review load; every update is a change requestRegulated or high-value build teams
Private marketplaceSelf-hosted marketplace upstreaming approved public extensions (GitHub Enterprise customers)Central curation, works for air-gapped estatesNot supported from VS Code Server or VS Code for the Web; operating costLarge enterprises, isolated networks

For forks and compatible editors, confirm which registry they use and whether they honour the same policy before you claim coverage. The GlassWorm VS Code Extension Worm Guide covers the campaign-specific indicators; the same governance logic for browsers is in the Browser Extension Security Guide.

Workspace Trust: stopping a repository from running code on open

A cloned repository can carry .vscode/tasks.json, launch configurations and workspace settings that point tools at attacker-chosen binaries. Workspace Trust opens unfamiliar folders in Restricted Mode, in which, per the VS Code documentation, AI agents are disabled, the integrated terminal is blocked until trust is granted, running or even listing tasks prompts for trust, starting a debug session prompts for trust, settings tagged requireTrustedWorkspace are not applied, and extensions that have not declared Workspace Trust support are disabled or limited.

SettingDefaultRecommended managed valueWhy
security.workspace.trust.enabledtruetrue, enforcedTurning it off removes Restricted Mode entirely
security.workspace.trust.untrustedFilespromptnewWindow for high-risk teamsFiles from outside trusted folders open in a Restricted Mode window
security.workspace.trust.emptyWindowtruefalse where practicalEmpty windows otherwise start trusted
security.workspace.trust.startupPromptneveronceMakes the trust decision visible on first open
terminal.integrated.allowInUntrustedWorkspacenot setLeave unsetOnly safe if the shell itself blocks automatic code execution
extensions.supportUntrustedWorkspacesnot setDo not override vendor restrictionsAuthors restrict extensions for reasons

The common weakness is trusting a parent folder. Trust on ~/src or C:\code is inherited by every subfolder, so every repository cloned there later is trusted silently. Keep a trusted path for your organisation's own repositories and a separate, untrusted path for third-party code, reviews and proof-of-concept clones. The --disable-workspace-trust command-line switch disables the feature for a session, so watch for it in shortcuts and wrapper scripts.

Dev containers: useful isolation with sharp edges

Dev containers move the toolchain and the project's dependencies into a container, which keeps install scripts and build tools off the host filesystem. The Dev Container specification and VS Code documentation show where the boundary leaks:

  • Host execution: initializeCommand runs on the host machine, wherever the source code sits, before the container exists. Review it like any script in the repository.
  • Inherited configuration: image labels can carry dev container metadata, including remoteUser and postCreateCommand, and are picked up when an image is referenced through a FROM line or Compose file. A base image you did not write can change what runs.
  • Features: each Dev Container Feature is installation code with its own install.sh. Pin Features by version and source them from a registry you control.
  • Privilege flags: privileged, capAdd, securityOpt, mounts and runArgs can grant the container host-level access. A mount of the Docker socket or the user's home directory, or --privileged, means container compromise is host compromise.
  • Credentials: if the repository was cloned with a Git credential manager, the container already has access to those credentials, and SSH keys can be shared in through the agent. Malicious code in the container can use them.
  • Dotfiles: dotfiles.repository and dotfiles.installCommand clone a repository and run its install script on every container creation.
  • Ports: forwardPorts exposes ports on localhost only; appPort and Compose ports publish them on the host network.
  • Remote daemons: using a remote Docker daemon means trusting that host, with no extra prompt.

VS Code asks for Workspace Trust when reopening a folder in a container, attaching to a container or cloning into a volume, which is the moment to read devcontainer.json. Container base image hygiene is covered in the Container Image Security Guide.

Package managers on the workstation

Most package worms execute through install-time lifecycle scripts. npm offers controls that belong in a managed user or global .npmrc:

  • ignore-scripts=true: npm does not run scripts from package.json files during install. Explicit commands such as npm test still run their named script but skip pre and post scripts. Expect some packages with native builds to need a documented exception.
  • min-release-age: installs only versions published at least the given number of days ago (the before date option takes precedence if both are set). A short delay means most malicious versions are found and removed before they reach your machines.
  • allow-git=root or none: limits dependencies that point at Git references, which bypass registry controls.
  • strict-ssl=true: the default; make sure no proxy workaround has disabled it.

Commit lockfiles and use npm ci so a workstation build reproduces the reviewed tree. The full set of npm options, and equivalents for other ecosystems, is in the npm Install-Time Security Guide.

Where identity fits: local secrets and developer tokens

Everything above reduces the chance that hostile code runs. This section reduces what it can steal. Credential stealers sweep the same places on every machine: ~/.npmrc, ~/.pypirc, ~/.aws/credentials, ~/.config/gcloud, ~/.kube/config, ~/.docker/config.json, ~/.ssh, .env files in project folders, shell history and the extension secret storage of the editor. Each of these is a non-human identity credential acting with the developer's authority.

CredentialTypical weak stateStronger state
GitHub accessClassic PAT with repo scope, no expiry, in a dotfileGitHub CLI or Git Credential Manager sign-in; fine-grained PAT scoped to one owner and selected repositories, with expiry and organisation approval
SSH key for GitUnencrypted id_rsa on diskHardware-backed ed25519-sk key (or ecdsa-sk) needing a physical touch
Package publishingLong-lived npm or PyPI token in .npmrc or .pypircNo publishing token on laptops at all: publish from CI with trusted publishing (OIDC)
Cloud CLIStatic access keys in a credentials fileSSO sessions with short lifetimes; role assumption per task
Application secrets for local runsProduction values in .envDevelopment-only values, fetched at run time from a secrets manager
Extension marketplace PATBroad Azure DevOps PAT on the publisher's laptopPublish from CI, narrow scope, short expiry, rotated after any incident

GitHub's own documentation recommends fine-grained tokens over classic tokens, notes that classic tokens can reach every repository the user can access, and removes tokens unused for a year. The PAT is still a bearer secret: if it sits in a file, assume a stealer will find it. Publishing tokens deserve special attention because they turn a single infection into a worm; see the npm Trusted Publishing and Provenance Guide and the PyPI API Tokens and Trusted Publishing Security Guide. Scan local repositories and dotfiles with the approaches in the Git Secret Scanning Guide.

Rolling out a developer workstation baseline

  1. Inventory first: collect installed extensions (from the extensions folder or code --list-extensions --show-versions run by your management agent), editors and forks, container runtimes and credential files present. You cannot write an allowlist without this.
  2. Classify developers: separate maintainers who can publish packages or merge to protected branches from everyone else. They get the strict tier first.
  3. Remove publishing tokens from laptops: move package and extension publishing to CI with trusted publishing, then revoke the old tokens. This is the highest risk reduction per hour spent.
  4. Pilot the allowlist in report mode: build the list from inventory, deploy it to a pilot ring of 20 to 50 developers, and collect blocked-extension requests for two weeks. Add a fast request path (same day) or developers will find workarounds.
  5. Enforce Workspace Trust settings and .npmrc defaults through device management, with a split between trusted and untrusted clone paths.
  6. Standardise dev container images and Features in an internal registry, forbid privileged and Docker socket mounts by policy, and lint devcontainer.json in code review.
  7. Expand in rings once the request queue settles. Rollback is a policy change: revert the AllowedExtensions value (remember that a malformed value silently disables the list, which is a failure mode, not a rollback method).

For small teams, steps 3 and 5 plus an extension ID allowlist give most of the value. Large organisations should add version pinning or a private marketplace for publishing maintainers and build engineers, and treat their machines under the Privileged Access Workstations Guide model.

Detection and measurement

  • Process lineage: alert when the editor, its extension host or node spawned by a package manager launches shells, curl, archive tools or network utilities that are unusual for that user. EDR rules on parent process Code.exe or code helper processes are a good starting point.
  • Credential file access: monitor reads of .npmrc, .aws/credentials, .ssh and browser credential stores by processes other than their normal clients.
  • Extension changes: log installs and updates of extensions, especially outside the allowlist or from compatible-editor registries.
  • Token use from new places: registry and GitHub audit logs showing a developer token used from an unfamiliar IP or ASN, or a publish event outside CI.
MetricTarget
Managed developer devices with AllowedExtensions enforcedAbove 95%
Long-lived publishing tokens present on workstationsZero
Classic GitHub PATs with no expiry in the organisationTrending to zero
Median time to approve an extension requestUnder one working day
Dev container definitions using privileged or a Docker socket mountZero without a recorded exception

Common failure patterns

  • Trusting the whole source folder: one click on a parent folder makes every future clone trusted, so Restricted Mode never appears.
  • Publisher-only allowlists: a hijacked publisher account, or an allowed extension whose update turns malicious, passes straight through. The GlassWorm "sleeper" extensions that turned malicious after later updates are the case for version pinning on high-value machines.
  • Policy that never applied: a syntax error in the AllowedExtensions value disables the allowlist with nothing visible to the user.
  • Publishing from laptops: long-lived npm and marketplace tokens on maintainer machines are what let stealers republish packages, the mechanism in the Shai-Hulud npm worm.
  • Treating dev containers as a sandbox: a mounted Docker socket, --privileged and shared Git credentials mean malicious code in the container reaches the host and the repositories.
  • Secrets inside packaged artefacts: .env and configuration files bundled into published extensions exposed hundreds of live tokens; removing them from a later version does not revoke them.

Framework mapping

FrameworkReferenceRelevance
NIST SP 800-218 (SSDF 1.1)PO.5 Implement and Maintain Secure EnvironmentsSeparating and hardening development environments and endpoints
NIST SP 800-53 Rev. 5CM-7(5) Authorized Software, Allow-by-exception; CM-11 User-installed SoftwareExtension allowlisting
NIST SP 800-53 Rev. 5IA-5 Authenticator Management; AC-6 Least Privilege; SA-15 Development Process, Standards, and ToolsToken lifetime and scope, tooling standards
NIST CSF 2.0ID.AM-02, PR.PS-02, PR.AA-05, DE.CM-09Software inventory, maintenance, least privilege, endpoint monitoring
MITRE ATT&CK v20T1195.001, T1176.002, T1552.001, T1555, T1528Development tool compromise, IDE extension persistence, credential theft

Practitioner checklist

  • Inventory extensions, editors and forks, and credential files across the developer fleet.
  • Deploy the AllowedExtensions policy, pilot it, and verify in the Window log that it applied.
  • Pin versions or use a private marketplace for maintainers and build engineers.
  • Enforce Workspace Trust and keep separate trusted and untrusted clone paths.
  • Set ignore-scripts, min-release-age and allow-git in a managed .npmrc, with a documented exception path.
  • Ban privileged, Docker socket and home directory mounts in devcontainer.json without an exception.
  • Move all package and extension publishing to CI with trusted publishing, then revoke laptop tokens.
  • Replace classic PATs and unencrypted SSH keys with credential manager sign-in, fine-grained expiring tokens and hardware-backed SSH keys.
  • Alert on editor and package manager process chains that touch credential files or open unusual network connections.
  • Rehearse the response: which tokens to revoke, in which order, when a developer machine is suspected.

Standards and references

Related NHI Mgmt Group resources: AI IDE and Coding Agent Security Guide · GlassWorm VS Code Extension Worm Guide · npm Install-Time Security Guide · Malicious Package Worm Response Playbook

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 27 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.