You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "aajisaka (via GitHub)" <gi...@apache.org> on 2026/09/23 18:09:51 UTC
[PR] [KYUUBI #7745] Add internal security token compatibility mode [kyuubi]
aajisaka opened a new pull request, #7762:
URL: https://github.com/apache/kyuubi/pull/7762
### Why are the changes needed?
To fix #7745
Add `kyuubi.internal.security.crypto.compatibilityMode` to support rolling upgrades from Kyuubi 1.11.1 or earlier.
- `STRICT` (default, same as 1.12.0 behavior) issues and accepts only random-IV-prefixed tokens
- `READ_COMPATIBLE` accepts both formats while issuing current tokens
- `MIGRATE` issues legacy zero-IV tokens while accepting both.
Document the phased `MIGRATE` to `READ_COMPATIBLE` to `STRICT` rollout and cover legacy token generation, secret normalization, and random-IV behavior in tests.
### How was this patch tested?
Added unit tests.
### Was this patch assisted by generative AI tooling?
Assisted-by: OpenCode (MiMo-V2.6-Pro)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
Re: [PR] [KYUUBI #7745] Add internal security token compatibility mode [kyuubi]
Posted by "aajisaka (via GitHub)" <gi...@apache.org>.
aajisaka commented on code in PR #7762:
URL: https://github.com/apache/kyuubi/pull/7762#discussion_r4172652081
##########
docs/security/internal_secure_access.md:
##########
@@ -45,16 +45,39 @@ We strongly recommend restricting access to these secrets.
Custom implementations of `EngineSecuritySecretProvider` are also supported for advanced secret management needs.
+## Rolling upgrades from Kyuubi 1.11.1 or earlier
+
+Kyuubi 1.12 changed the internal access token format from a ciphertext encrypted with a static zero IV to a
+ciphertext prefixed with a random IV. To interoperate with servers and engines from Kyuubi 1.11.1 or earlier,
+use the following rolling upgrade procedure:
+
+1. Configure every replacement Kyuubi server with
+ `kyuubi.internal.security.crypto.compatibilityMode=MIGRATE`. The configuration is propagated to newly
+ launched engines. In this mode, Kyuubi issues legacy zero-IV tokens and accepts both token formats.
+2. Replace all pre-1.12 servers and engines, then ensure that no pre-1.12 server or engine remains.
Review Comment:
Thanks. Updated in [90f00c2](https://github.com/apache/kyuubi/pull/7762/commits/90f00c2379544e9557df69ce78417df1043a24e0)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
Re: [PR] [KYUUBI #7745] Add internal security token compatibility mode [kyuubi]
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #7762:
URL: https://github.com/apache/kyuubi/pull/7762#discussion_r4134892092
##########
kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala:
##########
@@ -3204,6 +3204,31 @@ object KyuubiConf {
.version("1.12.0")
.fallbackConf(ENGINE_SECURITY_CRYPTO_CIPHER_TRANSFORMATION)
+ object InternalSecurityCryptoCompatibilityMode extends Enumeration {
+ type InternalSecurityCryptoCompatibilityMode = Value
+
+ val STRICT, READ_COMPATIBLE, MIGRATE = Value
+ }
+
+ val INTERNAL_SECURITY_CRYPTO_COMPATIBILITY_MODE: ConfigEntry[String] =
+ buildConf("kyuubi.internal.security.crypto.compatibilityMode")
+ .doc("Controls internal access token compatibility. Supported values: <ul>" +
+ "<li>STRICT: issue and accept only tokens with a prefixed random IV.</li>" +
+ "<li>READ_COMPATIBLE: issue tokens with a prefixed random IV and accept both token " +
+ "formats.</li>" +
+ "<li>MIGRATE: issue and accept both token formats using the legacy static zero IV for " +
+ "issued tokens.</li>" +
+ "</ul> MIGRATE weakens token security and should only be used during a rolling " +
+ "upgrade from Kyuubi 1.11.1 or earlier. This compatibility mode will be removed in a " +
+ "future release.")
Review Comment:
Given that "this compatibility mode will be removed in a future release.", let's put a `legacy` namespace in the config name, e.g., `kyuubi.legacy.internal.security.crypto.compatMode`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
Re: [PR] [KYUUBI #7745] Add internal security token compatibility mode [kyuubi]
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #7762:
URL: https://github.com/apache/kyuubi/pull/7762#discussion_r4134905371
##########
docs/deployment/migration-guide.md:
##########
@@ -24,6 +24,13 @@
* Since Kyuubi 1.13, the support of Flink engine for Flink 2.0 is deprecated, and will be removed in the future.
* Since Kyuubi 1.13, `kyuubi.server.redaction.regex` defaults to `(?i)secret|password|token|access[.]key` instead of being unset, so `kyuubi.server.conf.retrieveMode=REDACTED` (the default) redacts matching session-config keys/values out of the box; it also affects the command-line arguments Kyuubi logs for spawned engine processes. Set it to a different pattern to override.
+## Upgrading from Kyuubi 1.11.1 or earlier to 1.12.1 or later
+
+* Since Kyuubi 1.12, internal access token encryption uses a random IV instead of a static zero IV. Starting
+ with Kyuubi 1.12.1, use `kyuubi.internal.security.crypto.compatibilityMode` to perform a rolling upgrade of
+ servers and engines from Kyuubi 1.11.1 or earlier as described in
Review Comment:
we will have other patch releases in 1.11.x
```suggestion
servers and engines from Kyuubi 1.11.x or earlier as described in
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
Re: [PR] [KYUUBI #7745] Add internal security token compatibility mode [kyuubi]
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #7762:
URL: https://github.com/apache/kyuubi/pull/7762#discussion_r4134892092
##########
kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala:
##########
@@ -3204,6 +3204,31 @@ object KyuubiConf {
.version("1.12.0")
.fallbackConf(ENGINE_SECURITY_CRYPTO_CIPHER_TRANSFORMATION)
+ object InternalSecurityCryptoCompatibilityMode extends Enumeration {
+ type InternalSecurityCryptoCompatibilityMode = Value
+
+ val STRICT, READ_COMPATIBLE, MIGRATE = Value
+ }
+
+ val INTERNAL_SECURITY_CRYPTO_COMPATIBILITY_MODE: ConfigEntry[String] =
+ buildConf("kyuubi.internal.security.crypto.compatibilityMode")
+ .doc("Controls internal access token compatibility. Supported values: <ul>" +
+ "<li>STRICT: issue and accept only tokens with a prefixed random IV.</li>" +
+ "<li>READ_COMPATIBLE: issue tokens with a prefixed random IV and accept both token " +
+ "formats.</li>" +
+ "<li>MIGRATE: issue and accept both token formats using the legacy static zero IV for " +
+ "issued tokens.</li>" +
+ "</ul> MIGRATE weakens token security and should only be used during a rolling " +
+ "upgrade from Kyuubi 1.11.1 or earlier. This compatibility mode will be removed in a " +
+ "future release.")
Review Comment:
Given that "this compatibility mode will be removed in a future release.", let's put a `legacy` namespace in the config name, e.g., `kyuubi.internal.security.legacy.crypto.compatMode`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
Re: [PR] [KYUUBI #7745] Add internal security token compatibility mode [kyuubi]
Posted by "aajisaka (via GitHub)" <gi...@apache.org>.
aajisaka commented on code in PR #7762:
URL: https://github.com/apache/kyuubi/pull/7762#discussion_r4172649073
##########
kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala:
##########
@@ -3204,6 +3204,31 @@ object KyuubiConf {
.version("1.12.0")
.fallbackConf(ENGINE_SECURITY_CRYPTO_CIPHER_TRANSFORMATION)
+ object InternalSecurityCryptoCompatibilityMode extends Enumeration {
+ type InternalSecurityCryptoCompatibilityMode = Value
+
+ val STRICT, READ_COMPATIBLE, MIGRATE = Value
+ }
+
+ val INTERNAL_SECURITY_CRYPTO_COMPATIBILITY_MODE: ConfigEntry[String] =
+ buildConf("kyuubi.internal.security.crypto.compatibilityMode")
+ .doc("Controls internal access token compatibility. Supported values: <ul>" +
+ "<li>STRICT: issue and accept only tokens with a prefixed random IV.</li>" +
+ "<li>READ_COMPATIBLE: issue tokens with a prefixed random IV and accept both token " +
+ "formats.</li>" +
+ "<li>MIGRATE: issue and accept both token formats using the legacy static zero IV for " +
+ "issued tokens.</li>" +
+ "</ul> MIGRATE weakens token security and should only be used during a rolling " +
+ "upgrade from Kyuubi 1.11.1 or earlier. This compatibility mode will be removed in a " +
+ "future release.")
Review Comment:
Thanks. Updated in [90f00c2](https://github.com/apache/kyuubi/pull/7762/commits/90f00c2379544e9557df69ce78417df1043a24e0)
##########
docs/deployment/migration-guide.md:
##########
@@ -24,6 +24,13 @@
* Since Kyuubi 1.13, the support of Flink engine for Flink 2.0 is deprecated, and will be removed in the future.
* Since Kyuubi 1.13, `kyuubi.server.redaction.regex` defaults to `(?i)secret|password|token|access[.]key` instead of being unset, so `kyuubi.server.conf.retrieveMode=REDACTED` (the default) redacts matching session-config keys/values out of the box; it also affects the command-line arguments Kyuubi logs for spawned engine processes. Set it to a different pattern to override.
+## Upgrading from Kyuubi 1.11.1 or earlier to 1.12.1 or later
Review Comment:
Updated to 1.11.x in [90f00c2](https://github.com/apache/kyuubi/pull/7762/commits/90f00c2379544e9557df69ce78417df1043a24e0)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
Re: [PR] [KYUUBI #7745] Add internal security token compatibility mode [kyuubi]
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #7762:
URL: https://github.com/apache/kyuubi/pull/7762#discussion_r4134898892
##########
docs/deployment/migration-guide.md:
##########
@@ -24,6 +24,13 @@
* Since Kyuubi 1.13, the support of Flink engine for Flink 2.0 is deprecated, and will be removed in the future.
* Since Kyuubi 1.13, `kyuubi.server.redaction.regex` defaults to `(?i)secret|password|token|access[.]key` instead of being unset, so `kyuubi.server.conf.retrieveMode=REDACTED` (the default) redacts matching session-config keys/values out of the box; it also affects the command-line arguments Kyuubi logs for spawned engine processes. Set it to a different pattern to override.
+## Upgrading from Kyuubi 1.11.1 or earlier to 1.12.1 or later
Review Comment:
should be
```suggestion
## Upgrading from Kyuubi 1.12.0 or earlier to 1.12.1 or later
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
Re: [PR] [KYUUBI #7745] Add internal security token compatibility mode [kyuubi]
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on PR #7762:
URL: https://github.com/apache/kyuubi/pull/7762#issuecomment-5892812831
TBH, Kyuubi does not guarantee cross-version wire compatibility between server and engine, but I'm fine with accepting this change if the user really wants it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
Re: [PR] [KYUUBI #7745] Add internal security token compatibility mode [kyuubi]
Posted by "aajisaka (via GitHub)" <gi...@apache.org>.
aajisaka commented on code in PR #7762:
URL: https://github.com/apache/kyuubi/pull/7762#discussion_r4172285026
##########
docs/deployment/migration-guide.md:
##########
@@ -24,6 +24,13 @@
* Since Kyuubi 1.13, the support of Flink engine for Flink 2.0 is deprecated, and will be removed in the future.
* Since Kyuubi 1.13, `kyuubi.server.redaction.regex` defaults to `(?i)secret|password|token|access[.]key` instead of being unset, so `kyuubi.server.conf.retrieveMode=REDACTED` (the default) redacts matching session-config keys/values out of the box; it also affects the command-line arguments Kyuubi logs for spawned engine processes. Set it to a different pattern to override.
+## Upgrading from Kyuubi 1.11.1 or earlier to 1.12.1 or later
Review Comment:
Thanks. I think it should be 1.11.x. 1.12.0 has random IV and the same as `kyuubi.internal.security.legacy.crypto.compatMode=STRICT`, so 1.12.0 will be excluded.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
Re: [PR] [KYUUBI #7745] Add internal security token compatibility mode [kyuubi]
Posted by "aajisaka (via GitHub)" <gi...@apache.org>.
aajisaka commented on code in PR #7762:
URL: https://github.com/apache/kyuubi/pull/7762#discussion_r4172650723
##########
docs/deployment/migration-guide.md:
##########
@@ -24,6 +24,13 @@
* Since Kyuubi 1.13, the support of Flink engine for Flink 2.0 is deprecated, and will be removed in the future.
* Since Kyuubi 1.13, `kyuubi.server.redaction.regex` defaults to `(?i)secret|password|token|access[.]key` instead of being unset, so `kyuubi.server.conf.retrieveMode=REDACTED` (the default) redacts matching session-config keys/values out of the box; it also affects the command-line arguments Kyuubi logs for spawned engine processes. Set it to a different pattern to override.
+## Upgrading from Kyuubi 1.11.1 or earlier to 1.12.1 or later
+
+* Since Kyuubi 1.12, internal access token encryption uses a random IV instead of a static zero IV. Starting
+ with Kyuubi 1.12.1, use `kyuubi.internal.security.crypto.compatibilityMode` to perform a rolling upgrade of
+ servers and engines from Kyuubi 1.11.1 or earlier as described in
Review Comment:
Thanks. Updated in [90f00c2](https://github.com/apache/kyuubi/pull/7762/commits/90f00c2379544e9557df69ce78417df1043a24e0)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
Re: [PR] [KYUUBI #7745] Add internal security token compatibility mode [kyuubi]
Posted by "aajisaka (via GitHub)" <gi...@apache.org>.
aajisaka commented on PR #7762:
URL: https://github.com/apache/kyuubi/pull/7762#issuecomment-5966929437
> TBH, Kyuubi does not guarantee cross-version wire compatibility between server and engine, but I'm fine with accepting this change if the user really wants it.
Thank you @pan3793
Maybe we need to explicitly document it.
@oh0873 do you still want this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
Re: [PR] [KYUUBI #7745] Add internal security token compatibility mode [kyuubi]
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #7762:
URL: https://github.com/apache/kyuubi/pull/7762#discussion_r4134976796
##########
docs/security/internal_secure_access.md:
##########
@@ -45,16 +45,39 @@ We strongly recommend restricting access to these secrets.
Custom implementations of `EngineSecuritySecretProvider` are also supported for advanced secret management needs.
+## Rolling upgrades from Kyuubi 1.11.1 or earlier
+
+Kyuubi 1.12 changed the internal access token format from a ciphertext encrypted with a static zero IV to a
+ciphertext prefixed with a random IV. To interoperate with servers and engines from Kyuubi 1.11.1 or earlier,
+use the following rolling upgrade procedure:
+
+1. Configure every replacement Kyuubi server with
+ `kyuubi.internal.security.crypto.compatibilityMode=MIGRATE`. The configuration is propagated to newly
+ launched engines. In this mode, Kyuubi issues legacy zero-IV tokens and accepts both token formats.
+2. Replace all pre-1.12 servers and engines, then ensure that no pre-1.12 server or engine remains.
Review Comment:
I suppose this will only happen when configuring `kyuubi.session.engine.spark.main.resource` (default NULL) explicitly, without that, Kyuubi server always picks up the matched version of engine jar from `KYUUBI_HOME` sub-dir
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org