Skip to content

Commit 2ca28d2

Browse files
committed
fix: exempt ESC4 template from setting template properties
1 parent 16f087b commit 2ca28d2

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

ADCSGoat/Public/Deploy-AdcsGoat.ps1

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,25 @@ function Deploy-AdcsGoat {
99
)
1010

1111
# We need blank template objects.
12-
$TemplateNames | ForEach-Object {
12+
$TemplateNames | ForEach-Object {
1313
New-AdcsGoatBlankTemplateObject -TemplateName $_
1414
}
1515

1616
# We need to assign properties to the blank template objects to turn them into real templates.
17-
$TemplateNames | ForEach-Object {
18-
$PropertiesPath = Join-Path -Path ".\Research" -ChildPath "${_}.xml"
17+
$TemplateNames.Where( { $_ -ne 'ESC4' } ) | ForEach-Object {
18+
$PropertiesPath = Join-Path -Path ".\Research" -ChildPath "${_}.xml"
1919
$Properties = Import-Clixml -Path $PropertiesPath
2020
Set-AdcsGoatTemplateProperty -TemplateName $_ -Properties $Properties
2121
}
2222

23-
# We need to grant low privileged users control over blank template objects to turn them into ESC issues.
24-
$TemplateNames | ForEach-Object {
23+
# We need to grant low privileged users Enroll right on template objects to turn them into ESC issues.
24+
$TemplateNames.Where( { $_ -ne 'ESC4' } ) | ForEach-Object {
2525
Set-AdcsGoatTemplateAce -TemplateName $_ -AceType Enroll
2626
}
27+
28+
# We need to grant low privileged users Full Control over a template object to turn it into an ESC4.
29+
$TemplateNames.Where( { $_ -eq 'ESC4' } ) | ForEach-Object {
30+
Set-AdcsGoatTemplateAce -TemplateName $_ -AceType GenericAll
31+
}
2732
}
2833

29-

0 commit comments

Comments
 (0)