Entwicklungsumgebung anpassen
Im Ordner einer Solution folgende Dateien anlegen:
.editorconfig
root = true
[*.{cs,vb}]
dotnet_diagnostic.CA5350.severity = warning
dotnet_diagnostic.CA5351.severity = warning
dotnet_diagnostic.CA5358.severity = warning
dotnet_diagnostic.CA5359.severity = warning
dotnet_diagnostic.CA5361.severity = warning
dotnet_diagnostic.CA5364.severity = warning
dotnet_diagnostic.CA5373.severity = warning
dotnet_diagnostic.CA5379.severity = warning
dotnet_diagnostic.CA5384.severity = warning
dotnet_diagnostic.CA5385.severity = warning
dotnet_diagnostic.CA5386.severity = warning
dotnet_diagnostic.CA5387.severity = warning
dotnet_diagnostic.CA5388.severity = warning
dotnet_diagnostic.CA5390.severity = warning
dotnet_diagnostic.CA5394.severity = warning
dotnet_diagnostic.CA5397.severity = warning
dotnet_diagnostic.CA5398.severity = warning
dotnet_diagnostic.CA5401.severity = warning
dotnet_diagnostic.CA5402.severity = warning
dotnet_diagnostic.RS0030.severity = warning
Directory.Build.props
<Project>
<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)eng\BannedSymbols.Fips.txt" />
</ItemGroup>
<PropertyGroup>
<ErrorLog>$(IntermediateOutputPath)$(MSBuildProjectName)-analysis.sarif,version=2.1</ErrorLog>
</PropertyGroup>
</Project>
Im Ordner der Solution den Unterordner eng anlegen und dort folgende Datei speichern:
...eng\BannedSymbols.Fips.txt
T:System.Security.Cryptography.MD5;FIPS: MD5 gesperrt
T:System.Security.Cryptography.MD5CryptoServiceProvider;FIPS: MD5 gesperrt
T:System.Security.Cryptography.HMACMD5;FIPS: HMAC-MD5 gesperrt
T:System.Security.Cryptography.SHA1;FIPS: SHA-1 gesperrt
T:System.Security.Cryptography.SHA1Managed;FIPS: SHA-1 gesperrt
T:System.Security.Cryptography.SHA1CryptoServiceProvider;FIPS: SHA-1 gesperrt
T:System.Security.Cryptography.HMACSHA1;FIPS: HMAC-SHA1 gesperrt
T:System.Security.Cryptography.RIPEMD160;FIPS: RIPEMD160 gesperrt
T:System.Security.Cryptography.DES;FIPS: DES gesperrt
T:System.Security.Cryptography.DESCryptoServiceProvider;FIPS: DES gesperrt
T:System.Security.Cryptography.RC2;FIPS: RC2 gesperrt
T:System.Security.Cryptography.RC2CryptoServiceProvider;FIPS: RC2 gesperrt
T:System.Security.Cryptography.TripleDES;FIPS: TripleDES gesperrt
T:System.Security.Cryptography.TripleDESCryptoServiceProvider;FIPS: TripleDES gesperrt
T:System.Security.Cryptography.Rijndael;FIPS: Nur AES verwenden
T:System.Security.Cryptography.RijndaelManaged;FIPS: Nur AES verwenden
T:System.Security.Cryptography.DSA;FIPS: DSA gesperrt
T:System.Security.Cryptography.DSACryptoServiceProvider;FIPS: DSA gesperrt
T:System.Security.Cryptography.PasswordDeriveBytes;FIPS: PBKDF1 gesperrt
F:System.Security.Cryptography.CipherMode.ECB;FIPS: ECB gesperrt
Nachfolgende nuget jedem Projekt in der Solution hinzufügen:
Microsoft.CodeAnalysis.BannedApiAnalyzers
Microsoft.CodeAnalysis.NetAnalyzers
Während des Kompilierungsvorganges werden in jedem Projektordner *.sarif Dateien angelegt, die innerhalb von VS Code analysiert werden können, nachdem die Erweiterung Sarif Viewer installiert wurde.