Comments (7)
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](https://private-user-images.githubusercontent.com/44269812/321758225-4b83722a-3372-47a4-896e-33a52719b96d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxMTIzNDQsIm5iZiI6MTcyMjExMjA0NCwicGF0aCI6Ii80NDI2OTgxMi8zMjE3NTgyMjUtNGI4MzcyMmEtMzM3Mi00N2E0LTg5NmUtMzNhNTI3MTliOTZkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI3VDIwMjcyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRkYzMxMjVjYzcxODU1ODVjNTU5ODk0ZjcwYmZiZTM2ODc2MDMzYTQ4ZTczMDdkZTJhNTU4ZWNiN2M2YTYyNzEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.R7bC2BKQPPaIr1PPmmIkWg_92t8cHYVR_rf3BKWiMZc)
Thank you,
Eric
from powerstig.
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](https://private-user-images.githubusercontent.com/42325057/322024415-c435d705-b903-4f9e-a131-277ef977ac4f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxMTIzNDQsIm5iZiI6MTcyMjExMjA0NCwicGF0aCI6Ii80MjMyNTA1Ny8zMjIwMjQ0MTUtYzQzNWQ3MDUtYjkwMy00ZjllLWExMzEtMjc3ZWY5NzdhYzRmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI3VDIwMjcyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMzM2MxMjlkM2U4OWMyZjc4OTQ1ZjAyNGFmZTI1ZGY5ZjQwOThlYWVkMjA4NjU2OTY1MjZjNjZhYjExZDNjNGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.vhfvjM0oEzgioPvFfbokumniJghtrsrHdFVxZxLgn0w)
from powerstig.
What version of PowerShell are you using? We only support PowerShell 5.1 currently.
from powerstig.
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.
It is PS 5.1 in the runner agent also.
![image](https://private-user-images.githubusercontent.com/42325057/331667277-ef898f66-b067-4d5c-b6aa-9392a3a2cd49.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxMTIzNDQsIm5iZiI6MTcyMjExMjA0NCwicGF0aCI6Ii80MjMyNTA1Ny8zMzE2NjcyNzctZWY4OThmNjYtYjA2Ny00ZDVjLWI2YWEtOTM5MmEzYTJjZDQ5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI3VDIwMjcyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI0ZTljODNjYTM2ZDdjMjE3MGE1ZGE0MDZlOThjOGMyYjBhNDI1NzA5Njk5MjJlZjVkMjAyZDc3OTg1MjljOGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.wQDxODdQico9epjruR8cVUiB5LuwqJvMpjITdcg5fZ0)
Downgrading to 4.18 works for Windows 2022
from powerstig.
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.
Thank you,
Eric
from powerstig.
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)
- Update PowerSTIG to Parse/Apply Microsoft Windows Server 2016 STIG - Ver 2, Rel 8
- Update PowerSTIG to Parse/Apply Microsoft Windows 11 STIG - Ver 1, Rel 6
- Update PowerSTIG to Parse/Apply Microsoft Windows 10 STIG - Ver 2, Rel 9
- Update Powerstig to parse\apply Canonical Ubuntu 18.04 LTS STIG - Ver 2, Rel 14
- Update Powerstig to parse\apply U_MS_SQL_Server_2016_Instance_V2R12
- Update Powerstig to parse\apply Microsoft .Net Framework 4.0 STIG - Ver 2, Rel 4
- Update Powerstig to parse\apply Microsoft Edge STIG - Ver 1, Rel 8
- Update Powerstig to parse\apply Microsoft Office 365 ProPlus STIG - Ver 2, Rel 12
- Update Powerstig to parse\apply Microsoft Office System 2016 STIG - Ver 2, Rel 3
- Windows Server 2022 - "Cannot find an appropriate constructor for type System.Security.Principal.NTAccount" HOT 3
- Update PowerSTIG to Parse/Apply Oracle Linux 8 V1R10
- Add a param to pass a custom rule file path to the STIG constructor
- Update Powerstig to parse\apply U_MS_Edge_V2R1_STIG
- Update Powerstig to parse\apply Microsoft Windows 10 STIG - Ver 3, Rel 1
- Update Powerstig to parse\apply Microsoft Windows 11 STIG - Ver 2, Rel 1
- Update Powerstig to parse\apply Microsoft Windows Server 2019 STIG - Ver 3, Rel 1
- Update Powerstig to parse\apply Microsoft Windows Server 2022 STIG - Ver 2, Rel 1
- Update Powerstig to parse\apply Microsoft IIS 10.0 Server STIG
- Update Powerstig to parse\apply Microsoft Office 365 ProPlus STIG - Ver 3, Rel 1
- Update Powerstig to parse\apply U_MS_SQL_Server_2016_Instance_V3R1_Manual_STIG
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powerstig.