Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Mitigate entropy depletion #1124

Merged
merged 4 commits into from
Jul 13, 2015
Merged

Mitigate entropy depletion #1124

merged 4 commits into from
Jul 13, 2015

Conversation

awh
Copy link
Contributor

@awh awh commented Jul 13, 2015

This PR adds adaptive connection acceptance rate limiting in the form of a lazy token bucket implementation, replacing the constant 1ms sleep in use before. The bucket contains a maximum of 100 tokens, replenished at a rate of one every 100ms; this allows a burst of up to 100 connection attempts without any delay, limiting to 10 per second thereafter under sustained load. Quiescence allows the bucket to refill back to its maximum, the intended effect being that initial network formation and partition healing are not hindered at all, but a sustained denial of service will be.

Testing reveals that this does not address the reported issue entirely - even at the lower bound of 10 requests per second there may not be enough entropy gathered on a headless system to keep pace. Nevertheless, after careful investigation and research, we have concluded that of the two options available to us (the other being implementing and seeding our own CSPRNG in a similar fashion to OpenSSL) this is by far the safest. We have been convinced that the impact of such an attack is limited to slowing /dev/random readers, so we have recorded our rationale along with links to supporting expert opinion in our cryptography design document.

In closing, it is noteworthy that OpenSSH can be used to deplete entropy in exactly the same fashion, as each forked process consumes 256 bits from /dev/urandom.

Closes #1037.

@awh
Copy link
Contributor Author

awh commented Jul 13, 2015

Replaces #1111.

@awh awh assigned rade Jul 13, 2015
rade added a commit that referenced this pull request Jul 13, 2015
@rade rade merged commit 1f3d054 into 1.0 Jul 13, 2015
@rade rade deleted the issues/1037-mitigate-entropy-depletion branch July 13, 2015 18:08
@rade rade added this to the 1.0.2 milestone Jul 13, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants