Core: `SecurityUtils.createMtlsKeyStore` should use a fixed algorithm for creating the `PrivateKey`
まだ誰も着手していません。
評価
調査の方向性
SecurityUtils.createMtlsKeyStore から始め、issue に示されている KeyFactory 呼び出し周辺の IllegalArgumentException の現在の処理を確認します。Error Prone の InsecureCipherMode に関するガイダンスと InvalidAlgorithmParameterException API を確認し、Error Prone を有効にしてビルドを実行します。安全でない、またはサポートされていない鍵アルゴリズムが仕様どおりに処理され、警告が解消されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Callers of SecurityUtils.createMtlsKeyStore can direct the use of insecure algorithms in the construction of the mTLS connection. In general, we attempt to affix the algorithm used to inhibit use of algorithms with known vulnerabilities.
Personally, I would be fine with denying provided certs whose cert.getPublicKey().getAlgorithm() was DH or DSA, but in lieu of blocklisting known bad algorithms, perhaps it'd be more security affirmative to allowlist currently-OK algorithms, so we only ever use good versions, and suffer toil later if we have to retrofit additional entries.
My suggestion is to create a case statement just below where the method currently throws IllegalArgumentException for various cases, and add the set of known good algorithms, and throw an InvalidAlgorithmParameterException if it is not one of those. In addition, special case DH and DSA to give references to their vulnerabilities as described in InsecureCypherMode.identifyDiffieHellmanAndDsaVulnerabilities.
/cc @sophieschmieg, as her guidance/requirements will be canonical for importing whatever changes are made here into the monorepo.
Environment details
- API: Core
- OS type and version: 5.17.6-1rodete1-amd64
- Java version: OpenJDK Runtime Environment (build 11.0.13+8-google-release-451398016) OpenJDK 64-Bit Server VM (build 11.0.13+8-google-release-451398016, mixed mode, sharing)
- version(s): ~head (with local patches)
Steps to reproduce
- Add errorprone warnings to the build
- Build.
SecurityUtils.createMtlsKeyStore will generate an InsecureCipherMode warning.
Code example
PrivateKey key =
KeyFactory.getInstance(cert.getPublicKey().getAlgorithm()).generatePrivate(keySpecPKCS8);
- 主要言語
- Java
- スター
- 1.4k
- フォーク
- 476
- 平均マージ
- 10時間 47分
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
googleapis/google-http-java-client のほかの issue
-
Core: Validate header names and values to prevent CRLF injection対応中かも @insaf021 が 106 日前に担当しました。 オープンpriority: p3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Core: XmlPullParser processes external DTD entities (XXE) — disable FEATURE_PROCESS_DOCDECL in Xml#createParser()対応中かも @insaf021 が 106 日前に担当しました。 オープンpriority: p3
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
Core: LowLevelHttpResponse not disconnected when HttpResponse construction throws RuntimeException対応中かも @insaf021 が 106 日前に担当しました。 オープンpriority: p3
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
type: cleanup
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
org.apache.http.conn.ssl.SSLSocketFactory is deprecated再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンpriority: p2 type: cleanup
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
googleapis/google-http-java-client の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
難易度 2/5 1時間未満 初心者へのやさしさ 84/100
cpp-best-practices/project_validator#251 ·
メンテナーはふだん 1 日以内に返信
-
backend enhancement
難易度 2/5 半日 初心者へのやさしさ 70/100
damodharg6/payledger#16 ·
-
[Bug]: An initiative list with no current entry logs an error on every change対応中かも @dwizard0 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信