heat/heat
Zane Bitter 8ce005cc0e Fix entropy problems with OS::Random::String
When generating a random string, once we had selected from the various
required pools, we continued by selecting a pool at random and then
selecting a character from that pool at random. This did not take into
account the differing sizes of the available pools, nor the fact that the
same character could appear in multiple pools, which resulted in a
non-uniform probability distribution of characters. Since users mostly make
use of this feature to generate default passwords for services they are
deploying, this would result in the generated passwords having slightly
less entropy than expected (and pathological cases were possible).

Rectify this by always selecting non-constrained characters from a single
combined pool, and by ensuring that each character appears only once in any
pool we're selecting from.

Since we also want to use this method to generate passwords for OpenStack
Users, the new implementation is in a separate module in heat.common rather
than mixed in with the resource's logic. Also, use a StringIO object to
collect the characters rather than repeatedly appending to a string.

Change-Id: Ia7b63e72c1e3c0649290caf4fea8a32f7f89560b
Closes-Bug: #1757300
Related-Bug: #1666129
Related-Bug: #1444429
(cherry picked from commit 6e16c051ba)
2018-04-06 10:30:56 -04:00
..
api Handle ambiguous physical resource IDs 2016-12-05 14:58:20 -05:00
cloudinit Validate that python3 is ready for loguserdata 2016-08-26 11:49:30 +00:00
cmd Sanitize newly added heat-manage command 2016-12-23 12:25:03 +00:00
common Fix entropy problems with OS::Random::String 2018-04-06 10:30:56 -04:00
db De-duplicate properties_data between events, resources 2017-01-24 15:40:10 -08:00
engine Fix entropy problems with OS::Random::String 2018-04-06 10:30:56 -04:00
hacking Restrict use of iteritems, iterkeys and itervalues 2016-03-23 10:05:54 +00:00
httpd Moved CORS middleware configuration into oslo-config-generator 2016-03-14 08:19:29 -07:00
locale Imported Translations from Zanata 2017-09-26 11:00:33 +00:00
objects Corrected max secs for concurrent trans retries 2017-05-12 16:20:14 -04:00
rpc Returns project info while getting sd with admin context 2016-12-23 01:13:38 +00:00
scaling Improve resource.NoActionRequired 2017-01-25 00:17:00 +00:00
tests Fix entropy problems with OS::Random::String 2018-04-06 10:30:56 -04:00
__init__.py Make import of oslo libraries namespaceless 2015-02-18 22:54:10 +01:00
version.py