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

[wip] nodejs: Flag to disable building with openSSL #20513

Closed
wants to merge 1 commit into from

Conversation

spacekitteh
Copy link
Contributor

Motivation for this change

Some uses for nodejs are not web servers, such as being a build system (looking at you, cjdns). Thus it makes no sense to pull in OpenSSL in these cases. This creates a flag to build without SSL.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Sorry, something went wrong.

@mention-bot
Copy link

@spacekitteh, thanks for your PR! By analyzing the history of the files in this pull request, we identified @gilligan, @cko and @vcunat to be potential reviewers.

@spacekitteh spacekitteh force-pushed the patch-14 branch 3 times, most recently from de41506 to 480b791 Compare November 18, 2016 07:43
@spacekitteh spacekitteh force-pushed the patch-14 branch 2 times, most recently from 414173d to 5101d7b Compare November 18, 2016 08:16
@gilligan
Copy link
Contributor

I actually don't see much use in having an option to disable openssl. So cjdns does not need openssl per se. Why would you need to use it with a nodejs built without ssl support though?

I don't see a good reason for that. Can you explain? Otherwise i would be rather 👎 on this.

@spacekitteh
Copy link
Contributor Author

  1. Minimise attack surface
  2. Until nodejs can be built with LibreSSL, I'd rather not pretend to be secure

@grahamc
Copy link
Member

grahamc commented Nov 19, 2016

I'm also not really sold on the idea.

Re: attack surface, when the attack surface embeds a sizable part of a browser, I'm not sure disabling openssl is really a helpful move. Can you provide specifics on why this is a big improvement?

FWIW OpenSSL is useful for much more than just networking. For example, nodejs's random number generator (while not perfect) depends upon OpenSSL. Removing this functionality will certainly be surprising.

Re: libressl, using LibreSSL doesn't change you from pretending to be secure vs. being actually secure. Secure isn't a binary thing, it is a spectrum and usually you need a threat matrix to really understand what is worth protecting against.

@spacekitteh
Copy link
Contributor Author

Re: attack surface, when the attack surface embeds a sizable part of a browser, I'm not sure disabling openssl is really a helpful move. Can you provide specifics on why this is a big improvement?

It's not too big, but every little bit helps.

FWIW OpenSSL is useful for much more than just networking. For example, nodejs's random number generator (while not perfect) depends upon OpenSSL. Removing this functionality will certainly be surprising.

Indeed, and some node applications need neither SSL nor CPRNGs. :)

Re: libressl, using LibreSSL doesn't change you from pretending to be secure vs. being actually secure. Secure isn't a binary thing, it is a spectrum and usually you need a threat matrix to really understand what is worth protecting against.

Yeah, of course. It does, however, significantly reduce the number of CVEs applicable, which is pretty much always a good thing.

Reguardless, nodejs itself ships with the option to disable SSL (if you look at the changes in the PR, you'll see that I'm merely adding the "--without-ssl" build flag). Likewise, a huge part of the usefulness of nodejs is npm, and there is a enableNpm flag. For something as heavyweight as nodejs, I think having some ability to configure it to your needs is always a good thing.

@gilligan
Copy link
Contributor

Disabling npm has a huge benefit for whenever you are creating runtime production environments which will mostly just invoke some service via node directly. It reduces the closure size considerably.

I do not see the same benefits with the ssl flag. I also do not think that anything that can be configured should also be configured.

@spacekitteh
Copy link
Contributor Author

If a configuration option isn't helpful for you, then leave it at the default. However, there are cases where it option IS useful. I don't understand the objection.

@grahamc
Copy link
Member

grahamc commented Nov 28, 2016

I think the reason this PR hasn't been merged is while it perhaps adds a useful option flag, it also adds extra edge cases that future maintainers need to watch and test for. These edge cases, plus the very likely small user base interested in this feature make it tough for me to justify merging, personally. This seems to me like a patch more appropriate for using local overrides, instead of an in-tree option.

@spacekitteh
Copy link
Contributor Author

Ok.

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.

None yet

4 participants