Bug 839569 - [RHVM-ENGINE] Engine should not return all host details for non-admin users
Summary: [RHVM-ENGINE] Engine should not return all host details for non-admin users
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: ---
: ---
Assignee: Oved Ourfali
QA Contact: Ondra Machacek
URL:
Whiteboard: infra
: 839227 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-12 10:34 UTC by Michael Pasternak
Modified: 2016-02-10 19:16 UTC (History)
12 users (show)

Fixed In Version: si12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Michael Pasternak 2012-07-12 10:34:09 UTC
Description of problem:

Engine should not return all host details for non-admin users

Expected results:

only 'display ip details' with the ip/port should be returned in host object,
also VdcQueryType.GetVdsCertificateSubjectByVdsId query should be permitted
for non-admin users or alternatively BE should expose host_subject via 
host property.

Comment 1 Itamar Heim 2012-07-12 21:48:51 UTC
not sure if the correct approach is to keep GetVdsCertificateSubjectByVdsId as a user query, or wrap it with a user query of GetVdsCertificateSubjectByVmId

Comment 3 Michael Pasternak 2012-07-15 08:36:21 UTC
at the end, users should not be able to GET /hosts resources at all,
but VM resource should expose display_addr/port/host_subject for console

Comment 4 Michael Pasternak 2012-07-15 13:44:52 UTC
*** Bug 839227 has been marked as a duplicate of this bug. ***

Comment 5 Oved Ourfali 2012-07-24 12:17:55 UTC
Posted a patch for that:
http://gerrit.ovirt.org/#/c/6542

Information on the contents of this patch (also answering Yaniv's question):
1. Block users from getting Host information via REST API (both host
resource, and relevant host data in the VM resource).
2. Add GetManagementInterfaceAddressByVmIdQuery, removing
GetManagementInterfaceAddressByVdsIdQuery (as it isn't used anywhere).
3. Add GetVdsCertificateSubjectByVmIdQuery which uses the existing
GetVdsCertificateSubjectByVdsIdQuery (as this query is also used in other scenarios).
4. Update VncConsoleModel and SpiceConsoleModel to work with the new
queries.

So, need to test that when using User level API:
1. The user can't access /api/hosts (error 403, forbidden)
2. The user can't access a specific host (/api/host/<some guid>).
3. When getting all VMs (/api/vms), or a specific one (/api/vms/<some guid>) the user doesn't see any host information.
4. When getting all VMs (/api/vms), or a specific one (/api/vms/<some guid>) the user neither sees any placement policy information, nor can change it! i.e, only administrators are allowed to change the placement policy.

Comment 6 Oved Ourfali 2012-07-25 10:41:05 UTC
Commit: 1ca8d9e215bbf94138dac4ff1aa6055321fb438d

http://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=commit;h=1ca8d9e215bbf94138dac4ff1aa6055321fb438d


Note You need to log in before you can comment on or make changes to this bug.