File tree Expand file tree Collapse file tree 4 files changed +78
-3
lines changed Expand file tree Collapse file tree 4 files changed +78
-3
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,9 @@ $filesForWindowsPackage = @(
44
44
' RunCommandOnSet.exe' ,
45
45
' windowspowershell.dsc.resource.json' ,
46
46
' wmi.dsc.resource.json' ,
47
- ' wmi.resource.ps1'
47
+ ' wmi.resource.ps1' ,
48
+ ' configurations/windows_baseline.dsc.yaml' ,
49
+ ' configurations/windows_inventory.dsc.yaml'
48
50
)
49
51
50
52
$filesForLinuxPackage = @ (
Original file line number Diff line number Diff line change
1
+ # This configuration validates a Windows system against a security baseline configuration
2
+ $schema : https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
3
+ metadata :
4
+ Microsoft.DSC :
5
+ securityContext : Elevated
6
+ resources :
7
+ - name : Validate the OS is Windows
8
+ type : Microsoft.DSC/Assertion
9
+ properties :
10
+ $schema : https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
11
+ resources :
12
+ - name : os
13
+ type : Microsoft/OSInfo
14
+ properties :
15
+ family : Windows
16
+ - name : Registry checks
17
+ type : Microsoft.DSC/Group
18
+ dependsOn :
19
+ - " [resourceId('Microsoft.DSC/Assertion','Validate the OS is Windows')]"
20
+ properties :
21
+ $schema : https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
22
+ resources :
23
+ - name : Default RDP port
24
+ type : Microsoft.Windows/Registry
25
+ metadata :
26
+ area : Network Access
27
+ severity : Critical
28
+ properties :
29
+ keyPath : HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
30
+ valueName : PortNumber
31
+ valueData :
32
+ DWord : 3389
33
+ - name : Disable SMBv1
34
+ type : Microsoft.Windows/Registry
35
+ metadata :
36
+ area : Network Access
37
+ severity : Critical
38
+ properties :
39
+ keyPath : HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
40
+ valueName : SMB1
41
+ valueData :
42
+ DWord : 0 # Disabled
43
+ - name : Disable Windows Search service
44
+ type : Microsoft.Windows/Registry
45
+ metadata :
46
+ area : Services
47
+ severity : Critical
48
+ properties :
49
+ keyPath : HKLM\SYSTEM\CurrentControlSet\Services\WSearch
50
+ valueName : Start
51
+ valueData :
52
+ DWord : 4 # Disabled
53
+ - name : Scan Removeable Drives
54
+ type : Microsoft.Windows/Registry
55
+ metadata :
56
+ area : Services
57
+ severity : Critical
58
+ properties :
59
+ keyPath : HKLM\SOFTWARE\Policies\Microsoft\Windows Defender
60
+ valueName : DisableRemovableDriveScanning
61
+ valueData :
62
+ DWord : 0 # Disabled
Original file line number Diff line number Diff line change 1
1
$schema : https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
2
2
resources :
3
+ - name : Validate the OS is Windows
4
+ type : Microsoft.DSC/Assertion
5
+ properties :
6
+ $schema : https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
7
+ resources :
8
+ - name : os
9
+ type : Microsoft/OSInfo
10
+ properties :
11
+ family : Windows
3
12
- name : WMI
4
13
type : Microsoft.Windows/WMI
14
+ dependsOn :
15
+ - " [resourceId('Microsoft.DSC/Assertion','Validate the OS is Windows')]"
5
16
properties :
6
17
resources :
7
18
- name : computer system
@@ -39,4 +50,4 @@ resources:
39
50
adaptertype :
40
51
netconnectionid :
41
52
serviceName :
42
- netconnectionstatus : 2
53
+ netconnectionstatus : 2 # Connected
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ Describe 'WMI adapter resource tests' {
47
47
}
48
48
49
49
It ' Example config works' - Skip:(! $IsWindows ) {
50
- $configPath = Join-Path $PSScriptRoot ' ..\..\dsc\examples\wmi_inventory .dsc.yaml'
50
+ $configPath = Join-Path $PSScriptRoot ' ..\..\configurations\windows_inventory .dsc.yaml'
51
51
$r = dsc config get - p $configPath
52
52
$LASTEXITCODE | Should - Be 0
53
53
$r | Should -Not - BeNullOrEmpty
You can’t perform that action at this time.
0 commit comments