Bug 2222816
Summary: | Preflight tests require that sudo allow the remote_execution_ssh_user to run "/usr/bin/true" for REX to work | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Joniel Pasqualetto <jpasqual> | ||||||
Component: | Remote Execution | Assignee: | Adam Ruzicka <aruzicka> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Lukáš Hellebrandt <lhellebr> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | 6.12.4 | CC: | aruzicka, iballou, jbhatia, mkalyat, pcreech, pmoravec, rlavi, saydas, smallamp | ||||||
Target Milestone: | 6.15.0 | Keywords: | Triaged | ||||||
Target Release: | Unused | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | rubygem-smart_proxy_remote_execution_ssh-0.10.3 | Doc Type: | If docs needed, set a value | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2024-04-23 17:11:40 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Joniel Pasqualetto
2023-07-13 20:40:05 UTC
Any suggestions how to pull this off without losing the fix for https://projects.theforeman.org/issues/34363 ? Deal with the "test" and ¨effective-user-test" scripts the same way we deal with the actual REX script. Put the commands you want to run (on this case, just "true") inside them and use the script-wrapper to run it. This way, we'll simulate exactly (except for the content of the script) what the REX will be doing. Created redmine issue https://projects.theforeman.org/issues/36647 from this bug Bulk setting Target Milestone = 6.15.0 where sat-6.15.0+ is set. Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36647 has been resolved. Verified with Sat 6.15 snap 1.0 1) On the host: # useradd SATUSER # passwd SATUSER # visudo # grep SATCMNDS /etc/sudoers Cmnd_Alias SATCMNDS=/var/tmp/foreman-ssh-cmd-*/script,!/var/tmp/foreman-ssh-cmd-*\ *,!/var/tmp/foreman-ssh-cmd-*..* SATUSER ALL=NOPASSWD:SATCMNDS 2) In WebUI: Administer -> Settings Search for "remote_execution_ssh_user" Set it to SATUSER 3) Run the REX job against the host: Template: Script default Command: echo $(whoami),$(date) >> /tmp/test Effective user: root 4) # cat /tmp/test root,Mon Dec 11 07:45:04 EST 2023 5) On Satellite, empty output: # grep "command not allowed" /var/log/foreman/production.log QED 6) To verify that the user was indeed used: # userdel SATUSER 7) Do 3) again, the job should fail: ``` Error initializing command: RuntimeError - Could not establish connection to remote host using any available authentication method, tried publickey Exit status: EXCEPTION StandardError: Job execution failed ``` 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 Created attachment 2033427 [details]
Hotfix RPM for Satellite 6.13.7
A hotfix RPM is available for this BZ for Satellite 6.13.7 on RHEL 8
INSTALL INSTRUCTIONS:
1. Take a complete backup or snapshot of Satellite 6.13.7 server
2. Download the hotfix RPM from this attachment
3. # dnf install ./rubygem-smart_proxy_remote_execution_ssh-0.10.3-1.HOTFIXRHBZ2222816.el8sat.noarch.rpm --disableplugin=foreman-protector
4. # satellite-maintain service restart
Created attachment 2033428 [details]
Hotfix RPM for Satellite 6.14.4
A hotfix RPM is available for this BZ for Satellite 6.14.4 on RHEL 8
This hotfix RPM is the same as for Satellite 6.13.7
INSTALL INSTRUCTIONS:
1. Take a complete backup or snapshot of Satellite 6.14.4 server
2. Download the hotfix RPM from this attachment
3. # dnf install ./rubygem-smart_proxy_remote_execution_ssh-0.10.3-1.HOTFIXRHBZ2222816.el8sat.noarch.rpm --disableplugin=foreman-protector
4. # satellite-maintain service restart
Jayant, Can you check with the customer if the provided hotfix helped? -Sudhir |