From 4f8f9ef3f641841ff85e425c2029ff110e6daded Mon Sep 17 00:00:00 2001 From: Jake Hildreth Date: Sun, 12 Jan 2025 06:22:28 -0600 Subject: [PATCH] Resolves basic issue. Some duplication in identified principals in ESC15 checks --- Invoke-Locksmith.ps1 | 4 ++-- Locksmith.psd1 | 2 +- Private/Set-RiskRating.ps1 | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Invoke-Locksmith.ps1 b/Invoke-Locksmith.ps1 index aea8c259..6e6c20d2 100644 --- a/Invoke-Locksmith.ps1 +++ b/Invoke-Locksmith.ps1 @@ -3202,7 +3202,7 @@ function Set-RiskRating { # Default 'User' and 'Machine' templates are more dangerous $ESC15 = Find-ESC15 -ADCSObjects $ADCSObjects -SafeUsers $SafeUsers -UnsafeUsers $UnsafeUsers -SkipRisk | Where-Object { $_.Enabled -eq $true } - $ESC15Names = @('Machine', 'User') + $ESC15Names = @(($ESC15 | Where-Object Name -In @('Machine', 'User')).Name) if ($ESC15Names) { $CheckedESC15Templates = @{} foreach ($name in $ESC15Names) { @@ -4381,7 +4381,7 @@ function Invoke-Locksmith { [System.Management.Automation.PSCredential]$Credential ) - $Version = '2025.1.1' + $Version = '2025.1.12' $LogoPart1 = @' _ _____ _______ _ _ _______ _______ _____ _______ _ _ | | | | |____/ |______ | | | | | |_____| diff --git a/Locksmith.psd1 b/Locksmith.psd1 index a321ce44..7c7a1f36 100644 --- a/Locksmith.psd1 +++ b/Locksmith.psd1 @@ -8,7 +8,7 @@ FunctionsToExport = 'Invoke-Locksmith' GUID = 'b1325b42-8dc4-4f17-aa1f-dcb5984ca14a' HelpInfoURI = 'https://raw.githubusercontent.com/TrimarcJake/Locksmith/main/en-US/' - ModuleVersion = '2025.1.1' + ModuleVersion = '2025.1.12' PowerShellVersion = '5.1' PrivateData = @{ PSData = @{ diff --git a/Private/Set-RiskRating.ps1 b/Private/Set-RiskRating.ps1 index 19b54f49..d226dbc5 100644 --- a/Private/Set-RiskRating.ps1 +++ b/Private/Set-RiskRating.ps1 @@ -170,7 +170,7 @@ function Set-RiskRating { # Default 'User' and 'Machine' templates are more dangerous $ESC15 = Find-ESC15 -ADCSObjects $ADCSObjects -SafeUsers $SafeUsers -UnsafeUsers $UnsafeUsers -SkipRisk | Where-Object { $_.Enabled -eq $true } - $ESC15Names = @('Machine', 'User') + $ESC15Names = @(($ESC15 | Where-Object Name -in @('Machine', 'User')).Name) if ($ESC15Names) { $CheckedESC15Templates = @{} foreach ($name in $ESC15Names) {