Core: `SecurityUtils.createMtlsKeyStore` should use a fixed algorithm for creating the `PrivateKey`
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
Direção de pesquisa
Comece em SecurityUtils.createMtlsKeyStore e inspecione o tratamento atual de IllegalArgumentException em torno da chamada de KeyFactory mostrada na issue. Revise as orientações do Error Prone sobre InsecureCipherMode e a API de InvalidAlgorithmParameterException, depois execute o build com o Error Prone habilitado. O trabalho estará concluído quando os algoritmos de chave inseguros ou não compatíveis forem tratados conforme especificado e o aviso for resolvido.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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);
- Linguagem predominante
- Java
- Estrelas
- 1.4k
- Forks
- 476
- Merge médio
- 10h 47min
- PRs com merge (30d)
- 3
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de googleapis/google-http-java-client
-
Core: Validate header names and values to prevent CRLF injectionTalvez já em andamento @insaf021 assumiu há 106 dias. Abertapriority: p3
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
Core: XmlPullParser processes external DTD entities (XXE) — disable FEATURE_PROCESS_DOCDECL in Xml#createParser()Talvez já em andamento @insaf021 assumiu há 106 dias. Abertapriority: p3
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
-
Core: LowLevelHttpResponse not disconnected when HttpResponse construction throws RuntimeExceptionTalvez já em andamento @insaf021 assumiu há 107 dias. Abertapriority: p3
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
-
type: cleanup
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
-
org.apache.http.conn.ssl.SSLSocketFactory is deprecatedTalvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Abertapriority: p2 type: cleanup
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
Todas as issues de googleapis/google-http-java-client
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 80/100
finos/fluxnova-bpm-platform#387 ·
Mantenedores costumam responder em até 4 dias
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
-
Dificuldade 2/5 Menos de uma hora Facilidade para iniciantes 84/100
cpp-best-practices/project_validator#251 ·
Mantenedores costumam responder em até 1 dia
-
backend enhancement
Dificuldade 2/5 Meio dia Facilidade para iniciantes 70/100
damodharg6/payledger#16 ·
-
[Bug]: An initiative list with no current entry logs an error on every changeTalvez já em andamento @dwizard0 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia