-
Notifications
You must be signed in to change notification settings - Fork 809
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
Security and centralization issues with NPM packages #905
Comments
I have setup a few different explorations as to remove the dependency upon Git + Yarn Workspaces This uses a feature of https://github.com/braydonf/bcoin/tree/pkg-workspaces Git + NPM w/ Semver This uses a feature of https://github.com/braydonf/bcoin/tree/pkg-git Note: There is however an issue that |
Great work putting together these options. I see benefits of both options but ultimately do not support a monorepo for multiple reasons, so I support git + NPM with semver. The packages were split out to support development of It would require having to install a Will We have a tool specifically made for doing signed release called bpkg and I have explored its usage in #836. I think that we should be doing releases using that for when people want to run All open pull requests would have to be reopened in the main Could you link to the docs where it shows how signature verification works with Some background on the
I agree that it would be ideal to switch to another hashing algorithm as soon as possible. It still seems doubtful that there will be a collision internal to While cloning the repo using I was unable to find a github Even though it would be using Github, we wouldn't be locked into using Github forever because, like you mentioned, any git remote should be able to work. |
Another exploration: Git Submodules (without npm or yarn) This uses a feature of git called submodules to install dependencies via git. There is no need to run https://github.com/braydonf/bcoin/tree/pkg-submodules Use this to clone the branch:
And then build the C/C++ code:
Which is actually running node-gyp, and could be instead:
|
Another exploration: Git Package Manager (gpm) This uses git for package management. It solves all the issues. Signatures are verified and packages are decentralized. The dependencies can be configured with with multiple sources of mirrors. The remotes can be local files, https://github.com/braydonf/gpm
|
Another exploration: Git Committed Modules This commits all https://github.com/braydonf/bcoin/tree/pkg-nodemodules
|
With
I think this comes with benefits. Currently the way to upgrade
Continous integration would run for all of the packages within the repository in the case of
I think this tool is mostly for bundling releases with similar functionality to
While |
Another exploration (combination): Git Semver + Committed Modules (works with npm and yarn) This uses a feature of https://github.com/braydonf/bcoin/tree/pkg-gitmod
Note: Both |
As much as I love the GPM idea, and the tradition of bcoin-org writing our own tools from scratch AND the fact that it solves all our problems and adds features the world needs, I'm worried that it will be problematic for new users. I'm worried that "installing something just to install something" could potentially add more issues than it is worth, especially since Github package registry is a thing, and that's going to be confusing. The next coolest option out of these proposals I think is Git submodules. It uses an application users already have installed, it keeps all the dependencies separate so they can still be accessed by Handshake, and removes npm (as a package repo) from the equation. I'm a little confused about how the versions in The committed module options (Git + Yarn Workspaces) I feel like are not good options simply because Handshake shares dependencies with bcoin, and bcrypto is especially sensitive, I feel like this would make the bcoin commit log really messy, and we'd be dealing with constant updates to bcrypto, possibly incompatibilities between Handshake and bcoin, etc... Finally, Git + NPM w/ Semver was problematic for me due to the use of SSH. I got a dozen I'm going to attempt to summarize everything in a chart, let me know what I get wrong (@braydonf especially where npm checks pakage-lock sha512 hash instead of just the git signed commit)
|
One more thought about GPM: could it be integrated directly into bcoin? I know this sounds ironic because I'm sort of not into mono-repos, but if we could maintain this ease of installation:
I think that would help. (Or some other 3rd command there where the user wouldn't have to even know GPM is doing all the work). |
I think it's important to know how any of these proposals will affect Handshake, and specifically if @chjj has any input -- especially if we are going to consider removing bcoin from npm, so that it can only be installed by a more decentralized, secure process. |
Committing the This is also where packaging to be distributed via operating system package managers will be useful for releases of
Having the complete git tree available for each dependency is useful. There is however a de-duplication issue with that approach, to which there are not tools (
I think this is also another case where having the |
When installing via
git
and verifying signatures, the integrity of the dependent packages is verified using asha512
hash via thenpm
package-lock.json
file. Thus if the installation ofnodejs
withnpm
is verified you can be certain that the packages are correct.However there are a few issues:
npm
or used as a dependency in a package the signature is not verified as it would when installed viagit
.The text was updated successfully, but these errors were encountered: