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 2142555 - import puppet classes permission filter does not work
Summary: import puppet classes permission filter does not work
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Puppet
Version: 6.11.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.13.0
Assignee: satellite6-bugs
QA Contact: visawant
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-11-14 12:09 UTC by Stefan Nemeth
Modified: 2023-05-03 13:22 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-03 13:22:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SAT-14681 0 None None None 2023-01-05 06:54:12 UTC
Red Hat Product Errata RHSA-2023:2097 0 None None None 2023-05-03 13:22:56 UTC

Description Stefan Nemeth 2022-11-14 12:09:30 UTC
Description of problem:

permissions

Puppetclass -> import_puppetclasses

for limited users does not work. Instead, when such user is used, error 

"error": {"message":"Access denied","details":"Missing one of the required permissions: ","missing_permissions":[]}

is returned

Version-Release number of selected component (if applicable):

6.11.4

How reproducible:

100%

Steps to Reproduce:
1. administer -> users create user "puppetenvuser" 
2. administer -> roles create role "puppet-env-import-role" 
with following filters:

hammer role filters --name puppet-env-import-role
----|---------------|--------|------------|-----------|------------------------|-------------------------------------------
ID  | RESOURCE TYPE | SEARCH | UNLIMITED? | OVERRIDE? | ROLE                   | PERMISSIONS
----|---------------|--------|------------|-----------|------------------------|-------------------------------------------
588 | Puppetclass   | none   | yes        | no        | puppet-env-import-role | create_puppetclasses, import_puppetclasses
592 | Location      | none   | no         | no        | puppet-env-import-role | view_locations
593 | Organization  | none   | no         | no        | puppet-env-import-role | view_organizations
594 | SmartProxy    | none   | yes        | no        | puppet-env-import-role | view_smart_proxies
595 | Environment   | none   | yes        | no        | puppet-env-import-role | view_environments
----|---------------|--------|------------|-----------|------------------------|-----------------------

3. assign puppet-env-import-role to puppetenvuser
4. try to use puppetenvuser to import puppet classes

Actual results:

#curl -s -k -X POST -u puppetenvuser:redhat -H "Content-Type: application/json" https://10.44.129.52/api/environments/production/smart_proxies/1/import_puppetclasses?dryrun=true

{
  "error": {"message":"Access denied","details":"Missing one of the required permissions: ","missing_permissions":[]}
}

Expected results:

#curl -s -k -X POST -u puppetenvuser:redhat -H "Content-Type: application/json" https://10.44.129.52/api/environments/production/smart_proxies/1/import_puppetclasses?dryrun=true
{
  "message": "Successfully updated environment and puppetclasses from the on-disk puppet installation",
  "results": {"name":"production","actions":["new"],"new_puppetclasses":["access_insights_client::current","access_insights_client","access_insights_client::old","foreman_scap_client","foreman_scap_client::params","stdlib","stdlib::stages"]}
}

Additional info:

in /usr/share/gems/gems/foreman_puppet-2.0.6/lib/foreman_puppet/register.rb  adding 

    permission :import_puppetclasses, { 'foreman_puppet/puppetclasses' => %i[import_environments obsolete_and_new],
                                        'foreman_puppet/api/v2/environments' => [:import_puppetclasses],
 +                                      'api/v2/smart_proxies' => [:import_puppetclasses]  },

fixes the issue

Comment 8 Ron Lavi 2023-01-25 13:18:31 UTC
Yes, to view that page from the web-ui, the user needs the `view_puppetclasses` permission.
glad to see that the other requests are also working now, I think it's safe to move it to VERIFIED

Comment 11 errata-xmlrpc 2023-05-03 13:22:42 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.13 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-2023:2097


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