-
Notifications
You must be signed in to change notification settings - Fork 722
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
Enable the -XX:[+|-]CRIUSecProvider jvm option #18354
Enable the -XX:[+|-]CRIUSecProvider jvm option #18354
Conversation
Marking as a draft. Doing the tests, once they are finished, will open it for review. FYI @jasonkatonica |
6d814e5
to
e6acbe4
Compare
@keithc-ca a pre-review may be helpful, I believe we will attempt to put this change into the 0.41 release, time permitting. |
Please explain how avoiding use of /**
* The CRIUSECProvider is a security provider that is used as follows when CRIU
* is enabled. During the checkpoint phase, all other security providers are
* removed, except CRIUSECProvider, and the digests are cleared, to ensure that
* no state is saved during checkpoint that is then restored during the restore
* phase. During the resore phase, CRIUSECProvider is removed and the other
* security providers are added back.
*/ |
When CRIU is enabled, during the checkpoint phase, currently, only the CRIUSecProvider is used. However, CRUISecProvider only supports a limited number of services. Some clients may have other requirements which might need to use other security services from other JCE providers. In order to avoid using of |
You've described some motivation for this, but not offered an explanation for how we will avoid capturing state in a snapshot that should not be present after a restore. Do you have draft changes for the extension repositories you can share that would illustrate how that problem is avoided? |
Test is passed. Open draft to ready for review. FYI @jasonkatonica |
Hi @keithc-ca I read through through @WilburZjh explanation here as to our use cases we are supporting with this feature. I find his description accurate and it does describe the motivation here to disable the In general there have never been any guarantees that all user application memory is absent of sensitive data when making use of the CRIU provider solution. Currently yes we take additional precautions of running resets on some algorithms although we share responsibility with liberty to ensure that the startup code in liberty consists of trusted / groomed code to support CRIU in a secure fashion. Liberty must clear their user supplied byte buffers and avoid creating immutable strings containing sensitive data AND the CRIU provider must force a few additional cleanups of potentially sensitive values from the CRIU provider perspective. Both of these actions must be in place in order to avoid the check-pointed files from containing sensitive information. If CRIU is used from a generalized caller ( non trusted non liberty code ) then there are no guarantees that all memory has been zerod of sensitive data. This being said supporting the approach of allowing the following use cases makes sense:
We do acknowledge that these are both corner cases. For this reason this option is implemented as a non default option for users. |
In my view there are (at least) two classes of sensitive information - things like keys (private or symmetric) and things like seeds of random number generation. It's not clear that applications can fully avoid generating all forms of sensitive information if they're free to use all security algorithms, particularly those which we haven't (yet?) integrated with CRIU. Liberty may be an important use case, but we shouldn't restrict our considerations to their goals. I'm still waiting for an "explanation for how we will avoid capturing state" and for related changes that would benefit from this. You suggest they might use not-real parameters, but I don't understand the value of that as compared with avoiding algorithms that won't be available until after the restore. A more minor complaint I have is with the name of the option; I'm not sure that "Env" contributes anything helpful, and as it relates to CRIU, that should form part of the name (or something more general, like "Snapshot" or "Checkpoint"). |
@keithc-ca I don't think this change is intending to provide any such guarantees. Anyone who uses this option is expected to assume the responsibility of protecting their secrets on disk (or invalidating them on restore) if they deem them sensitive. I will say that the name of the option is a little counter-intuitive. I would expect enabling something called "FullSecurityEnv" to be more secure, relative to the default, but this goes in the opposite direction. Maybe a better name is warranted? |
Hi Keith. As for the name of the option we were following along with a set pattern of other CRIU environment names but we are fine with considering other options. Are you aware of any non In terms of |
I don't know why you bring up MD5 here; perhaps you meant to make that comment in ibmruntimes/openj9-openjdk-jdk#685? Again, I'm still waiting to see something that would benefit from this change. If there's no code that calls |
Hi @keithc-ca , there will be a call |
Sorry yes i meant to make this comment in that review. I will duplicate this comment there for completeness. |
Please update this, including the commit message and the description here, to reflect the option name agreed upon in #18422 (-XX:-CRIUSecProvider). |
7eb9814
to
b352caf
Compare
jcl/src/java.base/share/classes/openj9/internal/criu/InternalCRIUSupport.java
Outdated
Show resolved
Hide resolved
jcl/src/java.base/share/classes/openj9/internal/criu/InternalCRIUSupport.java
Outdated
Show resolved
Hide resolved
jcl/src/java.base/share/classes/openj9/internal/criu/InternalCRIUSupport.java
Outdated
Show resolved
Hide resolved
jcl/src/openj9.criu/share/classes/org/eclipse/openj9/criu/CRIUSupport.java
Outdated
Show resolved
Hide resolved
ccf1c4a
to
9397259
Compare
jcl/src/java.base/share/classes/openj9/internal/criu/InternalCRIUSupport.java
Outdated
Show resolved
Hide resolved
63d20d4
to
bc0d987
Compare
e65eaed
to
f747a7b
Compare
jcl/src/openj9.criu/share/classes/org/eclipse/openj9/criu/CRIUSupport.java
Outdated
Show resolved
Hide resolved
jcl/src/java.base/share/classes/openj9/internal/criu/InternalCRIUSupport.java
Outdated
Show resolved
Hide resolved
Whenever we are performing a checkpoint this is typically done by enabling -XX:+EnableCRIUSupport. It will remove all the security providers and the CRIUSecProvider is inserted to the runtime enviroment. This provides a more locked down approach to what cryptography is allowed while taking a checkpoint. Therefore, this new flag is introduced by passing it after -XX:+EnableCRIUSupport is enabled. When this option is used, we no longer make use of CRIUSecProvider and instead use normal provider loading to enable all security algorithms in an out of the box state. This can allow users to make use of any algorithms in the various providers available.
f747a7b
to
df6acd4
Compare
Jenkins test sanity alinux jdk17 |
@WilburZjh pls create PRs to deliver this to https://github.com/eclipse-openj9/openj9/tree/v0.42.0-release and https://github.com/eclipse-openj9/openj9/tree/v0.43.0-release |
Whenever we are performing a checkpoint
this is typically done by enabling
-XX:+EnableCRIUSupport. It will remove
all the security providers and the
CRIUSecProvider is inserted to the
runtime enviroment. This provides a more
locked down approach to what cryptography
is allowed while taking a checkpoint.
Therefore, this new flag is introduced by
passing it when -XX:+EnableCRIUSupport is
active. When this option is used, we no
longer make use of CRIUSecProvider and
instead use normal provider loading to
enable all security algorithms in an out
of the box state. This can allow users to
make use of any algorithms in the various
providers available.