heat/heat/common
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
..
__init__.py Empty files shouldn't contain copyright nor license 2013-12-24 20:29:31 +08:00
auth_password.py Make standalone heat work with keystone v3 2017-07-17 02:59:03 +00:00
auth_url.py Make auth_url lookup dynamic 2016-03-04 17:35:52 +01:00
cache.py Use caching for resource name/id finders 2016-02-18 17:52:03 +05:30
config.py Deprecate 'deferred_auth_method' config option 2017-06-26 11:40:21 +05:30
context.py Merge "Make standalone heat work with keystone v3" 2017-07-21 12:04:03 +00:00
crypt.py Refactor, add encrypt/decrypt data dict functions to crypt 2016-11-28 20:31:49 -08:00
custom_backend_auth.py Fix some inconsistency in docstrings 2015-12-29 01:40:42 +08:00
endpoint_utils.py Use keystone session in endpoint_utils 2016-09-06 09:48:59 +05:30
environment_format.py Add new environment section for merge strategies 2016-08-19 08:54:30 +05:30
environment_util.py Handle zero values when merging environments 2017-03-02 22:03:20 +01:00
exception.py Improve StackValidationFailed exception 2017-06-29 09:40:54 +05:30
grouputils.py InstanceGroup to keep FAILED resources in template 2016-01-21 22:22:31 -05:00
i18n.py Remove log translations 2017-03-25 17:11:50 +08:00
identifier.py Revert "Revert "Enable heat to use uwsgi with devstack"" 2017-07-07 11:00:04 +05:30
lifecycle_plugin_utils.py Remove log translations 2017-03-25 17:11:50 +08:00
messaging.py Use get_rpc_transport instead of get_transport 2017-06-28 08:21:28 +00:00
netutils.py Add dns constraints 2016-07-26 10:01:06 +05:30
noauth.py Add noauth middleware 2016-10-13 11:49:19 -04:00
param_utils.py Convert props form delimited params to lists 2016-08-26 17:43:33 +05:30
password_gen.py Fix entropy problems with OS::Random::String 2018-04-05 12:43:13 -04:00
plugin_loader.py Remove log translations 2017-03-25 17:11:50 +08:00
pluginutils.py Fix no message attribute in exception 2017-07-19 13:48:39 +00:00
policy.py Cache policy enforcer 2017-05-31 15:07:40 +02:00
profiler.py Remove log translations 2017-03-25 17:11:50 +08:00
serializers.py Stop showing json deserialized message in log 2017-02-17 02:00:08 +00:00
service_utils.py Move some functions to service_utils 2016-06-01 03:57:04 +00:00
short_id.py Less unicode weirdness in short_id 2017-05-01 16:44:59 -04:00
template_format.py Include template url in nested stack parse error 2017-04-27 09:11:49 +05:30
timeutils.py Get rid of timeutils.round_to_seconds() 2017-05-04 20:41:34 -04:00
urlfetch.py Remove log translations 2017-03-25 17:11:50 +08:00
wsgi.py Remove log translations 2017-03-25 17:11:50 +08:00