microsoft / microsoft/PowerStig

Windows Server 2025 `V-278193.c` emits CertificateImport without mandatory Thumbprint

Open
#1,561 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
619
Forks
124
PR merge metrics
No merged PRs in 30d

Description

PowerSTIG 4.30.0 generates an invalid CertificateImport DSC resource for V-278193.c in the Windows Server 2025 Member Server STIG 1.1.

The processed rule is stored as a RootCertificateRule, but contains:

<Rule id="V-278193.c" dscresource="none">
    <CertificateName />
    <Thumbprint />
</Rule>

Despite dscresource="none", the rule is selected by windows.RootCertificate.ps1 and emitted as a CertificateImport resource.

DSC then fails while applying the generated MOF:

Could not find mandatory property Thumbprint. Add this property and try again.

CategoryInfo          : ObjectNotFound
FullyQualifiedErrorId : MI RESULT 6

The root cause appears to be in the way that windows.RootCertificate.ps1 selects rules by their PowerShell type such as $rules = Select-Rule -RuleList $stig.RuleList -Type RootCertificateRule.

Select-Rule filters by rule type and DuplicateOf, but does not exclude rules where DscResource is None:

return $RuleList.Where({
    $_.GetType().ToString() -eq $Type -and
    [string]::IsNullOrEmpty($_.DuplicateOf)
})

Therefore, V-278193.c remains a RootCertificateRule and reaches:

CertificateImport (Get-ResourceTitle -Rule $rule) {
    Thumbprint = $rule.Thumbprint
    Location   = 'LocalMachine'
    Store      = $storeLocation
    Path       = $rule.Location
}

Because its thumbprint is empty, DSC receives an invalid resource instance.

Adding V-278193.c to SkipRule does not work because _LoadRules only creates a SkippedRule when:
$rule.dscresource -ne 'None'

Workaround:

Exception = @{
    'V-278193.c' = @{
        DuplicateOf = 'V-278193.a'
    }
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with windows.RootCertificate.ps1 and trace its Select-Rule call into the rule-filtering logic and _LoadRules behavior described in the issue. Verify the handling of V-278193.c and dscresource=None, then confirm the generated MOF no longer contains an invalid CertificateImport with an empty Thumbprint and DSC applies without the mandatory-property error.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.