You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Write tests to check standards for entropy in VMs #268
Standard for entropy in VMs can be found as draft.
Is seems like we have to create cloud resources to test entropy compliance. If so, we should provide/reuse a framework to create/delete cloud resources, that can be reused in other tests. Furthermore, it must be ensured resources are cleaned up under all circumstances (including temporarily unavailable API etc.).
We had some talks in the Standardization Group about this.
The Standard was updated last week to reflect the changes undertaken in Linux Kernel 5.17 / 5.18.
In general, the Standard is mostly sufficient for now, since all important parts are covered, but the whole problem described there is a bit outdated, if only newer kernel versions are used. But for (backwards) compatibility reasons, we should still keep it.
IMO some parts should also be changed a bit, e.g. the way how 'available' entropy is shown, since the available entropy isn't necessarily important, but instead the time in which it regenerates. Some more possible changes will be enumerated in the next comment.
A related, maybe more important issue would be some kind of investigation into the quality of these generated randomness in the new kernel, which, if not sufficient, could make hardware sources a necessity. If a document like this is created and if it should find its way into a standard, should be discussed in the meeting.
Compliance testing could be done the following way:
connect to an OpenStack instance
create a VM with an image and a flavor (we could check all image + flavor combinations here)
connect to the VM
check the kernel version of the VM
Kernel < 5.18
Check if havaged is installed
Check if rng-tools / rng-utils is installed
Jump to step 5)
Kernel >= 5.18
Everything should be fine
If we want to be really meticulous, it would be best to start 2 processes, wherein 1 of them depletes entropy and the other one watches the available entropy
check available hardware entropy devices (based on the kernel optional or required)
check the hardware devices cat /sys/devices/virtual/misc/hw_random/rng_available
check the OpenStack flavor attributes for hw_rng:allowed = True
and optionally hw_rng:rate_bytes = <Allowed amount of read bytes> hw_rng:rate_period
check the OpenStack image attributes for hw_rng_model: virtio
disconnect from the VM and remove everything built up from the environment
Some changes that should be included in the Standard:
if "enough" entropy is available probably shouldn't be measured on the current available entropy, because depending on the kernel, it could be depleted fast and not be replenished for a long time (also, the number is hardcoded in newer kernels and therefore has no comparibility with newer kernels)
add a few more information about entropy, how it is implemented in the Linux kernel and where the difference was between /dev/random and /dev/urandom and why this doesn't matter anymore
especially, explain that the new kernel generates randomness via CPU jitters (basically hardware), which also works in VMs, since they have access to their respective CPU cores
Activity
[-]Write test to check standards for entropy in VMs[/-][+]Write tests to check standards for entropy in VMs[/+]cah-hbaum commentedon Apr 27, 2023
Draft can be found here or in this file
Addition to this can be found here
cah-hbaum commentedon May 9, 2023
We had some talks in the Standardization Group about this.
The Standard was updated last week to reflect the changes undertaken in Linux Kernel 5.17 / 5.18.
In general, the Standard is mostly sufficient for now, since all important parts are covered, but the whole problem described there is a bit outdated, if only newer kernel versions are used. But for (backwards) compatibility reasons, we should still keep it.
IMO some parts should also be changed a bit, e.g. the way how 'available' entropy is shown, since the available entropy isn't necessarily important, but instead the time in which it regenerates. Some more possible changes will be enumerated in the next comment.
A related, maybe more important issue would be some kind of investigation into the quality of these generated randomness in the new kernel, which, if not sufficient, could make hardware sources a necessity. If a document like this is created and if it should find its way into a standard, should be discussed in the meeting.
Compliance testing could be done the following way:
Everything should be fine
cat /sys/devices/virtual/misc/hw_random/rng_availablehw_rng:allowed = Trueand optionally
hw_rng:rate_bytes = <Allowed amount of read bytes> hw_rng:rate_periodhw_rng_model: virtiocah-hbaum commentedon May 9, 2023
Some changes that should be included in the Standard:
/dev/randomand/dev/urandomand why this doesn't matter anymoreEntropy Testing (#268)
Entropy Test Improvements (#268)
13 remaining items
Update Entropy Test due to Standard Change (#268)
Update Entropy test with optional changes (#268)
Add different package managers (#268)
Add different package managers (#268)
Entropy Testing (#268)
Entropy Test Improvements (#268)
Update Entropy Test due to Standard Change (#268)
Update Entropy test with optional changes (#268)
Add different package managers (#268)
Add different package managers (#268)
Add different package managers (#268)
Entropy testing (#307)