Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2096930 - Non-admin user cannot list an individual capsule but can list all capsules
Summary: Non-admin user cannot list an individual capsule but can list all capsules
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Capsule - Content
Version: 6.10.6
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: 6.15.0
Assignee: satellite6-bugs
QA Contact: Vladimír Sedmík
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-14 15:10 UTC by Pablo Hess
Modified: 2024-04-23 17:12 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-04-23 17:12:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 36726 0 Normal New Non-admin user cannot list an individual capsule but can list all capsules 2023-09-06 14:35:21 UTC
Red Hat Issue Tracker SAT-19090 0 None None None 2023-07-21 13:18:00 UTC
Red Hat Product Errata RHSA-2024:2010 0 None None None 2024-04-23 17:12:23 UTC

Description Pablo Hess 2022-06-14 15:10:32 UTC
Description of problem:

This bug is even more relevant because the bootstrap.py script uses the /katello/api/capsules/<capsule_id> API endpoint to migrate hosts between capsules.

API requests to /katello/api/capsules/<some_capsule_id> fail if run by a non-admin user, even if said user has _all_ roles. As soon as we enable the admin flag for the user, the same API request works and returns information about the individual capsule.

In contrast, requests to /katello/api/capsules succeed without requiring the admin flag.

The information returned by the latter includes 100% of the information returned by the former, so the permission requirements for one of these two requests looks incorrect. I believe /katello/api/capsules/<capsule_id> should _not_ require the admin flag.


Version-Release number of selected component (if applicable):
Satellite 6.10 and earlier (tested on 6.9 and 6.8).


How reproducible:
100%

Steps to Reproduce:
1. Create a user on Satellite, give it all permissions but not _the_ admin flag.
2. Have an external capsule. In this example the external capsule ID is 2.
3. Query the API from Satellite itself at 2 points with the non-admin user:
    curl -k -u theuser:password https://localhost/katello/api/capsules/2
 and
    curl -k -u theuser:password https://localhost/katello/api/capsules/

Actual results:

The first curl command fails with:

{
  "error": {"message":"Resource smart_proxy not found by id '2'"}
}

The second command succeeds and returns all information about all capsules including capsule ID 2.


Expected results:

Both commands would succeed.



Additional info:

Location is not the issue here. These tests were performed on the lab and the user and capsule locations were made to match, or to differ. Location (mis)matching made no difference to the test outcomes, only the admin flag did.

Comment 2 Quinn James 2023-09-06 14:35:19 UTC
Created redmine issue https://projects.theforeman.org/issues/36726 from this bug

Comment 3 Bryan Kearney 2023-09-18 16:01:56 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36726 has been resolved.

Comment 5 Vladimír Sedmík 2024-01-08 20:49:34 UTC
Tested in 6.15.0 snap 5.0 - unauthorized user can't list or see details of any capsule now, while authorized user (with view_smart_proxies permission) can list and see details of any capsule in his org.

A minor BZ for improvement of the error message was filed: https://bugzilla.redhat.com/show_bug.cgi?id=2257333

Comment 8 errata-xmlrpc 2024-04-23 17:12:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.15.0 release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2024:2010


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