Repository navigation
Revision of scs-0101-v1-entropy - #297
Conversation
|
Now I'm wondering if the flavor name scheme should be extended to account for the presence of a true hw rng? Is this something that should be standardized? |
cah-hbaum
left a comment
There was a problem hiding this comment.
Did a review, some text changes as well as one "bigger"ish discussion point came up for me.
Also (because we talked about) the following command provides the path to a possible
hardware device as a source for randomness in a VM. I don't know if we want to put this anyhwere, but there it is.
/sys/devices/virtual/misc/hw_random/rng_available
|
|
||
| This standard does not intend to make any guarantees for linux images | ||
| that are not themselves included in the | ||
| [SCS standard](https://github.com/SovereignCloudStack/standards/blob/main/Standards/scs-0102-v1-image-metadata.md), in particular |
There was a problem hiding this comment.
| [SCS standard](https://github.com/SovereignCloudStack/standards/blob/main/Standards/scs-0102-v1-image-metadata.md), in particular | |
| [Image Metadata SCS standard](https://github.com/SovereignCloudStack/standards/blob/main/Standards/scs-0102-v1-image-metadata.md), in particular |
There was a problem hiding this comment.
This one is indeed a bit tricky. I guess what I mean here is not the image metadata standard itself, but the certification level SCS compatible, which includes the image metadata standard. What the CSPs get certified for is the bundle as a whole. However, speaking of "SCS certification level SCS compatible" is a mouthful. Therefore I opted for SCS standard, but then only linked the relevant document.
There was a problem hiding this comment.
While working on SovereignCloudStack/issues#343, I learned that there is such a thing as "the SCS standard", namely with respect to a given release number, and it comprises all standards that are denoted as stable in that release. Source: https://github.com/SovereignCloudStack/standards/blob/main/Standards/scs-0001-v1-sovereign-cloud-standards.md#stabilized-phase-stable
So the wording "SCS standard" is not unprecedented and it is even well defined. The image metadata standard is stable, and I guess it will remain so for the upcoming release. Therefore it should be warranted to speak of the SCS standard at large while linking to a specific document that is part of the standard.
| Compute nodes must use CPUs that offer RDRAND/RDSEED. This requirement | ||
| is both very hard to verify and almost impossible to violate, so it will | ||
| not be tested for. |
There was a problem hiding this comment.
Why must RDRAND/RDSEED be necessary? I couldn't find a hard requirement for them in the linux kernel or anywhere else (e.g. OpenSSL also only lists them as an optional tool to generate their keys and so on).
https://en.wikipedia.org/wiki/RDRAND and the connected sources state that it was a source for randomness in previous kernel version, but not the only one in the pool, and since the algorithm was changed in favor of using CPU jitter (which doesn't come from RDRAND/RDSEED), this requirement should not be necessary in my opinion.
There was a problem hiding this comment.
My interpretation of the Donenfeld writeup was that his algorithm uses the first instruction of the following list that is supported by the CPU: RDSEED, RDRAND, RDTSC. It suggested to me that RDSEED was somehow superior.
There was a problem hiding this comment.
Yes it uses these Operations in this order, but it doesn't decrease the value of the entropy significantly if one of the later methods is used, since it is only mixed in as an entropy source, see
I touched on RDSEED usage earlier, and there are in fact some more detailed changes on that topic. In random: use RDSEED instead of RDRAND in entropy extraction, the RNG now uses RDSEED, if available, before falling back to RDRAND and eventually RDTSC. Since the CPU’s RNG is just another entropy input source — one we happen to call at boot time for initial seeding and during each subsequent reseeding — we might as well use its best source. We’re not using it as part of the direct generation of random numbers itself, but just as an additional entropy input, and hence there’s not a need for the speed improvements of RDRAND over RDSEED. (Incidentally I recently removed direct RDRAND-usage from systemd too.)
So I wouldn't write this in as a requirement, especially since most modern x86-CPUs would fullfill these requirements anyway.
There was a problem hiding this comment.
I agree with you that mandating this is kind of redundant (because the instructions are present anyway, and because the kernel works fine without them).
There was a problem hiding this comment.
I will try to get more feedback in tomorrow's meeting, and if nobody intervenes, I will remove this requirement.
|
Can we get another review before the next team meeting on Wednesday? @matfechner @artificial-intelligence @garloff |
…t current state of the art Signed-off-by: Matthias Büchse <[email protected]>
Signed-off-by: Matthias Büchse <[email protected]>
Signed-off-by: Matthias Büchse <[email protected]>
Signed-off-by: Matthias Büchse <[email protected]>
Co-authored-by: cah-hbaum <[email protected]> Signed-off-by: Matthias Büchse <[email protected]>
courtesy of @cah-hbaum Co-authored-by: cah-hbaum <[email protected]> Signed-off-by: Matthias Büchse <[email protected]>
Co-authored-by: cah-hbaum <[email protected]> Signed-off-by: Matthias Büchse <[email protected]>
…m's review Signed-off-by: Matthias Büchse <[email protected]>
Signed-off-by: Matthias Büchse <[email protected]>
Signed-off-by: Matthias Büchse <[email protected]>
0f6623a to
f7c71ea
Compare
|
Note: I did a rebase, so if you have a local copy, please do as follows: |
Signed-off-by: Matthias Büchse <[email protected]>
…azont Signed-off-by: Matthias Büchse <[email protected]>
| [HavegeD](http://www.issihosts.com/haveged/)) as well as the special CPU | ||
| instructions RDRAND and RDSEED, which are present in all modern CPUs from | ||
| ARM, AMD, and Intel. |
There was a problem hiding this comment.
ARM (actually ARM64 to be precise) does not have RDRAND/RDSEED but has RNDR - if I'm not mistaken.
If we become that specific, we should make sure to not tie it too much into x86_64 language.
| Compute nodes must use CPUs that offer RDRAND/RDSEED, and these | ||
| instructions may not be filtered by the hypervisor. If this requirement |
There was a problem hiding this comment.
this will prevent CSPs from deploying ARM64 based compute nodes once we offer this functionality (which we will). Imho we should write this in a way that does not require us to revise it when we do that.
fkr
left a comment
There was a problem hiding this comment.
Aside from the note about RDRAND/RDSEED and it being very x86_64 specific (which did not occur to me earlier - sorry for that!) i really like this document.
Maybe we can formulate that a bit flexible and than I'd say this is good to go.
Thanks to @fkr for pointing this out! Signed-off-by: Matthias Büchse <[email protected]>
* adapt to the new standard introduced in #297 * added specific exceptions * small inline documentation * added return codes and explanation * better explained log messages Signed-off-by: Hannes Baum <[email protected]>
* adapt to the new standard introduced in #297 * added specific exceptions * small inline documentation * added return codes and explanation * better explained log messages Signed-off-by: Hannes Baum <[email protected]>
* adapt to the new standard introduced in #297 * added specific exceptions * small inline documentation * added return codes and explanation * better explained log messages Signed-off-by: Hannes Baum <[email protected]>
* adapt to the new standard introduced in #297 * added specific exceptions * small inline documentation * added return codes and explanation * better explained log messages Signed-off-by: Hannes Baum <[email protected]>
* Entropy Testing (#268) * add script to check available entropy on VMs and OpenStack * additional requirements Signed-off-by: Hannes Baum <[email protected]> * Entropy Test Improvements (#268) * improvements to appease Flake8 * sort script imports * add command-line options Signed-off-by: Matthias Büchse <[email protected]> * Move flavor and image checks up front, because they don't depend on the VM Signed-off-by: Matthias Büchse <[email protected]> * Update Entropy Test due to Standard Change (#268) * adapt to the new standard introduced in #297 * added specific exceptions * small inline documentation * added return codes and explanation * better explained log messages Signed-off-by: Hannes Baum <[email protected]> * Update Entropy test with optional changes (#268) * possibility to check multiple images * lists from image metadata standard * more exception checks * improved return codes * improved usage output Signed-off-by: Hannes Baum <[email protected]> * Add different package managers (#268) * handling for multiple package managers Signed-off-by: Hannes Baum <[email protected]> * Reworked the entropy test - removed coupling with image standard (images have to be named in the yaml file) - simplified return codes and logging - simplified openstack API calls (e.g., use built-in feature to delete floating IPs) - pick suitable flavor for checking virtio-rng, otherwise check is pointless - made code more concise, added comments at a few surprising spots Signed-off-by: Matthias Büchse <[email protected]> * appease flake8 by correcting mistake Signed-off-by: Matthias Büchse <[email protected]> * Fixed type of flavor attribute hw_rng:allowed (it's bool, not str) Signed-off-by: Matthias Büchse <[email protected]> * Improvements thanks to @cah-hbaum's review Signed-off-by: Matthias Büchse <[email protected]> * Add different package managers (#268) * handling for multiple package managers Signed-off-by: Hannes Baum <[email protected]> Signed-off-by: Matthias Büchse <[email protected]> * Improved comments following review by @artificial-intelligence Signed-off-by: Matthias Büchse <[email protected]> * Multiple small bug fixes to make it work on a conformant cloud... Signed-off-by: Matthias Büchse <[email protected]> --------- Signed-off-by: Hannes Baum <[email protected]> Signed-off-by: Matthias Büchse <[email protected]> Co-authored-by: Matthias Büchse <[email protected]>
Hi everyone.
I tried to apply the structure suggested by scs-0001. Besides, I did a kinda deep dive into the topic of entropy, and I revised the draft accordingly. Please have a look.
Most important insights to me:
/dev/hwrngand it's automatically part of the entropy pool)rngdis only required on the host if it does feature a true hw rngvirtio-rngedit just mention SovereignCloudStack/issues#234 to make the connection