File tree Expand file tree Collapse file tree 5 files changed +47
-16
lines changed
templates/AppLockerProject Expand file tree Collapse file tree 5 files changed +47
-16
lines changed Original file line number Diff line number Diff line change @@ -12,23 +12,23 @@ jobs:
12
12
steps :
13
13
- uses : actions/checkout@v1
14
14
- name : Install Prerequisites
15
- run : .\build\vsts- prerequisites.ps1
15
+ run : .\build\prerequisites.ps1 -BuildWorker -DependencyPath (Join-Path $env:GITHUB_WORKSPACE build\requiredModules.psd1)
16
16
shell : powershell
17
17
- name : Validate Configuration Data
18
- run : .\build\vsts- validate.ps1 -TestType ConfigurationData
18
+ run : .\build\validate.ps1 -TestType ConfigurationData -DependencyPath (Join-Path $env:GITHUB_WORKSPACE build\requiredModules.psd1) -ProjectRoot $env:GITHUB_WORKSPACE
19
19
shell : powershell
20
20
- name : Build
21
- run : .\build\vsts- build.ps1 -IncludeRsop
21
+ run : .\build\build.ps1 -IncludeRsop -DependencyPath (Join-Path $env:GITHUB_WORKSPACE build\requiredModules.psd1) -SourcePath (Join-Path $env:GITHUB_WORKSPACE configurationdata) -OutputPath (Join-Path $env:GITHUB_WORKSPACE output)
22
22
shell : powershell
23
23
- uses : actions/upload-artifact@v3
24
24
with :
25
25
name : build-artifacts
26
26
path : |
27
27
.\output\rsop
28
28
.\output\policies
29
- - name : Validate Integration Tests
30
- run : .\build\vsts-validate.ps1 -TestType Integration
31
- shell : powershell
32
29
- name : Publish
33
- run : .\build\vsts-publish.ps1
30
+ run : .\build\publish.ps1
31
+ shell : powershell
32
+ - name : Validate Integration Tests
33
+ run : .\build\validate.ps1 -TestType Integration -DependencyPath (Join-Path $env:GITHUB_WORKSPACE build\requiredModules.psd1) -ProjectRoot $env:GITHUB_WORKSPACE
34
34
shell : powershell
Original file line number Diff line number Diff line change 8
8
steps :
9
9
- uses : actions/checkout@v1
10
10
- name : Install Prerequisites
11
- run : .\build\vsts- prerequisites.ps1
11
+ run : .\build\prerequisites.ps1 -BuildWorker -DependencyPath (Join-Path $env:GITHUB_WORKSPACE build\requiredModules.psd1)
12
12
shell : powershell
13
- - name : Validate
14
- run : .\build\vsts- validate.ps1 -TestType ConfigurationData
13
+ - name : Validate Configuration Data
14
+ run : .\build\validate.ps1 -TestType ConfigurationData -DependencyPath (Join-Path $env:GITHUB_WORKSPACE build\requiredModules.psd1) -ProjectRoot $env:GITHUB_WORKSPACE
15
15
shell : powershell
16
16
- name : Build
17
- run : .\build\vsts- build.ps1 -IncludeRsop
17
+ run : .\build\build.ps1 -IncludeRsop -DependencyPath (Join-Path $env:GITHUB_WORKSPACE build\requiredModules.psd1) -SourcePath (Join-Path $env:GITHUB_WORKSPACE configurationdata) -OutputPath (Join-Path $env:GITHUB_WORKSPACE output)
18
18
shell : powershell
19
19
- uses : actions/upload-artifact@v3
20
20
with :
21
21
name : build-artifacts
22
22
path : |
23
23
.\output\rsop
24
- .\output\policies
24
+ .\output\policies
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ $modPath = Resolve-Path -Path $psdependConfig.PSDependOptions.Target
12
12
$modOld = $env: PSModulePath
13
13
$pathSeparator = [System.IO.Path ]::PathSeparator
14
14
$env: PSModulePath = " $modPath$pathSeparator$modOld "
15
+ $rsops = Get-DatumRsopCache
15
16
16
17
foreach ($policy in (Get-ChildItem - Path (Join-Path - Path $OutputPath - ChildPath Policies) - Recurse - Filter * .xml))
17
18
{
@@ -24,6 +25,12 @@ foreach ($policy in (Get-ChildItem -Path (Join-Path -Path $OutputPath -ChildPath
24
25
$null = New-GPO - Name $policy.BaseName - Comment " Auto-updated applocker policy" - Domain $policy.Directory.Name
25
26
}
26
27
28
+ $rsop = $rsops | Where-Object { $_.Name -eq $policy.BaseName }
29
+ foreach ($link in $rsop.Links )
30
+ {
31
+ Set-GPLink - Name $rsop.PolicyName - Target $link.OrgUnitDn - LinkEnabled $link.Enabled - Enforced $link.Enforced - Order $link.Order - Domain $policy.Directory.Name - Confirm:0
32
+ }
33
+
27
34
$policyFound = $searcher.FindOne ()
28
35
29
36
Set-AppLockerPolicy - XmlPolicy $policy.FullName - Ldap $policyFound.Path
Original file line number Diff line number Diff line change 1
- PolicyName : Pol1
2
- Domain : þdomainfqdnþ
1
+ PolicyName : " [x={ $Node.Name }=]"
2
+ Domain : " [x={ $File.Directory.BaseName } =]"
3
+ Links :
4
+ - OrgUnitDn : " OU=Prod,DC=contoso,DC=com"
5
+ LinkOrder : 1
6
+ Enforced : yes # unspecified, no
7
+ Enabled : no # unspecified, yes
8
+ - OrgUnitDn : " OU=Test,DC=contoso,DC=com"
9
+ LinkOrder : 1
10
+ Enforced : yes # unspecified, no
11
+ Enabled : yes # unspecified, no
3
12
Apps :
4
13
- Git
5
- - Obs
14
+ - Obs
Original file line number Diff line number Diff line change @@ -29,7 +29,22 @@ The idea is to describe content that is relevant for each domain.
29
29
# # Policies
30
30
31
31
Grouped by the domain, each policy should be a single yml file that contains
32
- the Name, Domain and subscribed Apps for that policy.
32
+ the Name, Domain, optional GPLinks and subscribed Apps for that policy.
33
+
34
+ Through the use of Datum.InvokeCommand, we can run scripts during the build
35
+ process, or rather : When generating the RSOP for the build.
36
+
37
+ ` ` ` yaml
38
+ PolicyName: "[x={ $Node.Name }=]"
39
+ Domain: "[x={ $File.Directory.BaseName } =]"
40
+ Links:
41
+ - OrgUnitDn: "OU=Prod,DC=contoso,DC=com"
42
+ LinkOrder: 1
43
+ Enforced: yes # unspecified, no
44
+ Enabled: no # unspecified, yes
45
+ Apps:
46
+ - Git
47
+ ` ` `
33
48
34
49
# # Generics
35
50
You can’t perform that action at this time.
0 commit comments