-
Notifications
You must be signed in to change notification settings - Fork 41
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
Verify integrity of dependencies in production with yarn #10714
Comments
Where should we run the |
Probably right before we run but I don't think we should spend time on this issue yet. I have a feeling we need to solve #10400 first which may not be so trivial. |
@kumar303 we could probably install the dependencies with |
Two npm packages we rely on were recently compromised. They were for development only but they could have been production deps all the same.
Bumping up priority |
yarn check
Well, huh, I'm not sure exactly how I don't know if that would have helped us pin the version of The goal for this issue is to make sure a production install never upgrades a package beyond what we have committed to master. |
I suppose that's the aim of the |
We should consider |
If I understand correctly, that would mean committing all the production node modules in this repo? Isn't it a bit too much (in terms of solution vs problem to be solved)? |
@kumar303 so it results in 60MB of tar packages to add to our repo if we go for the offline mode. Also, it will mean everyone has to use that and updating packages is a bit less straightforward. |
Hmm, that does sound annoying. |
The docs for |
lol, I thought I left the exact same comment before. Yeah, I was looking at the docs and issues and code to see what the differences are, and which one we should be using, and also why it is not the default behavior. 🤦♂️ |
So apparently, both do what we want except that |
I think |
So here are the PRs for the two options:
I just noticed that the |
The |
Making |
Sorry if the requirements of this issue were vague. It was also confusing because it made some assumptions about |
Quoted from: https://yarnpkg.com/blog/2016/11/24/offline-mirror/
So.. I suppose we are quite safe now that we use the lock file? An offline mirror seems useful to install packages without an Internet connection, but it seems Yarn does what we want:
|
ping @kumar303 |
I created a demo project and two dependencies to test it: https://github.com/willdurand/pkg-app. Lockfile is used by |
I am closing this issue now that it has been verified. If you want to verify it:
If you remove the If you discard your changes ( |
After #9965 we will be using
yarn
to install dependencies in production.Let's make sure all packages get installed without any surprises.
yarn check
)This issue is about preventing malware on NPM from creeping into a production build (see the eslint malware scenario as an example). It would still be possible for a developer to unknowingly introduce malware when upgrading a dependency -- that problem is out of scope.
The text was updated successfully, but these errors were encountered: