Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2160902

Summary: [RFE] Securing remote execution ssh key for provisioned hosts with 'from=Satellite.example.com' prefix
Product: Red Hat Satellite Reporter: Krutika Kinge <kkinge>
Component: Remote ExecutionAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED MIGRATED QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.12.0CC: aruzicka, ben.argyle, cylopez, drenard, dsinglet, emil.sylvio.golinelli, jesper.schmidt, terje.trane
Target Milestone: UnspecifiedKeywords: EasyFix, FutureFeature, MigratedToJIRA, Patch, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-06-06 16:05:06 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:

Description Krutika Kinge 2023-01-14 09:27:30 UTC
1. Proposed title of this feature request
Securing remote execution ssh key for provisioned hosts with 'from=<Satellite.example.com>' prefix

2. What is the nature and description of the request?
When a host is provisioned from a Satellite server. the Satellite server's public ssh key is added to the root's autherized_keys file.

The entry added to authorized keys does not limit from where the key is valid, if the private key gets copied it can be used to take root access of the server from any other host.

The entry in authorized_keys should use a from=”satellite.example.com” prefix to limit the key to only be valid from the satellite.


3. Why does the customer need this
its a major security concern for using remote execution at the moment

4. How would the customer like to achieve this?
 a prefix in autherized_keys file with satellite hostname: from=”satellite.example.com”

5. Is there already an existing RFE upstream or in Red Hat Bugzilla?
   No

6. Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?
No

7.  Is the sales team involved in this request and do they have any additional input?
No

8. 10. List any affected packages or components.
Remote execution, provisioning

9. Would the customer be able to assist in testing this functionality if implemented?
yes

Comment 1 Adam Ruzicka 2023-01-16 09:23:43 UTC
We would have to do this for all capsules as well, not only for satellite. The downside is that if we did this and someone renamed their capsule, then they would lose access to any host that was being managed through it. In general this feels like it has a great footgun potential, but I'll leave that to other to decide.

If we decide to do this, this will be an easy fix.

Comment 2 Ben 2023-01-16 10:35:10 UTC
We'd very much like to see this RFE enacted as soon as possible, please.

Comment 3 terje.trane 2023-01-16 12:10:27 UTC
I don't see a real problem with this for the (relative infrequent) case of someone renaming their capsules. 

There is already a procedure you have to go through, (see e.g.  
https://access.redhat.com/documentation/en-us/red_hat_satellite/6.9/html/administering_red_hat_satellite/sect-red_hat_satellite-administering_red_hat_satellite-renaming_a_server), so it is just a step has to be added to that.

Comment 4 Emil 2023-01-16 12:31:04 UTC
I would like to see this implemented soon, please.

Comment 5 Marek Hulan 2023-01-20 13:59:13 UTC
I think this is a great idea. There are couples of things to be considered. As Adam mentioned, all Capsules with REX feature would have to be listed. Another thing is, DNS is not always configured correctly and Satellite may not even know, what the record resolves to on managed hosts. Due to this, the functionality should be opt-in. Due to the DNS aspect, I'd suggest we introduce a Parameter "remote_execution_ssh_keys_accepted_from" which users would fill in (either globally, per host group etc). If some value is specified in there, it would be used in the configuring template.

Two other things to mention. To increase the security, the private keys that Satellite use can also be protected with the passphrase. Such passphrase then needs to be used every time the REX job is triggered.

Second - the requested functionality can already be implemented today. User can unlock and edit the default "remote_execution_ssh_keys" provisioning template snippet. This snippet is used both from provisioning templates and during the registration process. The lines that needs to be adjusted is 

  cat << EOF >> <%= ssh_path %>/authorized_keys
<%= host_param('remote_execution_ssh_keys').is_a?(String) ? host_param('remote_execution_ssh_keys') : host_param('remote_execution_ssh_keys').join("\n") %>
EOF

it would be slightly more complicated, but the following should do the trick

  cat << EOF >> <%= ssh_path %>/authorized_keys
<% if host_param('remote_execution_ssh_keys').is_a?(String) -%>
from=satellite.example.com <%= host_param('remote_execution_ssh_keys') -%>
<% else -%>
<%=  host_param('remote_execution_ssh_keys').map { |key| "from=satellite.example.com #{key}"}.join("\n") %>
<% end -%>
EOF

the satellite.example.com can be easily replaced with the parameter I mentioned above. Just keep in mind that with every update, the snippet will get restored. If you'd like to keep it persistent, you'd have to clone it and update your kickstart templates to use this new clone.

Comment 6 Brad Buckingham 2024-02-11 20:37:14 UTC
Upon review of our valid but aging backlog the Satellite Team has concluded that this Bugzilla does not meet the criteria for a resolution in the near term, and are planning to close in a month. This message may be a repeat of a previous update and the bug is again being considered to be closed. If you have any concerns about this, please contact your Red Hat Account team.  Thank you.

Comment 8 Brad Buckingham 2024-03-20 19:59:57 UTC
Based upon feedback during auto-closure, leaving this bugzilla open a while longer for additional discussion; however, it may be closed in a future iteration.

Comment 9 Eric Helms 2024-06-06 16:05:06 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "SAT-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.