Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2e44823
Do not hard code encryption key.
LingxiaChen Jun 24, 2019
e500692
Merge branch 'master' into DoNotHardCodedEncryptionKey
LingxiaChen Jun 26, 2019
5ecea9e
Modify according to the comments and add a argument check feature for…
LingxiaChen Jul 2, 2019
cb2704c
Merge branch 'master' into DoNotHardCodedEncryptionKey
LingxiaChen Jul 3, 2019
fe23db5
Remove two Debug.Assert().
LingxiaChen Jul 3, 2019
692efd3
Regiter ArrayInitializer operation action only when there is a least …
LingxiaChen Jul 3, 2019
055c8b1
Change the form of argument check of tainted methods.
LingxiaChen Jul 4, 2019
84a34d9
Change the type of rootOperationsNeedingAnalysis into ConcurrentDicti…
LingxiaChen Jul 5, 2019
163531e
Merge branch 'master' into DoNotHardCodedEncryptionKey
LingxiaChen Jul 10, 2019
7494695
Add a RequiresValueContentAnalysis method to ITaintedDataInfo and do …
LingxiaChen Jul 11, 2019
fbf9766
Wording and comment modification.
LingxiaChen Jul 15, 2019
a56efdb
Merge branch 'master' into DoNotHardCodedEncryptionKey
LLLXXXCCC Jul 15, 2019
bad699d
Add free operation to PooledHashSet.
LingxiaChen Jul 16, 2019
65695b8
Merge branch 'DoNotHardCodedEncryptionKey' of https://github.com/LLLX…
LingxiaChen Jul 16, 2019
f487b66
Move free operation position.
LingxiaChen Jul 18, 2019
730405e
Update.
LingxiaChen Jul 22, 2019
eac34eb
Merge pull request #2686 from LLLXXXCCC/master
dotpaul Jul 22, 2019
0d2a8d7
Move sanitizer check higher.
LingxiaChen Jul 23, 2019
c844bfb
Merge pull request #2624 from LLLXXXCCC/DoNotHardCodedEncryptionKey
LLLXXXCCC Jul 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Analyzer.Utilities;
using Analyzer.Utilities.FlowAnalysis.Analysis.TaintedDataAnalysis;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.NetCore.Analyzers.Security.Helpers;

