Skip to content
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

Add lavamoat to prevent install scripts #231

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ukorvl
Copy link
Member

@ukorvl ukorvl commented Feb 7, 2025

This patch adds @lavamoat/allow-scripts package to prevent npm lifecycle scripts running without direct intention of a developer.
This is one of the steps of improving our npm security. Restricting npm lifecycle scripts decreases the possibility of supply chain attacks using malicious npm packages.

How it works? By adding ignore-scripts=true to .npmrc we are restricting all lifecycle scripts by default, ensuring that we don't run occasionally a malicious one. Lavamoat package runs all allowlisted scripts separately.

@lavamoat/preinstall-always-fail always fails on installation and is set to false in lavamoat config to ensure that no script runs unintentionally.

@ukorvl ukorvl self-assigned this Feb 7, 2025
@ukorvl ukorvl force-pushed the add-lavamoat-to-prevent-install-scripts branch from ebc494b to 61301ce Compare February 7, 2025 19:01
@ukorvl ukorvl marked this pull request as draft February 7, 2025 19:16
@ukorvl ukorvl force-pushed the add-lavamoat-to-prevent-install-scripts branch from 61301ce to bc762b3 Compare February 11, 2025 12:25
@ukorvl ukorvl force-pushed the add-lavamoat-to-prevent-install-scripts branch from bc762b3 to 7fad3a8 Compare February 11, 2025 12:45
@ukorvl ukorvl requested review from KlonD90 and Rolaman February 11, 2025 14:38
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.

1 participant