[security] PlainSaslServerProvider conflicts with Hadoop SASL provider causing authentication failure
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 88/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- hadoop, java
調査の方向性
まず PlainSaslServerProvider.java とその initialize() メソッドを読み、次に Java Security provider の順序が Sasl.createSaslServer("PLAIN", ...) にどのような影響を与えるかを確認します。Fluss の provider が Hadoop の provider より前に登録され、CLIENT:SASL 認証が UnsupportedCallbackException で失敗しなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Search before asking
- I searched in the issues and found nothing similar.
Fluss version
main (development)
Please describe the bug 🐞
When running Fluss in an environment where Hadoop / HDFS dependencies are present on the classpath (for instance, when enabling HDFS remote log tiering or Paimon lake tiering), Hadoop's SaslRpcServer class registers its own SaslPlainServer.SecurityProvider into Java's Security providers.
Currently, Fluss initializes its SASL/PLAIN provider in PlainSaslServerProvider.java:
public static void initialize() {
Security.addProvider(new PlainSaslServerProvider());
}
Security.addProvider() appends Fluss's PlainSaslServerProvider to the end of the provider list.
When a client attempts to connect to Fluss using SASL/PLAIN authentication (CLIENT:SASL), Java's Sasl.createSaslServer("PLAIN", ...) iterates through the registered providers and selects the first matching PLAIN provider, which is Hadoop's SaslPlainServer.SecurityProvider instead of Fluss's.
Because Hadoop's SASL PLAIN provider expects Hadoop-specific callbacks, it fails during authentication:
WARN org.apache.fluss.rpc.netty.server.NettyServerHandler - Connection is still in the authentication process. Unable to handle API key: 1012.
...
PLAIN auth failed: javax.security.auth.callback.UnsupportedCallbackException: Unrecognized Callback
at org.apache.hadoop.security.SaslRpcServer$SaslPlainServer$SecurityProvider...
This causes all client SASL authentication attempts to fail.
Solution
In PlainSaslServerProvider.initialize(), use Security.insertProviderAt(new PlainSaslServerProvider(), 1); to register Fluss's PLAIN provider at the first position.
This guarantees that Fluss's own PlainSaslServer is always preferred over any third-party providers (such as Hadoop). This aligns with the implementation in Apache Kafka (org.apache.kafka.common.security.plain.PlainSaslServerProvider), which also uses Security.insertProviderAt(new PlainSaslServerProvider(), 1).
Are you willing to submit a PR?
- I'm willing to submit a PR!
- 主要言語
- Java
- スター
- 2.2k
- フォーク
- 656
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 97
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/fluss のほかの issue
-
[lake/iceberg] Reserved write-mode properties can be set and reset through their `iceberg.` key対応中かも @aphenix-r7 が 6 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
apache/fluss#4658 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[common] Decimal#hashCode is inconsistent with Decimal#equals対応中かも @firasbouzazi が 18 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/fluss#4538 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[server] KV snapshot scheduling stops permanently after a transient snapshot-init failure対応中かも @zhang-arvin が 23 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
apache/fluss#4489 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[docs] Document advertised-resource and ACL principal ignore-case options対応中かも @EchoLee5 が 36 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
[client] LimitBatchScanner leaks Arrow read context on log-table LIMIT scan対応中かも @EchoLee5 が 36 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
human-required sync-failed
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Azure/osdu-spi-file#63 ·
メンテナーはふだん 1 日以内に返信
-
frontend quick win
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
CodeForPhilly/benefit-decision-toolkit#571 ·
メンテナーはふだん 1 日以内に返信
-
approved
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
checkstyle/checkstyle#22129 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Add Hardcharger JDBC driver対応中かも @prmoore77 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信