Skip to content

(PUP-10604) Guard against JRuby FIPS #8319

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

Conversation

joshcooper
Copy link
Contributor

Puppetserver still loads all types and providers during catalog compilation,
and JRuby with FIPS enabled cannot require rubygems. So guard the require
statement like we do in puppet/ssl/openssl_loader.

The /opt/puppetlabs/bin/puppetserver gem install command will fail
when running with JRuby with FIPS, so confine the provider when
fips_enabled is false. That way trying to manage a puppetserver gem
will print:

Error: /Stage[main]/Main/Package[uuid]: Provider puppetserver_gem is not functional on this host

instead of:

Error: Execution of '/opt/puppetlabs/bin/puppetserver gem install --no-document <gem>' returned 1:
  ERROR:  Loading command: install (NameError)
  cannot load (ext) (org.jruby.ext.openssl.OpenSSL)

Puppetserver still loads all types and providers during catalog compilation,
and JRuby with FIPS enabled cannot require rubygems. So guard the require
statement like we do in puppet/ssl/openssl_loader.

The `/opt/puppetlabs/bin/puppetserver gem install` command will fail
when running with JRuby with FIPS, so confine the provider when
`fips_enabled` is false. That way trying to manage a puppetserver gem
will print:

    Error: /Stage[main]/Main/Package[uuid]: Provider puppetserver_gem is not functional on this host

instead of:

    Error: Execution of '/opt/puppetlabs/bin/puppetserver gem install --no-document <gem>' returned 1:
      ERROR:  Loading command: install (NameError)
      cannot load (ext) (org.jruby.ext.openssl.OpenSSL)
@joshcooper joshcooper requested a review from a team September 4, 2020 17:44
@Magisus
Copy link
Contributor

Magisus commented Sep 4, 2020

We definitely don't expect this to be used on server right? Just loaded?

@joshcooper
Copy link
Contributor Author

Yeah, the server will be able to load the provider (via the Autoloader's Kernel.load), which will metaprogram the provider class and register it with the provider system, where it will remain unused... And that's all triggered due to settings catalog that is applied via Puppet.settings.use 🤦

@joshcooper joshcooper merged commit 1f07dc4 into puppetlabs:master Sep 4, 2020
@joshcooper joshcooper deleted the confine_puppetserver_gem_fips branch September 4, 2020 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants