Skip to content

Commit

Permalink
initial configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Lee (POWERSHELL HE/HIM) (from Dev Box) committed Oct 15, 2024
1 parent ed7d8a7 commit 4a72440
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 3 deletions.
4 changes: 3 additions & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ $filesForWindowsPackage = @(
'RunCommandOnSet.exe',
'windowspowershell.dsc.resource.json',
'wmi.dsc.resource.json',
'wmi.resource.ps1'
'wmi.resource.ps1',
'configurations/windows_baseline.dsc.yaml',
'configurations/windows_inventory.dsc.yaml'
)

$filesForLinuxPackage = @(
Expand Down
62 changes: 62 additions & 0 deletions configurations/windows_baseline.dsc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This configuration validates a Windows system against a security baseline configuration
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
metadata:
Microsoft.DSC:
securityContext: Elevated
resources:
- name: Validate the OS is Windows
type: Microsoft.DSC/Assertion
properties:
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
resources:
- name: os
type: Microsoft/OSInfo
properties:
family: Windows
- name: Registry checks
type: Microsoft.DSC/Group
dependsOn:
- "[resourceId('Microsoft.DSC/Assertion','Validate the OS is Windows')]"
properties:
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
resources:
- name: Default RDP port
type: Microsoft.Windows/Registry
metadata:
area: Network Access
severity: Critical
properties:
keyPath: HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
valueName: PortNumber
valueData:
DWord: 3389
- name: Disable SMBv1
type: Microsoft.Windows/Registry
metadata:
area: Network Access
severity: Critical
properties:
keyPath: HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
valueName: SMB1
valueData:
DWord: 0 # Disabled
- name: Disable Windows Search service
type: Microsoft.Windows/Registry
metadata:
area: Services
severity: Critical
properties:
keyPath: HKLM\SYSTEM\CurrentControlSet\Services\WSearch
valueName: Start
valueData:
DWord: 4 # Disabled
- name: Scan Removeable Drives
type: Microsoft.Windows/Registry
metadata:
area: Services
severity: Critical
properties:
keyPath: HKLM\SOFTWARE\Policies\Microsoft\Windows Defender
valueName: DisableRemovableDriveScanning
valueData:
DWord: 0 # Disabled
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
resources:
- name: Validate the OS is Windows
type: Microsoft.DSC/Assertion
properties:
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
resources:
- name: os
type: Microsoft/OSInfo
properties:
family: Windows
- name: WMI
type: Microsoft.Windows/WMI
dependsOn:
- "[resourceId('Microsoft.DSC/Assertion','Validate the OS is Windows')]"
properties:
resources:
- name: computer system
Expand Down Expand Up @@ -39,4 +50,4 @@ resources:
adaptertype:
netconnectionid:
serviceName:
netconnectionstatus: 2
netconnectionstatus: 2 # Connected
2 changes: 1 addition & 1 deletion wmi-adapter/Tests/wmi.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Describe 'WMI adapter resource tests' {
}

It 'Example config works' -Skip:(!$IsWindows) {
$configPath = Join-Path $PSScriptRoot '..\..\dsc\examples\wmi_inventory.dsc.yaml'
$configPath = Join-Path $PSScriptRoot '..\..\configurations\windows_inventory.dsc.yaml'
$r = dsc config get -p $configPath
$LASTEXITCODE | Should -Be 0
$r | Should -Not -BeNullOrEmpty
Expand Down

0 comments on commit 4a72440

Please sign in to comment.