Project

General

Profile

Actions

Bug #39086

closed

mgr/dashboard: "readonly user" can't see any pages

Added by Lenz Grimmer about 5 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
High
Assignee:
Stephan Müller
Category:
Security & Auth
Target version:
% Done:

0%

Source:
Tags:
Backport:
nautilus
Regression:
Yes
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

When logging in as a user with the "readonly" role, the dashboard hides all pages with the message "Sorry, you are not allowed to see what you were looking for." after a few seconds (the refresh interval?). Also, a toasty error message appears that shown as "403 Forbidden" error (see screenshot attached).


Files

Peek 2019-04-02 23-33.gif (564 KB) Peek 2019-04-02 23-33.gif Lenz Grimmer, 04/03/2019 03:38 AM

Related issues 1 (0 open1 closed)

Copied to Dashboard - Backport #39240: nautilus: mgr/dashboard: "readonly user" can't see any pagesResolvedStephan MüllerActions
Actions #1

Updated by Ernesto Puerta about 5 years ago

  • Category changed from 132 to 145

The 403 is triggered by the /api/prometheus/get_notifications_since endpoint (this can be easily seen in the browser inspector -> network tab). It seems that PROMETHEUS scope has no any READ-only permissions defined. It's an easy fix.

Actions #2

Updated by Ricardo Marques about 5 years ago

Ernesto Puerta wrote:

The 403 is triggered by the /api/prometheus/get_notifications_since endpoint (this can be easily seen in the browser inspector -> network tab). It seems that PROMETHEUS scope has no any READ-only permissions defined. It's an easy fix.

Note that this endpoint is a 'POST' so it requires CREATE permission https://github.com/ceph/ceph/blob/master/src/pybind/mgr/dashboard/controllers/__init__.py#L724

We can fix this by adding the `@ReadPermission` decorator to the `get_notifications_since` method or by changing this endpoit to a 'GET' (not sure if the latter breaks any prometheus integration).

Actions #3

Updated by Ricardo Marques about 5 years ago

  • Assignee set to Stephan Müller
Actions #4

Updated by Ernesto Puerta about 5 years ago

Ricardo Marques wrote:

Note that this endpoint is a 'POST' so it requires CREATE permission https://github.com/ceph/ceph/blob/master/src/pybind/mgr/dashboard/controllers/__init__.py#L724

In that case I think the proper approach is using GET (as we are neither creating nor modifying anything in that endpoint) and passing the last notification param in the query string: GET /prometheus/notifications?from=<last_notification>.

Actions #5

Updated by Stephan Müller about 5 years ago

  • Status changed from New to Fix Under Review
  • Pull request ID set to 27348

It needs to be post as we give the last notification the dashboard got, this will return only newer notifications that the given one. This reduces the request size as this is called every 5s.

Actions #6

Updated by Lenz Grimmer about 5 years ago

Stephan Müller wrote:

It needs to be post as we give the last notification the dashboard got, this will return only newer notifications that the given one. This reduces the request size as this is called every 5s.

The problem with using a POST request here is that it also floods the audit log, if dashboard auditing is enabled (the auditing code logs all requests except for GET, IIRC).

Actions #7

Updated by Stephan Müller about 5 years ago

In the PR that will be merged soon, I'm using GET now.

Actions #8

Updated by Lenz Grimmer about 5 years ago

  • Translation missing: en.field_tag_list set to usability
  • Tags deleted (usability)
Actions #9

Updated by Lenz Grimmer about 5 years ago

  • Status changed from Fix Under Review to Pending Backport
  • Target version set to v15.0.0
Actions #10

Updated by Nathan Cutler about 5 years ago

  • Copied to Backport #39240: nautilus: mgr/dashboard: "readonly user" can't see any pages added
Actions #11

Updated by Ricardo Marques about 5 years ago

  • Status changed from Pending Backport to Resolved
Actions #12

Updated by Ernesto Puerta about 3 years ago

  • Project changed from mgr to Dashboard
  • Category changed from 145 to Security & Auth
Actions

Also available in: Atom PDF