nova/nova/tests/unit/compute
Matt Riedemann 6765188116 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)
2019-08-06 10:48:49 -04:00
..
monitors Do not log a warning about not using compute monitors 2019-04-08 15:35:04 +00:00
__init__.py
eventlet_utils.py
fake_resource_tracker.py Use a static resource tracker in compute manager 2019-01-17 06:34:29 +00:00
test_claims.py Make Claim._claim_test handle SchedulerLimits object 2019-02-12 11:59:51 -05:00
test_compute.py Replace non-nova server fault message 2019-08-06 10:48:49 -04:00
test_compute_api.py Block swap volume on volumes with >1 rw attachment 2019-05-30 20:59:55 +00:00
test_compute_cells.py Flavor extra spec and image properties validation from API 2019-03-05 12:05:06 -06:00
test_compute_mgr.py Revert resize: wait for events according to hybrid plug 2019-07-12 19:16:28 -04:00
test_compute_utils.py Refresh instance network info on deletion 2019-06-13 16:06:45 +02:00
test_compute_xen.py Remove mox in nova/tests/unit/virt/xenapi/stubs.py 2018-06-21 23:59:39 +00:00
test_flavors.py Make compute unit tests inherit from test.NoDBTestCase 2015-02-24 17:54:29 +02:00
test_host_api.py Minimal construct plumbing for nova service-list when a cell is down 2018-10-31 15:22:15 -04:00
test_instance_list.py Plumbing for ignoring list_records_by_skipping_down_cells 2019-02-08 16:28:28 -05:00
test_keypairs.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
test_multi_cell_list.py Refactor scatter-gather utility to return exception objects 2018-10-31 15:18:07 -04:00
test_provider_tree.py Reduce calls to placement from _ensure 2019-01-16 18:34:34 +00:00
test_resource_tracker.py Merge "Fix AttributeError in RT._update_usage_from_migration" into stable/stein 2019-08-02 14:29:52 +00:00
test_rpcapi.py Pass request_spec from compute to cell conductor on reschedule 2018-12-19 17:32:33 -05:00
test_shelve.py Extract compute API _create_image to compute.utils 2019-02-05 12:27:57 -05:00
test_stats.py Use uuidsentinel from oslo.utils 2018-09-05 09:08:54 -05:00
test_virtapi.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00