Advertise SCRAM-SHA-256-PLUS only on TLS connections (like postgres)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- postgresql, rust
調査の方向性
Start with src/api/auth/sasl.rs, src/api/mod.rs, and src/tokio/server.rs to trace how TLS state reaches authentication and how mechanisms are advertised and dispatched. Then inspect ScramServerAuth::on_client_first_message_with_secret and the changes from #476. Done means SCRAM-SHA-256-PLUS is offered and accepted only over TLS, and the y gs2 flag is rejected only on TLS when a certificate is configured.
索引モデルが issue の本文から書いたものです。
説明
Problem
ScramAuth advertises SCRAM-SHA-256-PLUS whenever a certificate is configured, regardless of whether the connection is actually over TLS (rebuild_supported_mechanisms builds a static list). Channel binding is only possible over TLS, so advertising -PLUS on a plaintext connection is wrong:
-
An RFC-correct client that supports channel binding and sees
-PLUSoffered MUST use thep=gs2 flag (RFC 5802 §6) — but it cannot computetls-server-end-pointdata without TLS. Postgres avoids this trap by never offering-PLUSon non-TLS connections:// auth-scram.c, scram_get_mechanisms /* * ... Channel binding is only supported with SSL. */ if (port->ssl_in_use) appendStringInfoString(buf, SCRAM_SHA_256_PLUS_NAME); -
Interaction with #476: the gs2-flag checks added there are static — a
yflag is rejected whenever a certificate is configured, even on non-TLS connections, wherey(orn) is the only option a client has. Postgres rejectsyonly whenssl_in_use. After this change both the advertisement and the gs2 checks should key off the connection's TLS state, not just certificate configuration.
Scope
- Advertise per connection: offer
SCRAM-SHA-256-PLUSonly when the connection is secure. - Reject
-PLUSselection on non-TLS connections in the mechanism dispatch (postgres does this inscram_init: channel binding cannot be performed without SSL). - Make the gs2-flag checks connection-aware:
yshould be rejected only when the connection is over TLS and a certificate is configured.
API feasibility — what exists today vs what's missing
The TLS state is available and accurate at auth time:
negotiate_tls(src/tokio/server.rs) buildsDefaultClient::new(addr, true)right after the TLS handshake andfalsefor plain connections, before the startup/auth flow.ClientInfo::is_secure()(src/api/mod.rs) exposes it.- Both
AuthMechanism::begin(client)andAuthMechanism::next(client, msg)receive the client, soScramMechanism/SaslMechanismcan see it.
Two public surfaces currently can't use it:
SaslMechanismFactory::sasl_mechanism_names(&self)takes no client — the advertised list (src/api/auth/sasl.rs,SaslMechanism::begin) and the dispatch match are connection-blind. Needs either a client-aware variant (e.g.sasl_mechanism_names_for(&self, client: &dyn ClientInfo)with a default impl) or a signature change.- The gs2-flag checks from #476 live in
ScramServerAuth::on_client_first_message_with_secret, which has no connection context. Connection-aware enforcement needs state plumbed in — e.g. a setter on the per-connection clone (set_channel_binding_supported(bool)) or a parameter on the method. Low-level users (greptimedb) own the socket and know the TLS state, so either works for them.
So: feasible without restructuring — TLS info reaches the mechanism layer today; only the two surfaces above need extending.
Sketch
ScramAuth: filter-PLUSfrom the advertised names and from the accepted-mechanism check when!client.is_secure().- Handler layer sets the channel-binding capability on the per-connection
ScramServerAuthclone fromclient.is_secure(); low-level default stays strict (strict when a certificate is configured), documented.
- 主要言語
- Rust
- スター
- 805
- フォーク
- 88
- 平均マージ
- 1日 7時間
- マージ済み PR(30日)
- 10
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sunng87/pgwire のほかの issue
-
`chrono` is unmaintained対応中かも @sunng87 が 7 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
sunng87/pgwire#490 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Check RustCrypto for tls and signature facade api対応中かも @sunng87 が 82 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
sunng87/pgwire#447 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
sunng87/pgwire#440 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
unquote utility to process quoted string, ident対応中かも @sunng87 が 281 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
kashsuks/Pinel#172 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
メンテナーはふだん 1 日以内に返信
-
test_a_503_raises_unavailable_error fails on macOS about one run in six対応中かも @naman-modi が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug ui
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
userFRM/egui-charts#4168 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信