-
-
Notifications
You must be signed in to change notification settings - Fork 22
Disabling cert verification: can we improve security without punishing users? #142
Comments
I'm really liking the fingerprinting idea, allows for users to trust an otherwise completely incorrect certificate and it's easy to transform an error message (could contain the "mismatched" fingerprint) into a mostly secure setup (use the fingerprint from the error message in my TLS config). As with everything related to TLS configuration, documentation will go a long way towards users making good decisions with security. Example error messages embedded within the documentation should be the the top of the Google search results. :) |
I guess trust on first use is only really possible if we implement #141, which is another argument in favor of it! And then a simple kwarg could be enough, and we just have to make it shorter than |
Oh hmm, I guess there's actually two different things we could call "trust on first use", so let's be more explicit. I think the flow @sethmlarson had in mind was something like:
And it sounds like @pquentin is thinking of something like:
Both approaches seem better than The major problem with using the session store here is that in practice, this is a really ephemeral thing, so users wouldn't actually get much protection – usually when we go to look up the cert, it won't be there. E.g. for a script that runs once and then exits, OTOH, trying to make the session store magically persist across invocations is also fraught with challenges. First because as a library, we kind of just... can't really do that without some explicit manual configuration. And second because in this case, I think it could be really confusing to users if https certs are "randomly" accepted or rejected based on some long-lived implicit state. The hard-coded string version has the advantage that it makes it really obvious to the user that they're pinning a cert and what the lifetime of that pin is. |
@njsmith Yep, you understood what I was imagining to be the interface. Anything that's in the session store is liable to expire / be deleted / not be feasible to store, and we don't want that to happen for most TOFU use-cases, especially as an alternative to disabling verification. :) |
Thanks for the great explanation, that makes a lot more sense! |
So here's an interesting question about an interface like I guess those kinds of users might also want to do more sophisticated things, like pin a specific root cert without pinning a specific cert. Though you can also accomplish some of this via more general TLS trust config, like by setting a trust store that only includes the root you want. Maybe what I'm saying is just that when it comes time to choose the details for how |
The "ugh make this site work" user will probably leave the Maybe we can issue a warning if a site with a pinned cert suddenly starts working via traditional PKI with instructions on how to remove the pin? I agree we'll have to do a more comprehensive view of the many trust config use-cases. |
@sethmlarson thinks that the classic
verify=False
makes it a bit too easy to disable cert checking, so it encourages folks to do it without fully understanding the consequences. Of course we don't want to make it punitively difficult either. Often the folks who have to disable cert checking hate that as much as we do, and are just stuck in an impossible situation. But some ideas for things we could potentially do:disable_secure_certificate_validation=True
The text was updated successfully, but these errors were encountered: