Skip to content

Commit 2cbca67

Browse files
committed
Add RSOP test
1 parent bb0fff9 commit 2cbca67

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

templates/AppLockerProject/build/publish.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ foreach ($policy in (Get-ChildItem -Path (Join-Path -Path $OutputPath -ChildPath
1717

1818
$policyFound = $searcher.FindOne()
1919

20-
Set-AppLockerPolicy -XmlPolicy (Get-Content -Path $policy.FullName) -Ldap $policyFound.Path
20+
Set-AppLockerPolicy -XmlPolicy $policy.FullName -Ldap $policyFound.Path
2121
}

templates/AppLockerProject/configurationdata/Domains/þdomainfqdnþ.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,5 @@ RuleCollections:
4444
- Name: Prohibit PowerShell 2 unsigned JIT
4545
Description: Explicitly deny signed DLLs needed for PowerShell v2
4646
Action: Deny
47+
UserOrGroupSid: S-1-1-0
4748
Path: '%WINDIR%\assembly\NativeImages_v2.0.50727_32\System.Management.A#\*'

templates/AppLockerProject/configurationdata/Generics/Windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ RuleCollections:
1616
LowSection: "*"
1717
HighSection: 9.9.9.9
1818
- Name: Prohibit PowerShell 2 unsigned JIT
19+
UserOrGroupSid: S-1-1-0
1920
Description: Explicitly deny signed DLLs needed for PowerShell v2
2021
Action: Deny
2122
Path: '%WINDIR%\assembly\NativeImages_v2.0.50727_32\System.Management.A#\*'
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
BeforeDiscovery {
2+
if (Get-DatumRsopCache)
3+
{
4+
Clear-DatumRsopCache
5+
}
6+
7+
$datum = New-DatumStructure -DefinitionFile (Join-Path "$global:testroot\..\configurationdata" Datum.yml)
8+
[hashtable[]] $rsops = (Get-DatumRsop $datum (Get-DatumNodesRecursive -AllDatumNodes $Datum.AllNodes)).RuleCollections.Values.Rules
9+
}
10+
11+
Describe "RSOP correctness" {
12+
It "<Name> Policy rule has SID" -TestCases $rsops {
13+
$UserOrGroupSid | Should -Not -BeNullOrEmpty
14+
}
15+
}

0 commit comments

Comments
 (0)