-
-
Notifications
You must be signed in to change notification settings - Fork 54
Conversation
I, for one, welcome our new secure overlords 😄 . This will be a really useful addition. |
How would this work with requirements of having a named domain for the development cert? |
Another issue: If |
One more concern, a quick review of |
We use SSL for dev and we also got bit by not having a SAN on our devcert. My personal experience with self-signed cert leads me to believe there just a lot of subtleties that are going to make this approach not great. I actually think a better solution would be to have an ember-cli util that can generate a self-signed cert on multiple platforms, put it into a directory in the app, modify the Something like: $ ember generate-ssl-cert --hostnames=localhost,localdev,myappdev
> Cert has been generated (ssl/server.cert and ssl/server.key)
> `.ember-cli` has been modified to use this cert
> You will need to add this cert to your OS keychain, more info can be found at: https://ember-cli.com/user-guide#ssl-cert |
I believe that it would need to be provided, which is why (below) I suggest using a separate command for setting up (separate from
Awesome, thanks for pointing that out @bcardarella!
@workmanw Isn't that what the FWIW, I do agree that there are some ergonomics to work out though. For example:
|
Yep, exactly. The root devcert certificate authority is added to the machine's various trust stores so we can avoid the tedious process of trusting a certificate for each app. I think the benefit devcert (or something like it) provides here is precisely that: it does the tedious trust-the-certificate work, letting you avoid telling the user to "open Keychain Access, add to there with SSL policy, now run brew install certutil, then locate your Firefox profile directory ..."
Thanks for the heads up on this. I'll dig into it, but at first glance looks like an easy fix in devcert.
Ergonomics is definitely important here (well, it's basically the only thing the RFC does 😉). But I'm not sure I see how this would be better. Wouldn't just setting |
Would love this! (Assuming we nail the ergonomics) |
Hmm, this is both interesting and a little scary. I would like to read more about this because adding a CA as trusted to the machine seems like it could potentially open it up to Man-in-the-middle. I'm imagining that the devcert CA's private key is stored on the disk so it could be accessed at runtime by the server to sign a cert. But if an attacker could get that CA private key, they could generate a |
not quite (but still not ideal), as lots of high profile sites (such as gmail) use cert pinning. |
Ah right. That's a good point. |
One additional option might be to leverage a Name Constraints extension, which would let us restrict the available domains that the root CA could sign for to something like |
It appears that macOS might have something that could compensate for their lack of Name Constraint support, but the docs are frustratingly lacking. When devcert adds the root CA to the macOS system keychain, it uses the
It doesn't provide any further detail, and googling around has only turned up this StackOverflow answer which seems to suggest it might restrict the certificate to certain domains:
I'll do some testing to see if I can figure out the behavior ... |
As far as I can tell, the |
Haven't gotten around to updating devcert to support SAN just yet, but just wanted to check about the security concerns above. Does that seem like a showstopper? |
|
||
# Motivation | ||
|
||
Many of the newest web platform features (i.e. service workers) require HTTPS transport. Generating |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that you could also test Service Workers against localhost
:
In order to facilitate local development, localhost is considered a secure origin by browsers as well.
I don't think it is fundamentally a show stopper, but we need to do some due diligence to make sure we are all comfortable (there is little worse than security enhancements that accidentally end up being exploitable). From my perspective, I think we need to do at least the following:
|
@iagox86 if you have any cycles, I would love your input here. Maybe we can chat about it when you are in-town? |
I usually defer to @alexwebr on SSL questions.. maybe he has some insight? |
I'll probably wait until we settle some of the specifics here before tackling this, in case further changes are needed to devcert as well, so I can avoid the additional context switching.
My understanding of cert pinning was that the browser would pin the cert for a server/domain that requested it, and multiple domains could pin the same cert. If that's the case, I'm not sure what we could do on our side to make things more secure via pinning. If we pinned the locally generated certs, that wouldn't prevent an attacker's ability to generate their own certs off the root authority to MITM some third party site that doesn't pin.
An alternative to the vulnerable trusted root CA approach (that I think @rwjblue is hinting at here) is to install a non-CA certificate, per-app, into the system trust stores. This avoids letting attackers generate arbitrary trusted certs, and is better than "sudo prompt every time you run Although - after thinking this over a bit more, the common use case is actually better than I originally thought. Unless users are doing some DNS hackery or editing their hosts file (which is not most people I'm guessing), they'll will be hitting |
@davewasmer What's the MITM scenario you're thinking about, in this case? |
@davewasmer good job on devcert! I think this direction is great, I am glad you have done much of the heavy lifting already. Given some thought to a detailed design/workflow:
Is it possible for us to create one-shot (per domain) root authorities? Basically, something like:
This should mitigate my concerns about leaking the power of creating new valid (for that keychains) certificates. Questions:
|
@alexwebr For example, macOS apparently hits the network when attempting to do a DNS lookup on localhost. That means that, if an attacker than is able to access the locally stored copy of the Of course, that's means your environment is already severely compromised, and would only let the attacker impersonate
Definitely agree with the goal, not sure about the implementation. When you say prompt with a "native" dialog - do you mean a sudo prompt on the command line that is visible because the parent ember process is sharing the pipe with the child? Or do you mean an actual GUI dialog box? Not sure how to trigger the latter off the top of my head.
I think (I'd have to actually try it out to double check) that we can just trust the leaf certificate without needing the root CA. Basically, the CA ability of a given cert is just a flag on the cert itself - you can add a cert to the trust stores with or without that flag.
Since the proposed my-project/$ ember serve
ERROR: This project requires the following custom development domain(s) to be setup:
my-project.dev
admin.my-project.dev
Run `ember add-domain <domain name>` to setup a custom development domain. Or, we could automatically run the add-domain command when expected domains are missing (but I know there was some concern above about prompting for elevated permissions on We could even add a |
Ya, this may not be required, but the important bit is that the command run with elevated permissions is limited to very very specific script (not all of ember-cli). I was thinking of evaluating something like: https://www.npmjs.com/package/sudo-prompt to make it feel more legit :)
Ya that sounds good
Some ideas:
|
It feels like there's really two levels of commands here - system wide "installation" of the domain, and per-project "configuration" of the domain. For example, if I run
Then:
What happens? Is the domain "uninstalled" from my system (i.e. removed from /etc/hosts, SSL cert untrusted, etc)? Is it removed from my local |
My first thought is that it would remove from SSL. /etc/hosts and .ember-cli |
@davewasmer is devcert more stable now for this? |
Yes - the recent release of 1.0 should put it in a good spot for this. I'm also working with the webpack, preact, and gatsby CLI teams to integrate with them as well. Of particular note for Ember: the new version now ships with an overridable |
We are working on closing the ember-cli/rfcs repo in favor of using a single central RFC's repo for everything. This was laid out in https://emberjs.github.io/rfcs/0300-rfc-process-update.html. Sorry for the troubles, but would you mind reviewing to see if this is still something we need, and if so migrating this over to emberjs/rfcs? Thank you! |
Rendered