heat/heat/engine/resources
Zane Bitter a08893dc86 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-05 12:43:13 -04:00
..
aws Handle PublicIp of None in AutoscalingGroup InstanceList 2017-07-21 10:30:34 -04:00
openstack Fix entropy problems with OS::Random::String 2018-04-05 12:43:13 -04:00
__init__.py Log missing clients as WARNING instead of ERROR 2016-08-16 16:27:55 -05:00
alarm_base.py Allow query types other than string in Aodh alarms 2017-01-11 17:59:35 -05:00
scheduler_hints.py Fix path_in_stack for scheduler hints 2016-08-05 10:21:10 +00:00
server_base.py Merge "Mark Server os_collect_config attribute as CACHE_NONE" 2017-06-27 16:51:35 +00:00
signal_responder.py Allow for keeping prefix in heat_url 2017-06-07 20:09:39 +05:30
stack_resource.py Add converge flag in stack update for observing on reality 2017-08-07 05:39:29 +00:00
stack_user.py Remove log translations 2017-03-25 17:11:50 +08:00
template_resource.py Ignore errors in OS::stack_id output 2017-11-27 14:44:07 +00:00
volume_base.py Merge "Deal with cinder-backup service absent" 2016-08-18 17:32:03 +00:00
wait_condition.py Remove log translations 2017-03-25 17:11:50 +08:00