heat/heat/engine/resources/openstack/heat
Zane Bitter 8437ec3fce 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-03-23 12:41:06 -04:00
..
__init__.py Move heat resources 2015-03-06 11:05:27 +08:00
access_policy.py Add descriptions to openstack resources (Part 3) 2016-02-17 11:22:11 +00:00
autoscaling_group.py Supply outputs for reference IDs in StackResources 2018-01-19 15:08:10 -05:00
cloud_config.py Single definition of top-level SoftwareConfig keys 2016-08-10 11:01:35 -04:00
cloud_watch.py Remove stack watch service 2018-01-28 09:35:05 +05:30
deployed_server.py To merge the occ data for OS::Heat::DeployedServer 2017-07-21 02:50:18 +00:00
ha_restarter.py Remove OS::Heat::HARestarter 2018-01-29 08:59:00 +00:00
instance_group.py Return nested parameters for resource group. 2018-02-28 20:18:17 +00:00
multi_part.py Use exception_filter in RPC client 2017-03-27 14:38:53 -04:00
none_resource.py Add `is_placeholder` resource data for placeholder resource 2017-06-26 18:38:11 +08:00
random_string.py Fix entropy problems with OS::Random::String 2018-03-23 12:41:06 -04:00
remote_stack.py Get rid of undesirable properties.data usage 2017-04-04 14:29:29 +00:00
resource_chain.py Get ResourceGroup/Chain attributes from nested stack outputs 2018-01-19 15:37:10 -05:00
resource_group.py Return nested parameters for resource group. 2018-02-28 20:18:17 +00:00
scaling_policy.py Remove use of CooldownMixin with scaling policy 2018-01-28 09:41:20 +05:30
software_component.py Use exception_filter in RPC client 2017-03-27 14:38:53 -04:00
software_config.py Use exception_filter in RPC client 2017-03-27 14:38:53 -04:00
software_deployment.py Don't load nested stack to get ResourceGroup blacklist 2018-02-16 15:10:05 +00:00
structured_config.py Non-destructive upgrade for structured deployments 2016-09-10 09:22:25 +08:00
swiftsignal.py Remove log translations 2017-03-25 17:11:50 +08:00
test_resource.py Remove log translations 2017-03-25 17:11:50 +08:00
value.py Use stored value in OS::Heat::Value resource 2017-02-03 14:28:21 -05:00
wait_condition.py Remove obsolete cache_data from Stack 2017-07-21 10:44:51 -04:00
wait_condition_handle.py Improve update_wait_condition_handle docstring 2017-09-14 12:50:55 +02:00