Git Product home page Git Product logo

Comments (7)

erjenkin avatar erjenkin commented on July 28, 2024

Hello @RKSelvi

Thanks for creating the issue. Please provide your DSC configuration so we better troubleshoot the issue.

The following configuration with skip rules works on Server 2022 with PowerShell 5.1

    
 configuration Windows
{
    Import-DscResource -ModuleName PowerSTIG -ModuleVersion 4.21.0
    Import-DscResource -ModuleName SecurityPolicyDsc -ModuleVersion 2.10.0.0

    Node localhost
    {

         WindowsServer BaseLine
        {
            OsVersion   = '2022'
            OsRole      = 'MS'
            DomainName  = 'sample.test'
            ForestName  = 'sample.test'
            SkipRule = @('V-254286', 'V-254285', 'V-254287')
        }

         AccountPolicy BaseLine2
        {
            Name                                = "2022fix"
            Account_lockout_threshold           = 3
            Account_lockout_duration            = 15
            Reset_account_lockout_counter_after = 15
        }
     }
}

windows
image

Thank you,

Eric

from powerstig.

RKSelvi avatar RKSelvi commented on July 28, 2024

Hi @erjenkin
Thank you for your response. Below is the configuration I am using.

$NtpClientType = NT5DS
$NtpServers = time.windows.com,0x8

`Configuration win2022STIG
{
param(
[parameter(Mandatory)]
[String]
$NtpClientType,

    [parameter(Mandatory)]
    [String]
    $NtpServers
)

Import-DscResource -ModuleName 'PowerSTIG' -ModuleVersion 4.21.0
Import-DscResource -ModuleName 'PSDscResources' -ModuleVersion 2.12.0.0

Node localhost
{
    WindowsServer STIGs
    {
        OsVersion    = '2022'
        OSRole       = 'MS'
        Exception    = @{
            'V-254435' = 'guests'
            'V-254429' = '1'
            'V-254438' = 'guests'
            'V-254439' = 'guests'
        }
        SkipRule     = @(
            'V-254424',
            'V-254421',
            'V-254254'
        )
    }

    WindowsDefender STIG_WindowsDefender
    {
        StigVersion = '2.3'
    }
}

}
`
compile is failing,

image

from powerstig.

erjenkin avatar erjenkin commented on July 28, 2024

What version of PowerShell are you using? We only support PowerShell 5.1 currently.
image

from powerstig.

RKSelvi avatar RKSelvi commented on July 28, 2024

I am compiling in the GitHub actions workflow with provider host agent which I believe it is Windows 2022. The PS version would be whatever the agent has it. This works for DSC for 2019 but only issue with 2022

dscnodeconfiguration:
name:    Compile DSC Node Config
runs-on: windows-latest

steps:
- uses: actions/[email protected]

- name:  Compile DSC Config
  shell: powershell
  run:   |
    Write-Host 'Installing PowerSTIG'
    $PowerStigVersion = $env:POWERSTIG_VERSION
    $null = Install-Module -Name 'PowerSTIG' -RequiredVersion $PowerStigVersion -Scope CurrentUser -Force -AllowClobber

    Write-Host "Executing Configuration at ${{ github.workspace}}\DSC\${{ env.DSC_CONFIGURATION_NAME }}.ps1"
    . ${{ github.workspace}}\DSC\${{ env.DSC_CONFIGURATION_NAME }}.ps1
    ${{ env.DSC_CONFIGURATION_NAME }} -NtpClientType "$env:DSC_CONFIGURATION_NTP_CLIENT_TYPE" -NtpServers "$env:DSC_CONFIGURATION_NTP_SERVERS"

from powerstig.

RKSelvi avatar RKSelvi commented on July 28, 2024

It is PS 5.1 in the runner agent also.

image

Downgrading to 4.18 works for Windows 2022

from powerstig.

erjenkin avatar erjenkin commented on July 28, 2024

Please attempt to run this on a 2022 VM rather than the Github Runner. I am not sure how those are configured, but I am not able to reproduce on a 2022 VM, so leaning towards this being a configuration issue with that container vs PowerSTIG.
image

Thank you,
Eric

from powerstig.

RKSelvi avatar RKSelvi commented on July 28, 2024

Hi @erjenkin
The new release of PowerSTIG 4.22, just four days fixed the windows2022 DSC compile issue!

https://www.powershellgallery.com/packages/PowerSTIG/4.22.0

Perhaps some fix went in. I am good to go. Closing this issue. Thank you for all your responses.

from powerstig.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.