Core: `SecurityUtils.createMtlsKeyStore` should use a fixed algorithm for creating the `PrivateKey`
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu tại SecurityUtils.createMtlsKeyStore và kiểm tra cách xử lý IllegalArgumentException hiện tại xung quanh lệnh gọi KeyFactory được hiển thị trong issue. Xem lại hướng dẫn của Error Prone về InsecureCipherMode và API InvalidAlgorithmParameterException, sau đó chạy build với Error Prone được bật. Hoàn tất khi các thuật toán khóa không an toàn hoặc không được hỗ trợ được xử lý như đã chỉ định và cảnh báo được giải quyết.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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);
- Ngôn ngữ chính
- Java
- Star
- 1.4k
- Fork
- 476
- Merge trung bình
- 10 giờ 47 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của googleapis/google-http-java-client
-
Core: Validate header names and values to prevent CRLF injectionCó thể đã có người làm @insaf021 đã nhận 106 ngày trước. Đang mởpriority: p3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Core: XmlPullParser processes external DTD entities (XXE) — disable FEATURE_PROCESS_DOCDECL in Xml#createParser()Có thể đã có người làm @insaf021 đã nhận 106 ngày trước. Đang mởpriority: p3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Core: LowLevelHttpResponse not disconnected when HttpResponse construction throws RuntimeExceptionCó thể đã có người làm @insaf021 đã nhận 106 ngày trước. Đang mởpriority: p3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
type: cleanup
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
org.apache.http.conn.ssl.SSLSocketFactory is deprecatedCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởpriority: p2 type: cleanup
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Tất cả issue của googleapis/google-http-java-client
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 84/100
cpp-best-practices/project_validator#251 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
backend enhancement
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 70/100
damodharg6/payledger#16 ·
-
[Bug]: An initiative list with no current entry logs an error on every changeCó thể đã có người làm @dwizard0 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày