Skip to content

(PE-37599) Openssl-1.1.1-fips fix for client-tools-runtime-2021.7.x project for Redhatfips #803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

imaqsood
Copy link
Contributor

@imaqsood imaqsood commented Mar 14, 2024

Description

While constructing the client-tool-runtime-2021.7.x for Redhatfips-9-x86_64, we encountered a challenge related to OpenSSL. Specifically, we encountered an error message indicating "Unable to find a match: openssl-1.1.1k". Upon investigation, it became apparent that Redhat9 is equipped with OpenSSL 3.0.1 as its default version, rendering OpenSSL 1.1.1k unavailable for Redhat9.

The curl and ca-bundle components rely on OpenSSL, specified using build_require, which installs openssl-1.1.1k for Redhatfips. However, it neglects to utilize the openssl-1.1.1-fips component.

However, our preferred option should be openssl-1.1.1-fips instead of openssl-1.1.1k, as we are applying FIPS-related patches to openssl-1.1.1-fips. It's worth noting that openssl-1.1.1k is a CentOS package without FIPS patches.

Testing Done

redhatfips-7-x86_64
redhatfips-8-x86_64
redhatfips-9-x86_64

@imaqsood imaqsood requested review from a team as code owners March 14, 2024 13:47
@imaqsood imaqsood marked this pull request as draft March 14, 2024 13:47
@imaqsood imaqsood marked this pull request as ready for review March 15, 2024 07:30
Copy link
Collaborator

@joshcooper joshcooper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what's going on now. I think we should use continue using openssl 1.1.1k, so change this:

elsif platform.name =~ /^redhatfips-[89]/
  proj.setting(:openssl_version, '1.1.1k')

You also need to do the following below on line 114, so that we build our openssl-1.1.1k component:

elsif (platform.name =~ /^redhatfips-[89]/ && proj.openssl_version == '1.1.1k'
  proj.component "openssl-1.1.1-fips"

For example see how the agent does the same:

elsif platform.name =~ /^redhatfips-.*/
proj.component "openssl-1.1.1-fips"

@imaqsood
Copy link
Contributor Author

imaqsood commented Mar 18, 2024

I see what's going on now. I think we should use continue using openssl 1.1.1k, so change this:

elsif platform.name =~ /^redhatfips-[89]/
  proj.setting(:openssl_version, '1.1.1k')

You also need to do the following below on line 114, so that we build our openssl-1.1.1k component:

elsif (platform.name =~ /^redhatfips-[89]/ && proj.openssl_version == '1.1.1k'
  proj.component "openssl-1.1.1-fips"

For example see how the agent does the same:

elsif platform.name =~ /^redhatfips-.*/
proj.component "openssl-1.1.1-fips"

I tested this PR with OpenSSL 1.1.1k before, but we couldn't install it during the build. The error said it couldn't find a match. I also tried with OpenSSL-1.1.1, but got the same error.

Error: Unable to find a match: openssl-1.1.1k

@imaqsood imaqsood force-pushed the PE-37599 branch 2 times, most recently from 81b955a to ab91ccf Compare March 18, 2024 15:34
Copy link
Collaborator

@joshcooper joshcooper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@imaqsood could you describe what behavior changed and why this change was made? Specifically, why did proj.setting(:openssl_version, '1.1.1k') cause the client tools runtime to fail on RHEL FIPS 9 and what happens now?

@joshcooper
Copy link
Collaborator

For posterity, this changes RHELFIPS 8 and 9:

$ bundle exec rake vanagon:component_diff -- -P client-tools-runtime-2021.7.x -p all --from upstream/master --to HEAD 
...
Here is what your code changes would affect:

Project client-tools-runtime-2021.7.x

Platform name: redhatfips-8-x86_64
    Component 'curl'
        Field: build_requires[0]
        --------------------
        - openssl-1.1.1k
        + openssl-1.1.1-fips


    Component 'puppet-ca-bundle'
        Field: build_requires[0]
        --------------------
        - openssl-1.1.1k
        + openssl-1.1.1-fips


Platform name: redhatfips-9-x86_64
    Component 'openssl-1.1.1' was removed, not showing diff for it

    Component 'openssl-1.1.1-fips' was newly added, not showing diff for it

    Component 'curl'
        Field: build_requires[0]
        --------------------
        - openssl-1.1.1
        + openssl-1.1.1-fips


    Component 'puppet-ca-bundle'
        Field: build_requires[0]
        --------------------
        - openssl-1.1.1
        + openssl-1.1.1-fips

@@ -25,8 +25,8 @@
# and krb5-devel
if proj.settings[:openssl_version]
# already defined in the project
elsif platform.name =~ /^redhatfips-8/
proj.setting(:openssl_version, '1.1.1k')
elsif platform.name =~ /^redhatfips-[89]/
Copy link
Collaborator

@joshcooper joshcooper Mar 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you update the We need to explicitly define 1.1.1k here comment above?

@joshcooper
Copy link
Collaborator

It looks like configs/projects/pe-installer-runtime-2021.7.x.rb has the same problem, but since we don't support RHEL9 FIPS primary servers yet, then it's not an issue we need to solve right now. But perhaps file a JIRA ticket so we remember to fix it later?

$ git grep 1.1.1k configs/projects/
configs/projects/_shared-client-tools-runtime.rb:# We need to explicitly define 1.1.1k here to avoid
configs/projects/pe-installer-runtime-2021.7.x.rb:  # We need to explicitly define 1.1.1k here to avoid
configs/projects/pe-installer-runtime-2021.7.x.rb:    proj.setting(:openssl_version, '1.1.1k')

@imaqsood imaqsood changed the title (PE-37599) Build client-tools-runtime-2021.7.x project for Red Hat 9 … (PE-37599) Openssl-1.1.1-fips fix for client-tools-runtime-2021.7.x project for Redhatfips Mar 19, 2024
@joshcooper joshcooper merged commit cba7d57 into puppetlabs:master Mar 19, 2024
@joshcooper joshcooper added the skip changelog Will be excluded from changelog label Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip changelog Will be excluded from changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants