Add Attack Surface Analyzer test in Windows container to Windows packaging workflow for x64/stable#26246
Add Attack Surface Analyzer test in Windows container to Windows packaging workflow for x64/stable#26246Copilot wants to merge 34 commits into
Conversation
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
…alls MSI Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR integrates Microsoft's Attack Surface Analyzer (ASA) into the Windows packaging workflow to perform security testing by detecting system changes during PowerShell package installation.
- Adds ASA as a .NET global tool to capture system state before and after package building/testing
- Implements differential analysis to identify security-relevant system changes
- Leverages existing MSI installation from packaging tests to avoid redundant installations
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
|
@copilot TravisEz13 reviewed .github/workflows/windows-packaging-reusable.yml Pin the version. |
|
@copilot This is working but it is too noisy because ASA is running, 1 - against the build, packaging, and testing of the MSI, 2 - on a machine with the MSI already installed. Can we use a windows container that doesn't use the powershell MSI, such as mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-ltsc2022, to run the ASA, just install the MSI, and record the final snapshot and generate the reports? But still build on the normal agent. |
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Implemented Windows container-based ASA testing. The workflow now:
This eliminates noise from build/packaging/testing and pre-installed PowerShell. (commit: will follow) |
…utomatic installation via winget
…pdate scripts to use the static Dockerfile for building the Attack Surface Analyzer container.
…ild for optimized result extraction in Run-AttackSurfaceAnalyzer.ps1
…xt and improve installation logging
…or output path and report extraction
…d logging for TXT, SARIF, and SQLite files
…Dockerfile: standardize SARIF file naming and improve logging for file operations
|
replaced by #26379 |
Summary
This PR adds Microsoft's Attack Surface Analyzer (ASA) as a security test to the Windows packaging workflow. ASA helps identify potential security vulnerabilities and unexpected system changes introduced during PowerShell package installation.
ASA runs in a clean Windows container for the x64/stable matrix configuration only to eliminate noise from pre-installed PowerShell 7, build/packaging/testing activities, and other running tasks on the GitHub Actions runner.
Changes
Modified
.github/workflows/windows-packaging-reusable.ymlto integrate Attack Surface Analyzer testing using Windows containers:runASA: trueflagInvoke-CIFinishon the normal GitHub Actions runner to build packagesmcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-ltsc2022) to run ASA:if: matrix.runASA == truecondition to skip execution for all other matrix configurationsModified
.github/actions/infrastructure/path-filters/action.yml:.github/workflows/windows-packaging-reusable.ymlto thepackagingChangedfilterHow It Works
Attack Surface Analyzer performs a differential analysis in an isolated Windows container by:
This container-based approach eliminates noise from:
The MSI is built on the normal GitHub Actions runner where all build tools are available, then copied into a clean container for isolated testing.
Performance Optimizations
To ensure fast execution and reduce noise, ASA is configured with:
mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-ltsc2022container without pre-installed PowerShellC:\Program Files\PowerShellandC:\Program Files (x86)\PowerShell)--isolation processfor better performance on Windows runnersBenefits
Matrix Configuration
ASA execution status by configuration:
Testing
References
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.