Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

## [Unreleased]

* Update PowerSTIG to create Checklist V3 file format

New Feature Request:
**Is your feature request related to a problem? Please describe.**
The checklist files generated are in the V2 format, but I need the files generated in the V3 format.

**Describe the solution you'd like**
I want a new function, e.g., New-STIGChecklistV3, that generates a checklist file in the V3 format.

**Describe alternatives you've considered**
An alternate option would be a function that converts a V2 Checklist file to the V3 format, instead of generating the V3 file directly.

**Additional context**
The V3 format schema can be found in the Cyber.mil document library.


## [4.28.0] - 2025-12-5

Expand Down Expand Up @@ -87,7 +102,7 @@
* Update Powerstig to parse/apply Microsoft Office System 2016 STIG - Ver 2, Rel 3 [#1352](https://github.com/microsoft/PowerStig/issues/1352)
* Update Powerstig to parse/apply Microsoft Office 365 ProPlus STIG - Ver 2, Rel 12 [#1351](https://github.com/microsoft/PowerStig/issues/1351)
* Update Powerstig to parse/apply Microsoft .Net Framework 4.0 STIG - Ver 2, Rel 4 [#1349](https://github.com/microsoft/PowerStig/issues/1349)
* Update Powerstig to parse/apply U_MS_SQL_Server_2016_Instance_V2R12 [#1348](https://github.com/microsoft/PowerStig/issues/1348)
* Update Powerstig to parse/apply U_MS_SQL_Server_2016_Instance_V2R12 [#1348](https://github.com/microsoft/PowerStig/issues/1348)
* Update Powerstig to parse/apply Canonical Ubuntu 18.04 LTS STIG - Ver 2, Rel 14 [#1347](https://github.com/microsoft/PowerStig/issues/1347)

## [4.21.0] - 2024-03-01
Expand Down
64 changes: 64 additions & 0 deletions Tests/Unit/Module/STIG.Checklist.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,67 @@ Describe 'Get-StigXccdfFileName' {
$getStigXccdfFileNameResult | Should -Be 'U_Windows_Firewall_STIG_V1R7_Manual-xccdf.xml'
}
}

Describe 'New-StigCheckListV3' {

configuration ExampleV3
{
param
(
[parameter()]
[string]
$NodeName = "localhost"
)

Import-DscResource -ModuleName PowerStig

Node $NodeName
{
WindowsServer BaseLine
{
OsVersion = "2019"
OsRole = "MS"
SkipRuleType = "AccountPolicyRule","AuditPolicyRule","AuditSettingRule","DocumentRule","ManualRule","PermissionRule","SecurityOptionRule","UserRightRule","WindowsFeatureRule","ProcessMitigationRule","RegistryRule"
}
}
}
ExampleV3 -OutputPath $TestDrive

$mofTestV3 = '{0}{1}' -f $TestDrive.fullname,"\localhost.mof"

# Test parameter validity -OutputPath
It 'Should throw if an invalid path is provided' {
{New-StigCheckListV3 -MofFile 'test' -XccdfPath 'test' -OutputPath 'c:\asdf'} | Should -Throw
}

It 'Should throw if the full path to a .cklb file is not provided' {
{New-StigCheckListV3 -MofFile 'test' -XccdfPath 'test' -OutputPath 'c:\test\test.ck'} | Should -Throw
}

# Test parameter -ManualCheckFile
It 'Should throw if the full path to a ManualChecklistEntriesFile is not valid' {
{New-StigCheckListV3 -MofFile 'test' -XccdfPath 'test' -ManualChecklistEntriesFile 'broken' -OutputPath 'c:\test\test.cklb'} | Should -Throw
}

# Test invalid parameter combinations
It 'Should throw if an invalid combination of parameters for assessment is provided' {
{New-StigCheckListV3 -MofFile 'test' -DscResults 'test' -XccdfPath 'test' -OutputPath 'C:\test'} | Should -Throw
}

It 'Should throw if an invalid combination of parameters for Xccdf validation is provided' {
{New-StigCheckListV3 -DscResult 'foo' -MofFile 'bar' -OutputPath 'C:\Test'} | Should -Throw
}

It 'Should throw if input for Verifier is not string' {
{New-StigCheckListV3 -MofFile 'test' -XccdfPath 'test' -OutputPath 'c:\test\test.cklb' -Verifier 1234} | Should -Throw
}

It 'Generate a V3 checklist given correct parameters' {

{
$outputPath = Join-Path $TestDrive -ChildPath ChecklistV3.cklb
$xccdfPath = ((Get-ChildItem -Path $script:moduleRoot\StigData\Archive -Include *xccdf.xml -Recurse | Where-Object -Property Name -Match "Server_2019_MS")[1]).FullName
New-StigCheckListV3 -ReferenceConfiguration $mofTestV3 -XccdfPath $xccdfPath -OutputPath $outputPath -Verifier "PowerSTIG V3 Test"
} | Should -Not -Throw
}
}
Loading
Loading