[ci] Prevent isolated NuGet access - #12336
Open
jonathanpeppers wants to merge 1 commit into
Open
Conversation
Use the supported NuGetAudit MSBuild property and prevent MAUI template creation from performing an implicit restore. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This was referenced Aug 10, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the Azure Pipelines MAUI template validation steps against unintended network access in network-isolated jobs by (1) disabling NuGet’s restore auditing via the supported NuGetAudit MSBuild property and (2) preventing dotnet new maui from running its default restore post-action.
Changes:
- Replace
DOTNET_SDK_VULNERABILITY_CHECK_DISABLEwithNuGetAudit=falsein shared pipeline variables (and internal override) to stop vulnerability index lookups during restore. - Add
--no-restoreto thedotnet new mauitemplate creation steps across main/public/internal pipeline definitions.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| build-tools/automation/yaml-templates/variables.yaml | Sets NuGetAudit=false in shared pipeline variables to disable NuGet restore auditing. |
| build-tools/automation/azure-pipelines.yaml | Adds --no-restore when creating the MAUI template to prevent restore post-actions. |
| build-tools/automation/azure-pipelines-public.yaml | Mirrors the MAUI template --no-restore change for the public pipeline. |
| build-tools/automation/azure-pipelines-internal.yaml | Sets NuGetAudit=false for internal runs and adds --no-restore to MAUI template creation. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Internal build 14925232 reported CFSClean violations during Create MAUI template. Two independent behaviors allowed network access:
DOTNET_SDK_VULNERABILITY_CHECK_DISABLEis not NuGet's supported restore-audit switch and did not prevent the build from requesting NuGet's vulnerability index. NuGet audit is controlled by the MSBuild propertyNuGetAudit; Azure Pipeline variables are exported to the task environment and imported by MSBuild as properties, soNuGetAudit=falsedisables that advisory lookup pipeline-wide.dotnet new mauiruns a restore post-action by default. That restore had no project-specificNuGet.config, so it contacted public NuGet and workload advertising-manifest hosts. Passing--no-restorecreates the template without running that post-action.This does not remove the intended MAUI restore/build. The following Debug and Release build steps remain unchanged and explicitly pass
--configfile $(Build.SourcesDirectory)/maui/NuGet.config, keeping package acquisition on the configured sources. Disabling NuGet audit also does not disable package hash/signature validation; it only suppresses the external vulnerability-advisory lookup in these network-isolated jobs.Changes
NuGetAudit=falsein the shared pipeline variables and internal override.--no-restoreto MAUI template creation in the main, public, and internal pipeline definitions.Validation
Parsed all four changed YAML files successfully.
Ran
git diff --check.Verified every MAUI template-creation variant uses
--no-restoreand no obsolete audit variable remains.Verified
dotnet new --no-restorecreates a project without producing a restore assets file.Useful description of why the change is necessary.
Links to issues fixed (build link above; no GitHub issue).
Unit tests (not applicable to pipeline-only YAML; targeted checks listed above).