<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* Upgraded security protections across build and deployment workflows
for enhanced runner environment hardening.
* Strengthened CI/CD infrastructure security measures throughout
automated processes.
* No direct user-facing changes.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
90 lines
3.3 KiB
YAML
90 lines
3.3 KiB
YAML
name: Test Fleet Maintained Apps - Windows
|
|
|
|
on:
|
|
# Note: PR triggers removed - use test-fma-windows-pr-only.yml for PRs
|
|
# This workflow is kept for manual testing of all FMAs via workflow_dispatch
|
|
workflow_dispatch: # Manual trigger
|
|
inputs:
|
|
log_level:
|
|
description: "Log level (debug, info, warn, error)"
|
|
required: false
|
|
default: "info"
|
|
type: choice
|
|
options:
|
|
- debug
|
|
- info
|
|
- warn
|
|
- error
|
|
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test-fma:
|
|
env:
|
|
LOG_LEVEL: ${{ github.event.inputs.log_level || 'info' }}
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout Fleet
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
repository: fleetdm/fleet
|
|
fetch-depth: 1
|
|
ref: ${{ github.ref }}
|
|
path: fleet
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
|
with:
|
|
go-version-file: "fleet/go.mod"
|
|
|
|
- name: Install osquery windows
|
|
run: |
|
|
Write-Host "Runner architecture: $env:PROCESSOR_ARCHITECTURE"
|
|
curl -L -o osquery.zip "https://github.com/osquery/osquery/releases/download/5.18.1/osquery-5.18.1.windows_x86_64.zip"
|
|
Expand-Archive -Path osquery.zip -DestinationPath osquery
|
|
Get-ChildItem -Recurse osquery | Where-Object { $_.Name -like "*osquery*" -and $_.Extension -eq ".exe" }
|
|
$osqueryPath = (Get-ChildItem -Recurse osquery | Where-Object { $_.Name -eq "osqueryi.exe" }).Directory.FullName
|
|
echo "Adding to PATH: $osqueryPath"
|
|
echo $osqueryPath | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
|
shell: pwsh
|
|
|
|
- name: Remove pre-installed google chrome
|
|
run: |
|
|
Write-Host "Listing all installed packages containing 'Chrome':"
|
|
Get-Package | Where-Object { $_.Name -like "*Chrome*" } | ForEach-Object {
|
|
Write-Host " - $($_.Name) (Version: $($_.Version))"
|
|
}
|
|
|
|
$uninstallPath = Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*" | Where-Object { $_.DisplayName -like "*Google Chrome*" } | Select-Object -ExpandProperty UninstallString
|
|
if ($uninstallPath) {
|
|
Write-Host "Found Chrome uninstall path: $uninstallPath"
|
|
try {
|
|
$guid = ($uninstallPath -split "/X")[1]
|
|
Write-Host "Uninstalling Chrome MSI with GUID: $guid"
|
|
Start-Process -FilePath "msiexec.exe" -ArgumentList "/X$guid", "/quiet", "/norestart" -Wait -NoNewWindow
|
|
Write-Host "Successfully removed Google Chrome via MSI uninstaller"
|
|
} catch {
|
|
Write-Host "Failed to remove Chrome: $($_.Exception.Message)"
|
|
}
|
|
} else {
|
|
Write-Host "Chrome uninstall path not found in registry"
|
|
}
|
|
shell: pwsh
|
|
|
|
- name: Verify Fleet Maintained Apps windows
|
|
run: |
|
|
ls "C:\Program Files"
|
|
cd fleet
|
|
go run ./cmd/maintained-apps/validate
|
|
shell: pwsh
|