nova/nova/compute
Matt Riedemann e0b91a5b1e 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.

NOTE(mriedem): The functional test imports change here
because Idaed39629095f86d24a54334c699a26c218c6593 is not
in Rocky so the PlacementFixture comes from nova_fixtures.

Change-Id: I5e0a43ec59341c9ac62f89105ddf82c4a014df81
Closes-Bug: #1837877
(cherry picked from commit 298b337a16)
(cherry picked from commit 6765188116)
2019-08-06 11:35:58 -04:00
..
monitors Remove translation of log messages 2017-06-09 09:06:16 +00:00
__init__.py Switch to using oslo_* instead of oslo.* 2015-02-06 06:03:10 -05:00
api.py Merge "Share snapshot image membership with instance owner" into stable/rocky 2019-06-28 19:17:19 +00:00
build_results.py Compute Add build_instance hook in compute manager 2014-12-04 10:12:00 -05:00
cells_api.py Fix missing marker functions 2018-01-25 03:37:48 +00:00
claims.py [Trivial] docstrings, typos, minor refactoring 2017-08-28 08:33:58 -05:00
flavors.py Remove unused flavor_delete_info() method 2018-08-03 12:44:52 -04:00
instance_actions.py Add instance action record for snapshot instances 2017-12-11 17:46:38 +08:00
instance_list.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
manager.py Revert resize: wait for events according to hybrid plug 2019-07-12 19:19:58 -04:00
migration_list.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
multi_cell_list.py Make nova list and migration-list ignore down cells 2018-06-25 17:28:57 -04:00
power_state.py Removed enum duplication from nova.compute 2016-09-02 07:30:44 +00:00
provider_tree.py Perf: Use dicts for ProviderTree roots 2019-07-10 15:19:45 -05:00
resource_tracker.py Fix resource tracker updates during instance evacuation 2019-03-05 19:22:14 +08:00
rpcapi.py Make compute rpcapi version calculation check all cells 2018-12-13 16:10:05 +00:00
stats.py Change consecutive build failure limit to a weigher 2018-06-06 15:18:50 -07:00
task_states.py Fix resource tracker updates during instance evacuation 2019-03-05 19:22:14 +08:00
utils.py Replace non-nova server fault message 2019-08-06 11:35:58 -04:00
vm_states.py Removed enum duplication from nova.compute 2016-09-02 07:30:44 +00:00