I'm working on an app where security is an issue, and among the (many) things that I'm frothingly paranoid about is the possibility of malicious (or more likely just untested) code somehow getting into our app, even though we're using shrink-wrapped versions. It means we'll have to be much more careful with the way we proxy the npm registry.
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
Google "nodejs lockdown lloyd"That should be easy enough to get started
Ideally modules should be signed by author and a couple more people to validate origin.
Nodejitsu sells a private npm product, with it comes full control over all things
You are right to be concerned: anyone that has a module you use can effectively attack you. All it takes is for their credentials to be compromised, credentials which I believe are just a plain text file on your home. I've raised this issues more than 2 years ago and it seems be a recurring one right now. So understanding this is how npm works and creating security validation processes for your releases is a good idea
You can also check the node security project
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
It resulted in huge node_modules folder checked in (with binary deps because nobody cared), they weren't updated at all (and were outdated for like a year).
And the worst thing is that when people find bugs in modules, they actually commit their change directly to node_modules!
1.2.3 A specific version. When nothing else will do. Note that
build metadata is still ignored, so 1.2.3+build2012 will satisfy
this range.Google "nodejs lockdown lloyd"That should be easy enough to get startedIdeally modules should be signed by author and a couple more people to validate origin.Nodejitsu sells a private npm product, with it comes full control over all thingsYou are right to be concerned: anyone that has a module you use can effectively attack you. All it takes is for their credentials to be compromised, credentials which I believe are just a plain text file on your home. I've raised this issues more than 2 years ago and it seems be a recurring one right now. So understanding this is how npm works and creating security validation processes for your releases is a good ideaYou can also check the node security projectHope this is helpfulNuno
On Thursday, December 19, 2013, Alex Kocharin wrote:
No idea why. I think it would be reasonable for npm registry to allow unpublishing, but deny republishing an exactly the same version number afterwards. So if something needs to be republished, maintainer will be forced to change version number (or add a build number although it's now ignored by npm).You can try to use caching npm registry, for example this one:It wasn't specifically created for ensuring immutability, but it's a nice side effect. Once certain package (tarball) is cached there, all subsequent changes in npm registry will simply be ignored. This way I was able to detect changes in bson v0.2.3 deep inside our dependency tree, although nothing harmful was there.Anyway, if you're thinking about security, I'd suggest to bring up another issue. Signed packages. Without them it's hard to rely even on your own published packages. Although I'm not quite sure how to implement this properly, I feel it really needs some attention.18.12.2013, 16:23, "Richard Marr" <richar...@gmail.com>:
This is probably a stupid/tired question, but why does npm allow mutable packages?
I'm working on an app where security is an issue, and among the (many) things that I'm frothingly paranoid about is the possibility of malicious (or more likely just untested) code somehow getting into our app, even though we're using shrink-wrapped versions. It means we'll have to be much more careful with the way we proxy the npm registry.
As a secondary point, I would have thought immutable packages would allow for much better caching behaviour, so reduce load on the registry itself and speed up npm for everybody.
--
Richard Marr
--
20.12.2013, 00:13, "Sam Roberts" <s...@strongloop.com>:
> On Wed, Dec 18, 2013 at 5:42 PM, Alex Kocharin <al...@kocharin.ru> wrote:
>
>> So if something needs to be republished, maintainer will be
>> forced to change version number (or add a build number although it's now
>> ignored by npm).
>
> I've found force republish invaluable in the last weeks when publishes
> to npmjs.org silently half-work, leaving the tarball missing from
> cloudfare. I'd prefer a build number, but like you say, its not
> respected by npm, and I'm not really happy with having to use patch
> number as a publish-retry number.
What about using fourth number for it? Like "1.2.3-4"? If you document out what this versioning means, it'll be fine since immutability is much more valuable here than strict adherence to semver (which is proven to be a bad default anyway).
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Mikeal,To sum up the way I currently see it, switching to immutable packages would:* solve a whole class of subtle problems caused by unrequested code changes
* allow aggressive caching, reducing the cost of the npm registry and making npm use faster for most use cases
* change behaviour only for version-locked dependencies when that (and only that) specific patch is unpublished
That's two HUGE wins, and one downside. The downside can be reduced into obscurity being very rare by making it hard to unpublish, so that authors only bother to do it if they genuinely need to... i.e. serious legal or security reasons... cases where it's actually the right thing to do to break dependent apps.
From what I've heard so far, force republish is mainly used to keep patch numbers slow and sequential, which seems like a much lower priority requirement than introducing behaviour changes silently and unexpectedly into dependent apps.
Please do contribute more if you have more time... I do want to understand the root cause of your replies, and please set me straight if I've missed or misunderstood any of your comments
RichOn 19 December 2013 23:49, Mikeal Rogers <mikeal...@gmail.com> wrote:They won't :)Oh well :)It's better for things to work than for everyone to agree.-MikealOn Dec 19, 2013, at 3:47PM, Alex Kocharin <al...@kocharin.ru> wrote:Well okay, just one silly argument. How will these people know that they're doing the wrong thing if nothing will ever break? :)20.12.2013, 03:42, "Mikeal Rogers" <mikeal...@gmail.com>:First off, if someone version locks they are already doing the wrong thing. Saying "make my package ignore bugfix releases" is almost always the wrong thing. In this case it's better to keep their package working for them since they clearly don't know what they're doing.If they **really** didn't want any changes coming in that they didn't know about then they had two other options that would still work: 1) check the module in to git if they are deploying at app or shrinkwrap publish if it's not something being deployed 2) stick the md5 in package json to ensure nobody can give them another tarball for the same version.We have to deal with what people are doing in practice when they don't necessarily understand the best practice and it's especially important when you maintain a common dependency to do what you can to keep everyone who relies on you working even when they don't do things correctly.-Mikeal
* allow aggressive caching, reducing the cost of the npm registry and making npm use faster for most use casesthis isn't an issue. the cache control can, and must, be proactively invalidated on _changes from the database for document urls anyway, it's trivial to do the same for tarball changes. it can literally cache forever so long as it responds to pro-active invlaidation.
* change behaviour only for version-locked dependencies when that (and only that) specific patch is unpublishedi'm not disagreeing with you but when you say things like "change in behavior" you're sort of sugar coating the fact that packages will fail to install at a greater rate than they do now. this "change in behavior" is not trivial, there is no notice sent to someone when their package can no longer resolve a dependency, it will usually require someone to see a failed install, report an issue, and the maintainer to intervene. the only way to avoid this is to never version lock your dependencies which we know people don't do and that there are tens of thousands of packages in npm today with some number of version locked deps.
23.12.2013, 04:36, "Mikeal Rogers" <mikeal...@gmail.com>:* allow aggressive caching, reducing the cost of the npm registry and making npm use faster for most use casesthis isn't an issue. the cache control can, and must, be proactively invalidated on _changes from the database for document urls anyway, it's trivial to do the same for tarball changes. it can literally cache forever so long as it responds to pro-active invlaidation.HTTP caches know nothing about _changes feed.
* change behaviour only for version-locked dependencies when that (and only that) specific patch is unpublishedi'm not disagreeing with you but when you say things like "change in behavior" you're sort of sugar coating the fact that packages will fail to install at a greater rate than they do now. this "change in behavior" is not trivial, there is no notice sent to someone when their package can no longer resolve a dependency, it will usually require someone to see a failed install, report an issue, and the maintainer to intervene. the only way to avoid this is to never version lock your dependencies which we know people don't do and that there are tens of thousands of packages in npm today with some number of version locked deps.Patching npm to treat "1.2.3" like "~1.2.3" as a fallback would solve this task. I know it's ugly, but it's no less ugly than unpublishing-republishing practice, because you essentially doing the same thing.
// alex
On Dec 22, 2013, at 4:45PM, Alex Kocharin <al...@kocharin.ru> wrote:23.12.2013, 04:36, "Mikeal Rogers" <mikeal...@gmail.com>:* allow aggressive caching, reducing the cost of the npm registry and making npm use faster for most use casesthis isn't an issue. the cache control can, and must, be proactively invalidated on _changes from the database for document urls anyway, it's trivial to do the same for tarball changes. it can literally cache forever so long as it responds to pro-active invlaidation.HTTP caches know nothing about _changes feed.NPM can't sit behind a standard HTTP cache on a TTL because a document change must take effect immediately. The work going in to putting it behind a cache is using a _changes listener to invalidate the cache.
There are good reasons to lock a dependency at a version. I'd love to accept all patch versions, but unfortunately too often a patch version introduces a new bug, or changes the API, and breaks my apps/libs. If I know my app works with a lib at 1.2.3, then my workmates better be able to npm install and get the same working version.
You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/fDs5-Wl3I8c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.
We do check the shasum, using https://npmjs.org/package/lockdown
> and people start to depend on it, it should be hard to remove it.
Are you referring to some central authority you would have to petition to be allowed to remove? I can't imagine any other process that could be implemented to stop me from removing my module.
You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/fDs5-Wl3I8c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.
this is actually why we checkin our deps. we'll fix a module and deploy that fix before the maintainer has accepted it. we don't really see fixes that don't go back in to projects, working with open source maintainers is part of the culture.On Dec 19, 2013, at 3:21PM, Alex Kocharin <al...@kocharin.ru> wrote:It resulted in huge node_modules folder checked in (with binary deps because nobody cared), they weren't updated at all (and were outdated for like a year).this just requires some diligence and using dedupe often.And the worst thing is that when people find bugs in modules, they actually commit their change directly to node_modules!