Skip to content

Use /dev/random Instead of /dev/urandom Due to Changes in Linux #8859

@shirady

Description

@shirady

Environment info

  • NooBaa Version: 5.19
  • Platform: Kubernetes 1.28.7

Actual behavior

We implemented the seeding using dev/random (reference: #2721, #4555 and openssl docs).

Back then on VMs and Containers we started encountering issues were the host did not have enough entropy and we could not generate more entropy using input from any of the available devices, so we decided to use /dev/urandom to avoid getting stuck starting our containers (reference #5745 and #5752).

Overall, what this means is that in the default configuration, we do not require our seed to be strongly random, and would accept a pseudo-random seed to prevent getting stuck while starting the containers. You can override the default and force it to wait for a strongly random seed.

Note: DISABLE_DEV_RANDOM_SEED is the env that we use to decide if to get the random from dev/random or /dev/urandom.

Expected behavior

According to the following references:

On modern Linux systems, the in-kernel random number generator in /dev/random is considered cryptographically secure and, crucially, no longer blocks.

It would mean that we can improve and simplify our existing code.

Steps to reproduce

  1. none

More information - Screenshots / Logs / Other output

This issue was based on this Slack thread.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions