Files

89 lines
2.8 KiB
YAML

name: Check audit setting
on:
push:
branches: [ "*" ]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
strategy:
matrix:
os: [windows-latest, windows-2022, windows-2025]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check PowerShell version(PowerShell core)
run: |
$PSVersionTable.PSVersion
shell: pwsh
- name: Run WELA.ps1 audit-settings(PowerShell core)
run: |
./WELA.ps1 audit-settings -Baseline YamatoSecurity
shell: pwsh
- name: Run WELA.ps1 audit-filesize(PowerShell core)
run: |
./WELA.ps1 audit-filesize -Baseline YamatoSecurity
shell: pwsh
- name: Output UsableRules.csv(PowerShell core)
run: |
Get-Content UsableRules.csv
shell: pwsh
- name: Output UnUsableRules.csv(PowerShell core)
run: |
Get-Content UnusableRules.csv
shell: pwsh
- name: Check PowerShell version(PowerShell 5.1)
run: |
$PSVersionTable.PSVersion
shell: powershell
- name: Install the DFS Namespace role for the full configuration smoke test
shell: powershell
run: |
$ErrorActionPreference = 'Stop'
# The full profile includes DFSN/Admin; hosted images differ in role availability.
# https://learn.microsoft.com/en-us/windows-server/storage/dfs-namespaces/dfs-overview
$feature = Get-WindowsFeature -Name FS-DFS-Namespace -ErrorAction Stop
if (-not $feature) { throw 'The DFS Namespace role is unavailable on this test host.' }
if (-not $feature.Installed) {
$result = Install-WindowsFeature -Name FS-DFS-Namespace -ErrorAction Stop
if (-not $result.Success -or $result.RestartNeeded -ne 'No') {
throw 'DFS Namespace setup failed or requires a restart; the smoke-test fixture is not ready.'
}
}
Get-WinEvent -ListLog 'Microsoft-Windows-DFSN-Server/Admin' -ErrorAction Stop | Out-Host
- name: Run configure command(PowerShell 5.1)
run: |
./WELA.ps1 configure -Baseline YamatoSecurity -Auto
shell: powershell
- name: Run WELA.ps1 audit-settings(PowerShell 5.1)
run: |
./WELA.ps1 audit-settings -Baseline YamatoSecurity
shell: powershell
- name: Run WELA.ps1 audit-filesize(PowerShell 5.1)
run: |
./WELA.ps1 audit-filesize -Baseline YamatoSecurity
shell: powershell
- name: Output UsableRules.csv(PowerShell 5.1)
run: |
Get-Content UsableRules.csv
shell: powershell
- name: Output UnUsableRules.csv(PowerShell 5.1)
run: |
Get-Content UnusableRules.csv
shell: powershell