Bug 1906023

Summary: ssh debug logging on FIPS causes REX job failure with OpenSSL::Digest::DigestError
Product: Red Hat Satellite Reporter: Peter Ondrejka <pondrejk>
Component: Remote ExecutionAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.7.0CC: aruzicka, ehelms, lstejska, pcreech
Target Milestone: 6.11.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-smart_proxy_remote_execution_ssh-0.5.0, tfm-rubygem-foreman-tasks-5.2.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-05 14:28:38 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 Peter Ondrejka 2020-12-09 14:45:17 UTC
Description of problem:

Found during verification of bz#1851382, setting ssh_log_level to debug on FIPS backend causes remote execution job to fail with:

Error initializing command: OpenSSL::Digest::DigestError - Digest initialization failed: disabled for fips

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

Satellite 6.9 snap 4

How reproducible:
always

Steps to Reproduce:
1. have a FIPS-enabled rhel 7 machine 
2. enable ssh debug log, see instructions in bz#1851382
3. run a REX command

Actual results:
Rex initialization fails

Expected results:
rex succeeds

Additional info:
Part of the ssh debug log is key fingerprint calculation that relies on a tool that is forbidden in FIPS mode

Comment 1 Adam Ruzicka 2020-12-14 07:54:36 UTC
This is something that needs to be fixed in net-ssh. In theory this exact issue *could* be fixed by this https://github.com/net-ssh/net-ssh/pull/591 , which was released in net-ssh 5.0. 

net-ssh devs are currently preparing to release version 6.2, but we're still shipping 4.2 in our repos, so even if it got fixed there right now, I wouldn't bet on us shipping a version with the fix for sat 6.9.

Comment 2 Brad Buckingham 2020-12-14 15:11:51 UTC
Is there a bugzilla to track the change needed to net-ssh?

Is this a regression in behavior from Satellite 6.8?

Comment 3 Adam Ruzicka 2020-12-14 15:55:47 UTC
> Is there a bugzilla to track the change needed to net-ssh?

I'm not aware of any. I tried searching and found only the one which got us to where we are now.

> Is this a regression in behavior from Satellite 6.8?

Depends on how you look at it. This was a case of two bugs countering each other out. On 6.8 on fips machine if you enabled ssh debug logging on the smart proxy, the job would run, but you wouldn't get the debug logs. In this regard, it is a regression.

On 6.9, you get the debug logs, but the job doesn't run because of something that happens when generating those logs. If debug logging worked on 6.8, then the job wouldn't run there either.

Comment 6 Peter Ondrejka 2022-02-11 09:58:48 UTC
Checked on Satellite 7.0 snap 8, using external rex capsule with fips enabled (to work around bz#2029914, forced using the setting introduced in bz#1873241). With ssh debug logging the rex job failed whith:

   1:Initialization error: RestClient::NotFound - 404 Not Found
   2:Initialization error: RestClient::NotFound - 404 Not Found
   3:Initialization error: RestClient::NotFound - 404 Not Found
   4:Initialization error: RestClient::NotFound - 404 Not FoundError loading data from Capsule: NoMethodError - undefined method `code' for "404 Not Found":String
   5:Did you mean?  encode

Error output from Dynflow attached. With ssh debug logging disabled the job executes successfully

Comment 7 Peter Ondrejka 2022-02-11 10:00:53 UTC
Created attachment 1860562 [details]
error_log

Comment 9 Peter Ondrejka 2022-04-14 10:53:44 UTC
Verified on Satellite 6.11 snap 16 on fips rhel8, enabled debug logging does not cause any errors when running rex jobs. The issue from comment 6 is tracked in BZ#2056966

Comment 12 errata-xmlrpc 2022-07-05 14:28:38 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 (Moderate: Satellite 6.11 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-2022:5498