namespace Microsoft.NetCore.Analyzers.Security
{
[DiagnosticAnalyzer(LanguageNames.CSharp, LanguageNames.VisualBasic)]
public class DoNotHardCodeEncryptionKey : SourceTriggeredTaintedDataAnalyzerBase
{
internal static DiagnosticDescriptor Rule = SecurityHelpers.CreateDiagnosticDescriptor(
"CA5390",
typeof(SystemSecurityCryptographyResources),
nameof(SystemSecurityCryptographyResources.DoNotHardCodeEncryptionKey),
nameof(SystemSecurityCryptographyResources.DoNotHardCodeEncryptionKeyMessage),
DiagnosticHelpers.EnabledByDefaultIfNotBuildingVSIX,
helpLinkUri: null,
descriptionResourceStringName: nameof(SystemSecurityCryptographyResources.DoNotHardCodeEncryptionKeyDescription),
customTags: WellKnownDiagnosticTagsExtensions.DataflowAndTelemetry);

protected override SinkKind SinkKind { get { return SinkKind.HardcodedEncryptionKey; } }

protected override DiagnosticDescriptor TaintedDataEnteringSinkDescriptor { get { return Rule; } }
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,15 @@
<data name="DoNotDisableSchUseStrongCryptoMessage" xml:space="preserve">
<value>{0} disables TLS 1.2 and enables SSLv3</value>
</data>
<data name="DoNotHardCodeEncryptionKey" xml:space="preserve">
<value>Do Not Hard Code Encryption Key</value>
</data>
<data name="DoNotHardCodeEncryptionKeyDescription" xml:space="preserve">
<value>SymmetricAlgorithm's .Key property, or a method's rgbKey parameter, should never be a hardcoded value.</value>
</data>
<data name="DoNotHardCodeEncryptionKeyMessage" xml:space="preserve">
<value>Potential security vulnerability was found where '{0}' in method '{1}' may be tainted by hardcoded key from '{2}' in method '{3}'</value>
</data>
<data name="DoNotInstallRootCertDescription" xml:space="preserve">
<value>By default, the Trusted Root Certification Authorities certificate store is configured with a set of public CAs that has met the requirements of the Microsoft Root Certificate Program. Since all trusted root CAs can issue certificates for any domain, an attacker can pick a weak or coercible CA that you install by yourself to target for an attack – and a single vulnerable, malicious or coercible CA undermines the security of the entire system. To make matters worse, these attacks can go unnoticed quite easily.</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@
<target state="translated">{0} zakazuje TLS 1.2 a povoluje SSLv3.</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKey">
<source>Do Not Hard Code Encryption Key</source>
<target state="new">Do Not Hard Code Encryption Key</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKeyDescription">
<source>SymmetricAlgorithm's .Key property, or a method's rgbKey parameter, should never be a hardcoded value.</source>
<target state="new">SymmetricAlgorithm's .Key property, or a method's rgbKey parameter, should never be a hardcoded value.</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKeyMessage">
<source>Potential security vulnerability was found where '{0}' in method '{1}' may be tainted by hardcoded key from '{2}' in method '{3}'</source>
<target state="new">Potential security vulnerability was found where '{0}' in method '{1}' may be tainted by hardcoded key from '{2}' in method '{3}'</target>
<note />
</trans-unit>
<trans-unit id="DoNotInstallRootCertDescription">
<source>By default, the Trusted Root Certification Authorities certificate store is configured with a set of public CAs that has met the requirements of the Microsoft Root Certificate Program. Since all trusted root CAs can issue certificates for any domain, an attacker can pick a weak or coercible CA that you install by yourself to target for an attack – and a single vulnerable, malicious or coercible CA undermines the security of the entire system. To make matters worse, these attacks can go unnoticed quite easily.</source>
<target state="translated">Standardně je úložiště certifikátů důvěryhodných kořenových certifikačních autorit nakonfigurované na sadu veřejných CA, které splnily požadavky programu Microsoft Root Certificate Program. Vzhledem k tomu, že všechny důvěryhodné kořenové CA můžou vystavovat certifikáty pro libovolnou doménu, útočník si může vybrat slabou nebo zranitelnou CA, kterou si sami nainstalujete na cíl útoku – a jedna ohrožená, škodlivá nebo zranitelná CA ohrožuje zabezpečení celého systému. A co je horší, tyto útoky se dají vcelku snadno skrýt.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@
<target state="translated">{0} deaktiviert TLS 1.2 und aktiviert SSLv3</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKey">
<source>Do Not Hard Code Encryption Key</source>
<target state="new">Do Not Hard Code Encryption Key</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKeyDescription">
<source>SymmetricAlgorithm's .Key property, or a method's rgbKey parameter, should never be a hardcoded value.</source>
<target state="new">SymmetricAlgorithm's .Key property, or a method's rgbKey parameter, should never be a hardcoded value.</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKeyMessage">
<source>Potential security vulnerability was found where '{0}' in method '{1}' may be tainted by hardcoded key from '{2}' in method '{3}'</source>
<target state="new">Potential security vulnerability was found where '{0}' in method '{1}' may be tainted by hardcoded key from '{2}' in method '{3}'</target>
<note />
</trans-unit>
<trans-unit id="DoNotInstallRootCertDescription">
<source>By default, the Trusted Root Certification Authorities certificate store is configured with a set of public CAs that has met the requirements of the Microsoft Root Certificate Program. Since all trusted root CAs can issue certificates for any domain, an attacker can pick a weak or coercible CA that you install by yourself to target for an attack – and a single vulnerable, malicious or coercible CA undermines the security of the entire system. To make matters worse, these attacks can go unnoticed quite easily.</source>
<target state="translated">Standardmäßig ist der Zertifikatspeicher der vertrauenswürdigen Stammzertifizierungsstellen mit einem Satz öffentlicher Zertifizierungsstellen konfiguriert, die die Anforderungen des Microsoft-Programms für Stammzertifikate erfüllen. Da alle vertrauenswürdigen Stammzertifizierungsstellen Zertifikate für eine beliebige Domäne ausstellen können, kann ein Angreifer eine schwache oder zwingende Zertifizierungsstelle, die Sie selbst installieren, als Ziel für einen Angriff auswählen. Auf diese Weise kann eine einzelne unsichere, schädliche oder zwingende Zertifizierungsstelle die Sicherheit des gesamten Systems untergraben. Hinzu kommt, dass diese Angriffe leicht unbemerkt bleiben können.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@
<target state="translated">{0} deshabilita TLS 1.2 y habilita SSLv3</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKey">
<source>Do Not Hard Code Encryption Key</source>
<target state="new">Do Not Hard Code Encryption Key</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKeyDescription">
<source>SymmetricAlgorithm's .Key property, or a method's rgbKey parameter, should never be a hardcoded value.</source>
<target state="new">SymmetricAlgorithm's .Key property, or a method's rgbKey parameter, should never be a hardcoded value.</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKeyMessage">
<source>Potential security vulnerability was found where '{0}' in method '{1}' may be tainted by hardcoded key from '{2}' in method '{3}'</source>
<target state="new">Potential security vulnerability was found where '{0}' in method '{1}' may be tainted by hardcoded key from '{2}' in method '{3}'</target>
<note />
</trans-unit>
<trans-unit id="DoNotInstallRootCertDescription">
<source>By default, the Trusted Root Certification Authorities certificate store is configured with a set of public CAs that has met the requirements of the Microsoft Root Certificate Program. Since all trusted root CAs can issue certificates for any domain, an attacker can pick a weak or coercible CA that you install by yourself to target for an attack – and a single vulnerable, malicious or coercible CA undermines the security of the entire system. To make matters worse, these attacks can go unnoticed quite easily.</source>
<target state="translated">De forma predeterminada, el almacén de certificados de entidades de certificación raíz de confianza está configurado con un conjunto de entidades de certificación públicas que cumplen los requisitos del programa de certificados raíz de Microsoft. Dado que todas las entidades de certificación raíz de confianza pueden emitir certificados para cualquier dominio, un atacante puede elegir una entidad de certificación coaccionable o débil que instale por su cuenta para destinar un ataque, y una única entidad de certificación vulnerable, malintencionada o convertible socava la seguridad de todo el sistema. Para empeorar las cosas, estos ataques pueden pasar desapercibidos con bastante facilidad.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@
<target state="translated">{0} désactive TLS 1.2 et active SSLv3</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKey">
<source>Do Not Hard Code Encryption Key</source>
<target state="new">Do Not Hard Code Encryption Key</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKeyDescription">
<source>SymmetricAlgorithm's .Key property, or a method's rgbKey parameter, should never be a hardcoded value.</source>
<target state="new">SymmetricAlgorithm's .Key property, or a method's rgbKey parameter, should never be a hardcoded value.</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKeyMessage">
<source>Potential security vulnerability was found where '{0}' in method '{1}' may be tainted by hardcoded key from '{2}' in method '{3}'</source>
<target state="new">Potential security vulnerability was found where '{0}' in method '{1}' may be tainted by hardcoded key from '{2}' in method '{3}'</target>
<note />
</trans-unit>
<trans-unit id="DoNotInstallRootCertDescription">
<source>By default, the Trusted Root Certification Authorities certificate store is configured with a set of public CAs that has met the requirements of the Microsoft Root Certificate Program. Since all trusted root CAs can issue certificates for any domain, an attacker can pick a weak or coercible CA that you install by yourself to target for an attack – and a single vulnerable, malicious or coercible CA undermines the security of the entire system. To make matters worse, these attacks can go unnoticed quite easily.</source>
<target state="translated">Par défaut, le magasin de certificats Autorités de certification racines de confiance est configuré avec un ensemble d'autorités de certification publiques qui répond aux exigences du programme de certificat racine Microsoft. Comme toutes les autorités de certification racines de confiance peuvent émettre des certificats pour n'importe quel domaine, un attaquant peut choisir une autorité de certification faible ou coercible que vous installez par vous-même, or une seule autorité de certification vulnérable, malveillante ou coercible compromet la sécurité de l'ensemble du système. Pour compliquer la situation, ces attaques passent facilement inaperçues.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@
<target state="translated">{0} disabilita TLS 1.2 e abilita SSLv3</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKey">
<source>Do Not Hard Code Encryption Key</source>
<target state="new">Do Not Hard Code Encryption Key</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKeyDescription">
<source>SymmetricAlgorithm's .Key property, or a method's rgbKey parameter, should never be a hardcoded value.</source>
<target state="new">SymmetricAlgorithm's .Key property, or a method's rgbKey parameter, should never be a hardcoded value.</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKeyMessage">
<source>Potential security vulnerability was found where '{0}' in method '{1}' may be tainted by hardcoded key from '{2}' in method '{3}'</source>
<target state="new">Potential security vulnerability was found where '{0}' in method '{1}' may be tainted by hardcoded key from '{2}' in method '{3}'</target>
<note />
</trans-unit>
<trans-unit id="DoNotInstallRootCertDescription">
<source>By default, the Trusted Root Certification Authorities certificate store is configured with a set of public CAs that has met the requirements of the Microsoft Root Certificate Program. Since all trusted root CAs can issue certificates for any domain, an attacker can pick a weak or coercible CA that you install by yourself to target for an attack – and a single vulnerable, malicious or coercible CA undermines the security of the entire system. To make matters worse, these attacks can go unnoticed quite easily.</source>
<target state="translated">Per impostazione predefinita, l'archivio certificati di Autorità di certificazione radice disponibile nell'elenco locale è configurato con un set di CA pubbliche che soddisfa i requisiti del programma Microsoft Root Certificate. Dal momento che tutte le CA radice attendibili possono rilasciare certificati per qualsiasi dominio, un utente malintenzionato può selezionare come destinazione di attacco una CA debole o coercibile installata dall'utente. Una CA vulnerabile, dannosa o coercibile compromette la sicurezza dell'intero sistema, senza contare che questi attacchi possono passare inosservati abbastanza facilmente.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@
<target state="translated">{0} は、TLS 1.2 を無効にして、SSLv3 を有効にします</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKey">
<source>Do Not Hard Code Encryption Key</source>
<target state="new">Do Not Hard Code Encryption Key</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKeyDescription">
<source>SymmetricAlgorithm's .Key property, or a method's rgbKey parameter, should never be a hardcoded value.</source>
<target state="new">SymmetricAlgorithm's .Key property, or a method's rgbKey parameter, should never be a hardcoded value.</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKeyMessage">
<source>Potential security vulnerability was found where '{0}' in method '{1}' may be tainted by hardcoded key from '{2}' in method '{3}'</source>
<target state="new">Potential security vulnerability was found where '{0}' in method '{1}' may be tainted by hardcoded key from '{2}' in method '{3}'</target>
<note />
</trans-unit>
<trans-unit id="DoNotInstallRootCertDescription">
<source>By default, the Trusted Root Certification Authorities certificate store is configured with a set of public CAs that has met the requirements of the Microsoft Root Certificate Program. Since all trusted root CAs can issue certificates for any domain, an attacker can pick a weak or coercible CA that you install by yourself to target for an attack – and a single vulnerable, malicious or coercible CA undermines the security of the entire system. To make matters worse, these attacks can go unnoticed quite easily.</source>
<target state="translated">既定では、信頼されたルート証明機関の証明書ストアは、Microsoft ルート証明書プログラムの要件を満たす一連の公的 CA で構成されています。すべての信頼されたルート CA は任意のドメインの証明書を発行できますが、攻撃者はユーザー自身がインストールする脆弱な CA または制御可能な CA を攻撃対象として選択できます。脆弱な CA、悪意のあるCA、制御可能な CA が 1 つでもあると、システム全体のセキュリティが弱体化します。さらに悪いことに、こうした攻撃はまったく気付かずに、しかも簡単に行うことができます。</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@
<target state="translated">{0}이(가) TLS 1.2를 사용하지 않도록, SSLv3를 사용하도록 설정합니다.</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKey">
<source>Do Not Hard Code Encryption Key</source>
<target state="new">Do Not Hard Code Encryption Key</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKeyDescription">
<source>SymmetricAlgorithm's .Key property, or a method's rgbKey parameter, should never be a hardcoded value.</source>
<target state="new">SymmetricAlgorithm's .Key property, or a method's rgbKey parameter, should never be a hardcoded value.</target>
<note />
</trans-unit>
<trans-unit id="DoNotHardCodeEncryptionKeyMessage">
<source>Potential security vulnerability was found where '{0}' in method '{1}' may be tainted by hardcoded key from '{2}' in method '{3}'</source>
<target state="new">Potential security vulnerability was found where '{0}' in method '{1}' may be tainted by hardcoded key from '{2}' in method '{3}'</target>
<note />
</trans-unit>
<trans-unit id="DoNotInstallRootCertDescription">
<source>By default, the Trusted Root Certification Authorities certificate store is configured with a set of public CAs that has met the requirements of the Microsoft Root Certificate Program. Since all trusted root CAs can issue certificates for any domain, an attacker can pick a weak or coercible CA that you install by yourself to target for an attack – and a single vulnerable, malicious or coercible CA undermines the security of the entire system. To make matters worse, these attacks can go unnoticed quite easily.</source>
<target state="translated">기본적으로 신뢰할 수 있는 루트 인증 기관 인증서 저장소는 Microsoft 루트 인증서 프로그램의 요구 사항을 준수하는 공용 CA 세트로 구성됩니다. 모든 신뢰할 수 있는 루트 CA는 모든 도메인에 대한 인증서를 발급할 수 있으므로 공격자는 사용자가 직접 설치한 약하거나 강제할 수 있는 CA를 선택하여 공격 대상으로 지정할 수 있으며, 취약하거나 악의적이거나 강제할 수 있는 CA 하나가 전체 시스템의 보안을 약화시킵니다. 설상가상으로 이러한 공격자는 상당히 쉽게 눈에 띄지 않고 넘어갈 수 있습니다.</target>
Expand Down
Loading