-
Notifications
You must be signed in to change notification settings - Fork 687
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
Get rid of entropy checks #1584
Comments
According to this upstream ticket libgcrypt 1.8 and above will use However another option would be to use the
Since we're not generating source keys early in the boot process, this might be sufficient - if we want consider this path, we should next determine how long it takes for the entropy pool to be initialized. |
For the 6/12-6/26 sprint, we've committed to at least an 8 hour time-boxed investigation to determine whether removal of these checks is feasible (this may include some external outreach to security experts). Since removing the checks would obviate the need for the "Flag for reply" workflow, it would not only make journalists' lives easier, but also save quite a bit of time in client development (freedomofpress/securedrop-client#247). |
Self-hosting that package is not on the table, so if that's the only solution we'll have to wait until all prod instances have migrated to Bionic before we can potentially fully remove entropy checks (with perhaps a transitional stage where Xenial/Bionic behavior will differ).
@redshiftzero has committed to do a quick investigation during the 10/23-11/6 sprint into whether this or another workaround might indeed do the trick. |
Above I mentioned the possibility of using the We should be able to use this config option and remove both the flag for reply and entropy check logic, but I think we'll want to keep the async key generation. Concretely I think we should:
|
Thanks for the summary, @redshiftzero! Aside from the reboot scenario your mention, did your investigation shed light on how likely key generation is to be skipped (the check in https://github.com/freedomofpress/securedrop/blob/develop/securedrop/source_app/main.py#L221-L234) on typical prod systems, in a denial of service attack or high traffic scenario? |
Just leaving a note here that we should probably keep some version of the "Sorry we haven't responded yet" message in the UI, to make it clear to the source that the lack of response from the news org is not due to lack of interest. |
This could be a nice stretch goal for 2.0.0, tentatively adding to milestone. |
@rmol has committed to taking a stab at this during the 5/5-5/19 sprint, focusing on following up on Jen's earlier investigation and potentially removing the "Flag for reply" workflow. |
In
source.py
, we check for "available entropy" before generating a key. This is done because GPG blocks on "sufficient entropy" from/dev/random
to generate a GPG key, and we don't want to block returning the HTTP response.After discussing this with some more-knowledgeable security folks, a couple of things have come to my attention:
urandom
(although this may require some configuration, and it's not clear to me how/when this is done), will usegetrandom
if it's available, etc./dev/random
and only/dev/random
. So if we can't configure libgcrypt to use a non-blocking CSPRNG, we may now be able to trick it by symlinkingurandom
, or usingmknod
, etc.Making this change could have a variety of potential benefits:
async_genkey
and the test helpers that wait for key generation.async_genkey
(Intermittent Travis test failures (Directory not empty: '/tmp/securedrop/keys') #844)However, we may need to use a more recent version of GPG/libgcrypt to take advantage of these recent improvements. This might require upgrading our entire stack from Ubuntu 14.04LTS - a change that we want to make anyway, but one that is non-trivial.
The text was updated successfully, but these errors were encountered: