Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harden Windows Security Module v0.4.9 #302

Merged
merged 4 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Expand Up @@ -12,7 +12,7 @@ public string[] GetValidValues()
{
string[] categoriex = new string[]
{
"MicrosoftDefender", // 55 - 3x(N/A) = 46
"MicrosoftDefender", // 55 - 3x(N/A) + Number of Process Mitigations which are dynamically increased
"AttackSurfaceReductionRules", // 20
"BitLockerSettings", // 22 + Number of Non-OS drives which are dynamically increased
"TLSSecurity", // 21
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1650,6 +1650,21 @@ function Confirm-SystemCompliance {
Remove-Job -Job $JobsToWaitFor -Force
#Endregion Threading management

# Making sure all the true/false values have the same case
foreach ($Item in $FinalMegaObject.Values) {
foreach ($Item2 in $Item) {
try {
if ($Item2.Compliant -ieq 'True') {
$Item2.Compliant = $true
}
elseif ($Item2.Compliant -ieq 'False') {
$Item2.Compliant = $false
}
}
catch {}
}
}

if ($ExportToCSV) {
# Create an empty list to store the results based on the category order by sorting the concurrent hashtable
$AllOrderedResults = New-Object -TypeName System.Collections.Generic.List[HardeningModule.IndividualResult]
Expand All @@ -1673,7 +1688,7 @@ function Confirm-SystemCompliance {
[Parameter(Mandatory)][System.String]$CategoryName,
[Parameter(Mandatory)][System.String]$DisplayName,
[Parameter(Mandatory)][System.Collections.Hashtable]$ColorMap,
[Parameter(Mandatory)][PSCustomObject[]]$FinalMegaObject,
[Parameter(Mandatory)][System.Collections.Concurrent.ConcurrentDictionary[System.String, HardeningModule.IndividualResult[]]]$FinalMegaObject,
[AllowNull()]
[Parameter(Mandatory)][System.String[]]$Categories,
[ValidateSet('List', 'Table')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_module_manifests

RootModule = 'Harden-Windows-Security-Module.psm1'
ModuleVersion = '0.4.8'
ModuleVersion = '0.4.9'
CompatiblePSEditions = @('Core')
GUID = 'afae7a0a-5eff-4a4d-9139-e1702b7ac426'
Author = 'HotCakeX'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ if (!$IsWindows) {
Add-Type -Path ([System.IO.Directory]::GetFiles("$PSScriptRoot\C#")) -ReferencedAssemblies @((Get-Content -Path "$PSScriptRoot\.NETAssembliesToLoad.txt") + "$($PSHOME)\WindowsBase.dll")

[HardeningModule.GlobalVars]::Path = $PSScriptRoot
[HardeningModule.Initializer]::Initialize()
2 changes: 1 addition & 1 deletion Harden-Windows-Security Module/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.8
0.4.9
Loading