-
Notifications
You must be signed in to change notification settings - Fork 128
CustomizingRules
PowerSTIG provides two common ways to customize behavior in a baseline:
-
SkipRule- Mark specific STIG rules as skipped (not enforced). -
OrgSettings- Override organization-specific values while keeping rules enforced.
Use SkipRule only when a rule is intentionally not enforced in your environment (for example, approved risk acceptance, technical exception, or out-of-scope requirement).
At compile time, PowerSTIG marks the listed rule IDs as skipped in the generated MOF. These rules still appear in the MOF (typically with a [Skip] marker in the ResourceID) but are represented as non-enforcing resources.
In practice, skipped entries are commonly emitted as script-based resources that always pass (TestScript returns $true), so no setting is applied for that rule.
Configuration PowerStig
{
Import-DscResource -ModuleName PowerStig -ModuleVersion 4.29.0
Node localhost
{
WindowsClient Win11-Baseline
{
StigVersion = '2.6'
OsVersion = '11'
SkipRule = 'V-253261', 'V-253445'
}
}
}
. PowerStig -OutputPath 'c:\temp\mof'Use OrgSettings when a STIG rule allows more than one valid value (for example, ranges, allowed options, or organization-defined values) and your organization requires a specific approved setting.
At compile time, PowerSTIG:
- Loads the selected STIG data (
Technology,TechnologyVersion,StigVersion). - Applies values from
OrgSettingsover default STIG values. - Compiles the final configuration into a MOF.
$WindowsClientOrgSettings = @{
'V-253261' = @{ ValueData = '900' }
'V-253445' = @{ ValueData = '1' }
}
Configuration PowerStig
{
Import-DscResource -ModuleName PowerStig -ModuleVersion 4.29.0
Node localhost
{
WindowsClient Win11-Baseline
{
StigVersion = '2.6'
OsVersion = '11'
OrgSettings = $WindowsClientOrgSettings
}
}
}
. PowerStig -OutputPath 'c:\temp\mof'- Start from a known-good baseline configuration.
- Use
SkipRuleonly for explicitly approved exceptions. - Add
OrgSettingsentries for rules that need organization-specific values. - Compile to MOF and review output.
- Test in a non-production environment before broad deployment.