heat/heat
Daniel Gonzalez 8c681f2641 Prevent template validate from scanning ports
The template validation method in the heat API allows to specify the
template to validate using a URL with the 'template_url' parameter.

By entering invalid http URLs, like 'http://localhost:22' it is
possible to scan ports by evaluating the error message of the request.

For example, the request

curl -H "Content-Type: application/json" -H "X-Auth-Token: <TOKEN>" \
-X POST -d '{"template_url": "http://localhost:22"}' \
http://127.0.0.1:8004/v1/<TENANT_ID>/validate

causes the following error message to be returned to the user:

"Could not retrieve template: Failed to retrieve template:
('Connection aborted.',
BadStatusLine('SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1\\r\\n',))"

This could be misused by tenants to gain knowledge about the internal
network the heat API runs in.

To prevent this information leak, this patch alters the error message
to not include such details when the url scheme is not 'file'.

SecurityImpact

Closes-Bug: #1606500

Change-Id: Id1f86f41c1e6c028d889eca7ccbb9cde67631950
(cherry picked from commit eab9a33ce7)
2016-11-03 08:52:25 +01:00
..
api Merge "Fix for resource search with invalid filter keys" 2016-03-09 12:46:11 +00:00
cloudinit Validate that python3 is ready for loguserdata 2016-08-26 13:57:31 +00:00
cmd Moved CORS middleware configuration into oslo-config-generator 2016-03-14 08:19:29 -07:00
common Prevent template validate from scanning ports 2016-11-03 08:52:25 +01:00
db Add retries to avoid dberror for user_creds_delete 2016-03-23 07:15:49 +00:00
engine Increase the timeout for the stop_stack message 2016-09-25 20:40:39 -04:00
httpd Moved CORS middleware configuration into oslo-config-generator 2016-03-14 08:19:29 -07:00
locale Imported Translations from Zanata 2016-05-23 07:09:40 +00:00
objects Handling concurrent transactions in metadata_set method 2016-03-24 06:46:27 +00:00
openstack replace git protocol by https 2015-10-22 10:06:05 +08:00
rpc Merge "Use oslo.utils.reflection to extract class name" 2016-03-06 05:01:48 +00:00
scaling Fixes cooldown logic throws ValueError 2016-05-23 14:49:18 +05:30
tests Increase the timeout for the stop_stack message 2016-09-25 20:40:39 -04:00
__init__.py Make import of oslo libraries namespaceless 2015-02-18 22:54:10 +01:00
version.py Make the first line of every file consistent. 2014-03-04 09:03:04 -06:00