Skip to content

Instantly share code, notes, and snippets.

@yoshuawuyts
Last active March 25, 2016 15:27
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoshuawuyts/230364f2f3f745f922f4 to your computer and use it in GitHub Desktop.
Save yoshuawuyts/230364f2f3f745f922f4 to your computer and use it in GitHub Desktop.

npm issues

npm had a security meltdown, what can we do?

This is a hard problem to solve, because it all comes down to trust. npm will probably try and solve parts of this (they have to now), but we should also be taking action on our end.

Immediate actions

Mid-term actions

  • Hook into nodesecurity.io and / or snyk.io to stay on top of security issues
  • Hook into greenkeeper.io to not have outdated dependencies
  • [unsolved] detect if any package in your dependency tree has been unpublished before pulling it in - unpublishing means owner ship change could compromise; should run before npm install

Long-term actions

  • prune dependency tree - less dependencies is less untrusted code, which means less things can go wrong - dependency-check can help with this
  • never run things as root
  • lock down production permissions - use unix profiles and downgrade to change profiles after program is finished setting up - makes exploits harder to use
  • lock down external connections - use apparmor / bane to lock down permissions (commands, filesystem, network, etc.)
@yoshuawuyts
Copy link
Author

It seems npm is going to make unpublishing a lot harder, and take steps to prevent historical deps from breaking builds, making the dep tree error thing a lot harder to do. - Let's see what they come up with.

@Flet
Copy link

Flet commented Mar 24, 2016

Thanks for writing this up! I did not know about unpublished-dependencies :)

The nodesecurity.io link has a small typo.

@FagnerMartinsBrack
Copy link

FWIW @nj48 was friendly in case nobody saw this yet: https://twitter.com/seldo/status/712673227630313472. It wasn't explicit in the npm blog post.

@knksmith57
Copy link

Typo in link for nodesecurity.io.

It reads correctly but actually links to https://nodescurity.io (ironic!)

edit: @Flet already pointed this out, sorry for the dupe!

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