nova/nova/tests/unit/compute
Matt Riedemann 3dcefba60a Replace non-nova server fault message
The server fault "message" is always shown in the API
server response, regardless of policy or user role.

The fault "details" are only shown to users with the
admin role when the fault code is 500.

The problem with this is for non-nova exceptions, the
fault message is a string-ified version of the exception
(see nova.compute.utils.exception_to_dict) which can
contain sensitive information which the non-admin owner
of the server can see.

This change adds a functional test to recreate the issue
and a change to exception_to_dict which for the non-nova
case changes the fault message by simply storing the
exception type class name. Admins can still see the fault
traceback in the "details" key of the fault dict in the
server API response. Note that _get_fault_details is
changed so that the details also includes the exception
value which is what used to be in the fault message for
non-nova exceptions. This is necessary so admins can still
get the exception message with the traceback details.

Note that nova exceptions with a %(reason)s replacement
variable could potentially be leaking sensitive details as
well but those would need to be cleaned up on a case-by-case
basis since we don't want to change the behavior of all
fault messages otherwise users might not see information
like NoValidHost when their server goes to ERROR status
during scheduling.

SecurityImpact: This change contains a fix for CVE-2019-14433.

Change-Id: I5e0a43ec59341c9ac62f89105ddf82c4a014df81
Closes-Bug: #1837877
(cherry picked from commit 298b337a16)
(cherry picked from commit 6765188116)
(cherry picked from commit e0b91a5b1e)
2019-08-06 12:02:34 -04:00
..
monitors Allow monitor plugins to set own metric object 2016-06-27 14:38:32 +05:30
__init__.py
eventlet_utils.py
fake_resource_tracker.py rt: explicitly pass compute node to _update() 2017-01-12 11:30:03 -08:00
test_claims.py rt: use a single ResourceTracker object instance 2017-01-16 14:09:25 -05:00
test_compute.py Replace non-nova server fault message 2019-08-06 12:02:34 -04:00
test_compute_api.py Block swap volume on volumes with >1 rw attachment 2019-05-30 17:29:53 -04:00
test_compute_cells.py Fix host validity check for live-migration 2018-08-09 16:31:58 +05:30
test_compute_mgr.py Merge "Restore connection_info after live migration rollback" into stable/queens 2019-07-02 22:31:12 +00:00
test_compute_utils.py Bump compute RPC API to version 5.0 2018-02-08 10:43:56 -08:00
test_compute_xen.py Make xen unit tests work with os-xenapi>=0.3.0 2017-09-05 16:06:31 -04:00
test_flavors.py Make compute unit tests inherit from test.NoDBTestCase 2015-02-24 17:54:29 +02:00
test_host_api.py Make nova service-list use scatter-gather routine 2018-06-29 12:22:37 +00:00
test_instance_list.py Make nova list and migration-list ignore down cells 2018-06-26 18:44:47 +02:00
test_keypairs.py Transform keypair.import notification 2017-10-30 16:44:29 -04:00
test_multi_cell_list.py Some nit fix in multi_cell_list 2017-12-13 14:27:20 +08:00
test_provider_tree.py ProviderTree.get_provider_uuids: Top-down ordering 2018-01-31 08:35:35 -06:00
test_resource_tracker.py Update resources once in update_available_resource 2019-03-25 05:36:10 +00:00
test_rpcapi.py Compute RPC client bump to 5.0 2018-02-08 12:10:04 -08:00
test_shelve.py Fix shelving a paused instance 2018-05-20 22:11:04 +00:00
test_stats.py Change consecutive build failure limit to a weigher 2018-06-07 07:17:51 -07:00
test_virtapi.py Fix cancel_all_events event name parsing 2018-08-21 11:04:00 -07:00