Skip to content
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

Copy trust store to /tmp to work with readonly fs #288

Merged
merged 2 commits into from
May 18, 2023

Conversation

c0d1ngm0nk3y
Copy link
Contributor

@c0d1ngm0nk3y c0d1ngm0nk3y commented May 10, 2023

fixes #281

Summary

In case the truststore is readonly (readonly filesystem), it is copied to /tmp and used from there. That allows loading cacerts even with a readonly filesystem.

If /tmp is also readonly, it will still not fail, but warn the user about this. This is the previous behaviour.

Use Cases

Container is started with a readonly filesystem for security reasons.

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

@c0d1ngm0nk3y c0d1ngm0nk3y requested a review from a team as a code owner May 10, 2023 15:49
Copy link
Contributor

@dmikusa dmikusa left a comment

Choose a reason for hiding this comment

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

Looks good. One very minor thing and one question.

helper/openssl_certificate_loader.go Outdated Show resolved Hide resolved
helper/openssl_certificate_loader.go Show resolved Hide resolved
Co-authored-by: Sumit Kulhadia <sumit.kulhadia@sap.com>
@c0d1ngm0nk3y
Copy link
Contributor Author

We added the usage of os.Tempdir()....

@dmikusa dmikusa added semver:minor A change requiring a minor version bump type:enhancement A general enhancement labels May 18, 2023
@dmikusa dmikusa merged commit d5c1b13 into paketo-buildpacks:main May 18, 2023
@loewenstein
Copy link

@dmikusa is there a release planned for libjvm?

@dmikusa
Copy link
Contributor

dmikusa commented May 30, 2023

I was kind of hoping to get #158 sorted before cutting a release, but if this one is urgent for you we can move ahead without doing that.

@tojagrut
Copy link

tojagrut commented Jun 7, 2023

Hi @dmikusa can you release paketo-buildpacks/adoptium with this new version of libjvm? I am using adoptium buildpack and it is not using the latest released version of this libjvm library.

Cheers, Jagrut

@dmikusa
Copy link
Contributor

dmikusa commented Jun 7, 2023

We're bumping libpak first, so we can get in a fix there too. The libjvm release should be out shortly. Then we can bump the buildpacks. 🤞 it'll be in this Friday's release.

@dmikusa
Copy link
Contributor

dmikusa commented Jun 8, 2023

@tojagrut I just cut releases for all of our JVM provider buildpacks. If you're using one directly you can get that now. Otherwise, we'll bump the composite to include this fix on Friday as part of the normal release cycle.

@loewenstein SAP Machine buildpack is released & includes this fix, and also the other @c0d1ngm0nk3y patched around dependency comparison.

@beytularedzheb
Copy link

beytularedzheb commented Jun 11, 2023

Hello,
It looks like this change caused some issues in applications where users used to provide -Djavax.net.ssl.trustStore in JAVA_TOOL_OPTIONS.
As you can see below user provided parameter is ignored because of the appended -Djavax.net.ssl.trustStore=/tmp/truststore at the end of JAVA_TOOL_OPTIONS.
Is there any workaround to fix this?
Screenshot 2023-06-11 at 12 59 45

P.S.
Just found a way - setting BPI_JVM_CACERTS env variable fixes the issue.

@dmikusa
Copy link
Contributor

dmikusa commented Jun 12, 2023

@beytularedzheb Please open a new issue, and we can discuss it. Include some details about your use case and why you are setting that flag. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:minor A change requiring a minor version bump type:enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to update CACERTS when readOnlyRootFilesystem is set
5 participants