Skip to content

Commit 64bf612

Browse files
Minor fixes
Fixed the SupportedEncryptionTypes registry key. Fixed the SupportedEncryptionTypes warning message test. Fixed an incorrect filed name in the Contrained Delegation SPNs report.
1 parent 4769209 commit 64bf612

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

SQLCheck/SQLCheck/Collectors.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,13 +678,15 @@ public static void CollectSecurity(DataSet ds)
678678
// Kerbeos enabled encryption methods
679679
//
680680

681-
string kerbEncrypt = Utility.GetRegistryValueAsString(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LSA\Kerberos\Parameters", "SupportedEncryptionTypes", RegistryValueKind.DWord, "");
681+
// string kerbEncrypt = Utility.GetRegistryValueAsString(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LSA\Kerberos\Parameters", "SupportedEncryptionTypes", RegistryValueKind.DWord, "");
682+
string kerbEncrypt = Utility.GetRegistryValueAsString(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters", "SupportedEncryptionTypes", RegistryValueKind.DWord, "");
683+
682684
if (kerbEncrypt == "") kerbEncrypt = "Not Specified";
683685
int encrypt = kerbEncrypt == "Not Specified" ? 28 : kerbEncrypt.ToInt(); // 0x1C = 28 decimal = RC4 + AES128 + AES256
684686
if (encrypt == 0) encrypt = 4; // RC4
685687
string encryptNames = Utility.KerbEncryptNames(encrypt);
686688
Security["KerberosLocalEncryption"] = $"{kerbEncrypt} ({encryptNames})";
687-
if (encrypt != 0 && encrypt != 4) Security.LogWarning("RC4 encryption for Kerberos has been disabled.");
689+
if (encrypt != 0 && (((byte)encrypt & 4) != 4)) Security.LogWarning("RC4 encryption for Kerberos has been disabled.");
688690

689691
//
690692
// Warn if change in cryptography providers (default is rsaenh.dll) in:

SQLCheck/SQLCheck/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("Microsoft Corporation - SQL Server Customer Support")]
1212
[assembly: AssemblyProduct("SQLCheck")]
13-
[assembly: AssemblyCopyright("Copyright © 2021")]
13+
[assembly: AssemblyCopyright("Copyright © 2021, 2022")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.1193.0")]
36-
[assembly: AssemblyFileVersion("1.0.1193.0")]
35+
[assembly: AssemblyVersion("1.0.1196.0")]
36+
[assembly: AssemblyFileVersion("1.0.1196.0")]

SQLCheck/SQLCheck/TextReport.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ static void ReportService(DataSet ds, TextWriter s) // outputs computer and dom
569569
s.WriteLine();
570570
rf = new ReportFormatter();
571571
rf.SetColumnNames("Account:L", "SPN:L");
572-
foreach (DataRow ConstrainedDelegationSPN in dtConstrainedDelegationSPN.Select("","Account,SPN"))
572+
foreach (DataRow ConstrainedDelegationSPN in dtConstrainedDelegationSPN.Select("","ServiceAccount,SPN"))
573573
{
574574
rf.SetcolumnData(ConstrainedDelegationSPN.GetString("ServiceAccount"),
575575
ConstrainedDelegationSPN.GetString("SPN"));
@@ -909,11 +909,11 @@ static void ReportMessages(DataSet ds, TextWriter s, string tableName, int table
909909
DataView dv = null;
910910
if (tableRow == -1) // Messages for all rows
911911
{
912-
dv = new DataView(ds.Tables["Message"], $"TableName='{tableName}'", "Severity desc", DataViewRowState.CurrentRows);
912+
dv = new DataView(ds.Tables["Message"], $"TableName='{tableName}'", "Severity desc, Message asc", DataViewRowState.CurrentRows);
913913
}
914914
else
915915
{
916-
dv = new DataView(ds.Tables["Message"], $"TableName='{tableName}' AND TableRow={tableRow}", "Severity desc", DataViewRowState.CurrentRows);
916+
dv = new DataView(ds.Tables["Message"], $"TableName='{tableName}' AND TableRow={tableRow}", "Severity desc, Message asc", DataViewRowState.CurrentRows);
917917
}
918918

919919
if (dv.Count == 0)

0 commit comments

Comments
 (0)