-
Notifications
You must be signed in to change notification settings - Fork 127
CompositeResources
This page explains how PowerSTIG composite resources map to DISA STIG content and how those resources compile into MOF files.
Each supported product in PowerSTIG is represented by a DSC composite resource. For a list of supported products, see Supported STIGs
For example, support for the Windows 11 Client STIG is exposed through the WindowsClient resource.
Configuration PowerStig
{
Import-DscResource -ModuleName PowerStig -ModuleVersion 4.28.0
WindowsClient 11Baseline
{
StigVersion = "2.5"
OsVersion = "11"
}
}
. PowerStig -OutputPath "c:\class\mof"The following list explains each part of the example configuration and compile command.
- Configuration: Required DSC keyword that starts a configuration definition.
- PowerStig: Arbitrary name of the configuration; you run this name to compile MOF output.
- Import-DscResource: Imports the DSC resources your configuration uses; the module version should match the PowerSTIG version installed.
- WindowsClient: The DSC resource type used in this configuration; one resource can produce many automated STIG rule settings.
- 11Baseline: Resource instance name (a label you choose for this specific resource block).
- StigVersion: The STIG release version to apply (for example, 2.5).
- OsVersion: The target OS version for the selected STIG data (for example, 11).
-
. PowerStig -OutputPath c:\someFolder: Runs the configuration and writes compiled MOF files to the specified output path. The leading.is required.
The above script compiles a MOF file to the output path. The MOF file can then be applied to enforce the included STIG baseline. To see how to apply a MOF file to an endpoint, see Applying Configurations
You can include multiple DSC resources in one configuration (for example, WindowsClient, Edge, and Adobe). You can also mix PowerSTIG composite resources (such as WindowsClient) with built-in PowerShell DSC resources (such as Registry).
There is also a .NET UI utility for viewing MOF files created with PowerSTIG.
- GitHub Page: Mof Inspector
- Download: Mof Inspector x64
The executable is not code signed, so it carries Mark of the Web metadata. Windows may show a warning when launching it.
If you want to avoid this warning entirely, compile and publish the solution yourself.
The module version in -ModuleVersion must exist on the machine compiling the configuration.
Import-DscResource -ModuleName PowerSTIG -ModuleVersion 4.28.0If that version is not installed, install it or update your configuration to a version that is present.
The StigVersion for a resource (for example, WindowsClient) must match STIG data available in the installed PowerSTIG module.
For example, with PowerSTIG 4.28.0, inspect:
C:\Program Files\WindowsPowerShell\Modules\PowerSTIG\4.28.0\StigData\Processed\
With each PowerSTIG release, the module path changes (for example, 4.28.0, 4.29.0, and so on).
If multiple versions of a DSC resource are available (for example, v2.4 and v2.5), use the latest approved version for your environment.
For more information about working with PowerSTIG versions:
Composite resources expose a focused set of properties you populate in your DSC configuration.
To view available technologies and versions:
Import-Module PowerStig
Get-Stig -Technology WindowsClientExample output for WindowsClient (Windows 11 shown):
Technology : WindowsClient
TechnologyVersion : 11
TechnologyRole :
Version : 2.4
RuleList : {}
Technology : WindowsClient
TechnologyVersion : 11
TechnologyRole :
Version : 2.5
RuleList : {}In your configuration, use one of the available versions shown above (for example, 2.4 or 2.5).
When the configuration runs:
- PowerShell compiles the configuration.
- A MOF file is generated (
localhost.mofor<NodeName>.mof). - This MOF file can then be applied to endpoints, see Applying MOFs for more info.
Configuration PowerStig
{
Import-DscResource -ModuleName PowerStig -ModuleVersion 4.27.0
Import-DscResource -ModuleName PSDscResources -ModuleVersion 2.12.0.0
Node localhost
{
WindowsClient 11Baseline
{
StigVersion = "2.4"
OsVersion = "11"
}
}
}
. PowerStig -OutputPath "c:\someFolder"Two notable items in this example:
-
PSDscResourcesprovides standard DSC resources and is only needed when your configuration uses them. Standard DSC resources would include items like Registry, WindowsFeature, File, etc. -
Node {}defines the target node and controls MOF naming (localhost.mofor<NodeName>.mof).
PowerSTIG ships with pre-processed STIG XML data files that drive resource generation.
Example path for Windows 11 STIG v2.5 in PowerSTIG 4.28.0:
C:\Program Files\WindowsPowerShell\Modules\PowerSTIG\4.28.0\StigData\Processed\WindowsClient-11-2.5.xml
A rule entry in the processed XML includes a dscresource attribute that indicates which DSC resource implementation will enforce that setting during MOF generation.
Current process:
- DISA releases updated STIG content.
- PowerSTIG converts XCCDF source into DSC-friendly XML.
- Converted XML is added to
StigData\Processedand used during MOF compilation.
For a full list of supported products, see Supported STIGs.
Configuration PowerStig
{
Import-DscResource -ModuleName PowerStig -ModuleVersion 4.27.0
Import-DscResource -ModuleName PSDscResources -ModuleVersion 2.12.0.0
Node localhost
{
WindowsClient 11Baseline
{
StigVersion = "2.4"
OsVersion = "11"
SkipRule = 'V-253261', 'V-253445'
}
DotNetFramework 4Baseline
{
StigVersion = "2.7"
FrameworkVersion = "4"
}
}
}
. PowerStig -OutputPath "c:\someFolder"This produces localhost.mof containing settings for both Windows 11 and .NET baselines.
-
Stig Coverage (Products PowerSTIG supports)
- Stig Coverage Summary
- Adobe-AcrobatPro-2.1
- Adobe-AcrobatReader-1.6
- Adobe-AcrobatReader-2.1
- DotNetFramework-4-2.6
- DotNetFramework-4-2.7
- FireFox-All-6.6
- FireFox-All-6.7
- Google-Chrome-2.10
- Google-Chrome-2.11
- IISServer-10.0-3.5
- IISServer-10.0-3.6
- IISSite-10.0-2.13
- IISSite-10.0-2.14
- InternetExplorer-11-2.5
- InternetExplorer-11-2.6
- MS-Edge-2.3
- MS-Edge-2.4
- Office-365ProPlus-3.3
- Office-365ProPlus-3.4
- Office-Access2016-1.1
- Office-Access2016-2.1
- Office-Excel2016-1.2
- Office-Excel2016-2.2
- Office-OneNote2016-1.2
- Office-OneNote2016-2.1
- Office-Outlook2016-2.3
- Office-Outlook2016-2.4
- Office-PowerPoint2016-1.1
- Office-PowerPoint2016-2.1
- Office-Publisher2016-1.3
- Office-Publisher2016-2.1
- Office-Skype2016-1.1
- Office-Skype2016-2.1
- Office-System2016-2.4
- Office-System2016-2.5
- Office-Word2016-1.1
- Office-Word2016-2.1
- OracleLinux-8-2.3
- OracleLinux-8-2.4
- OracleLinux-9-1.1
- RHEL-7-3.14
- RHEL-7-3.15
- RHEL-9-2.3
- RHEL-9-2.7
- SqlServer-2016-Instance-3.5
- SqlServer-2016-Instance-3.6
- SqlServer-2022-Instance-1.2
- SqlServer-2022-Instance-1.3
- Ubuntu-18.04-2.14
- Ubuntu-18.04-2.15
- WindowsClient-10-3.5
- WindowsClient-10-3.6
- WindowsClient-11-2.5
- WindowsClient-11-2.6
- WindowsDefender-All-2.6
- WindowsDefender-All-2.7
- WindowsDnsServer-2012R2-2.5
- WindowsDnsServer-2012R2-2.7
- WindowsFirewall-All-2.1
- WindowsFirewall-All-2.2
- WindowsServer-2016-DC-2.10
- WindowsServer-2016-DC-2.9
- WindowsServer-2016-MS-2.10
- WindowsServer-2016-MS-2.9
- WindowsServer-2019-DC-3.6
- WindowsServer-2019-DC-3.7
- WindowsServer-2019-MS-3.6
- WindowsServer-2019-MS-3.7
- WindowsServer-2022-DC-2.6
- WindowsServer-2022-DC-2.7
- WindowsServer-2022-MS-2.6
- WindowsServer-2022-MS-2.7