Skip to content

Updated converted sigma rules for version version/7.1 #2472

Updated converted sigma rules for version version/7.1

Updated converted sigma rules for version version/7.1 #2472

Workflow file for this run

name: Transpile SCI Scripts
on:
push:
branches-ignore:
- "main"
- "version/7.0"
- "version/6.2"
jobs:
transpile:
runs-on: ${{ (startsWith(github.ref, 'refs/heads/develop') || startsWith(github.ref, 'refs/heads/version/')) && 'windows-latest' || 'ubuntu-latest' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
token: ${{ secrets.VLSVC_PAT }}
- name: Setup Python environment
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Run transpiler script for Windows
shell: bash
run: python config-dev/transpile.py
- name: Run PSScriptAnalyzer
uses: microsoft/[email protected]
with:
path: "config/Security inventory/Windows"
recurse: true
excludeRule: '"PSUseSingularNouns", "PSUseShouldProcessForStateChangingFunctions", "PSAvoidGlobalVars"'
output: config-dev/generated/psscriptanalyzer_log.sarif
- name: Run PSScriptAnalyzer log analyzer script
shell: bash
run: python config-dev/analyzeLog.py --log_level note --fail_level error
- name: Signing Powershell scripts
if: success() && (startsWith(github.ref, 'refs/heads/develop') || startsWith(github.ref, 'refs/heads/version/'))
shell: powershell
run: |
try {
# Create buffer from the BASE64 string of the PFX stored in the secret
$buffer = [System.Convert]::FromBase64String($env:BASE64_PFX)
# Create new certificate object from the buffer and the certificate pass
$certificate = [System.Security.Cryptography.X509Certificates.X509Certificate2]::New($buffer, $env:PFX_PASSWORD)
}
catch {
Write-Error "Failed to decrypt certificate"
return
}
$scripts = Get-ChildItem -Path $env:SCRIPT_DIR -Filter "*.ps1" -Recurse -ErrorAction Stop
foreach ($script in $scripts) {
try {
Write-Output "Signing script `"$($script.Name)`" with certificate `"$($certificate.Thumbprint)`""
# sign script
$null = Set-AuthenticodeSignature -HashAlgorithm SHA256 -Certificate $certificate -FilePath $script.FullName -TimestampServer "http://timestamp.comodoca.com/rfc3161"
}
catch {
Write-Error "Failed to sign script `"$($script.Name)`" with certificate `"$($certificate.Thumbprint)`""
}
}
env:
BASE64_PFX: ${{ secrets.CERT_BASE64_PFX }}
PFX_PASSWORD: ${{ secrets.CERT_PFX_PASSWORD }}
SCRIPT_DIR: "./config/Security inventory/Windows"
- name: Run badge update script
if: success() || failure()
run: python config-dev/updateBadge.py
shell: bash
env:
GITHUB_REF: ${{ github.ref }}
- name: Commit everything - release branch
if: success() && (startsWith(github.ref, 'refs/heads/develop') || startsWith(github.ref, 'refs/heads/version/'))
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Updated transpiled output
commit_user_name: vastlimits
commit_user_email: [email protected]