Skip to content

Conversation

@jespino
Copy link

@jespino jespino commented Dec 4, 2025

Disable npm/yarn lifecycle scripts and npx in the devcontainer for security.

Changes

  • Create .devcontainer/Dockerfile with security configurations
  • Update .devcontainer/devcontainer.json to use the new Dockerfile

Security configurations

  • npm config set ignore-scripts true - disables npm lifecycle scripts
  • ignore-scripts true in .yarnrc - disables yarn lifecycle scripts
  • Replace npx binary with error message stub

Fixes PDE-183

- Create Dockerfile with ignore-scripts configuration for npm/yarn
- Disable npx with informative error message
- Update devcontainer.json to use the new Dockerfile

Fixes PDE-183

Co-authored-by: Ona <[email protected]>
@jespino jespino force-pushed the jesus/pde-183-disable-npm-lifecycle-scripts-in-gitpod-sdk-typescript branch from 481ec5c to f98e706 Compare December 4, 2025 16:06

```sh
$ npx prism mock path/to/your/openapi.yml
$ yarn add -D @stoplight/prism-cli
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI This just avoids npx for now, version pinning following in a follow-up PR

echo 'ignore-scripts true' >> ~/.yarnrc

# Disable npx for security
RUN rm -f /usr/bin/npx /usr/local/bin/npx && \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

We could use $(which npx) to make this more reliable across repos

Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants