Repository navigation
Configure NuGet audit sources and non-fatal vulnerability warnings - #20052
Conversation
Use data.nuget.org for vulnerability metadata without changing package feeds. Add the audit warning exemption missing from Arcade 10, with cleanup after upgrading to Arcade 11. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3b559861-b2bb-4130-9adc-0ebe3542e70a
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 20052Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 20052" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new audit source and conditional warning policy need automated regression coverage.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 2
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
Directory.Build.props — Automate the warning-policy validation |
|
NuGet.config — Add regression coverage for the audit source |
What changed in this PR
Configures NuGet vulnerability auditing without enabling public package downloads.
Changes:
- Adds the vulnerability-only NuGet audit source.
- Keeps NU1901–NU1904 visible but non-fatal unless explicitly opted in.
| File | Description |
|---|---|
NuGet.config |
Configures the audit-only NuGet endpoint. |
Directory.Build.props |
Exempts audit findings from warnings-as-errors. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Damian Edwards (@DamianEdwards) tagging you on this change: it adds data.nuget.org as an audit source and the NU1901–NU1904 warning exemption missing from our current Arcade version, with a comment to remove the exemption after upgrading to Arcade 11. |
Evaluate the repository warning policy and pass it to Arcade's standalone MSBuild restore without duplicating warning codes. Preserve strict audit opt-in and cover both entry points, audit source separation, and CI test routing. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3b559861-b2bb-4130-9adc-0ebe3542e70a
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Public Bash argument forwarding remains broken, and clean-only operations now unnecessarily bootstrap the SDK.
Get a fresh assessment by requesting another Copilot review.
Review tier: Balanced
Findings: 3
Open findings (3)
Resolved findings (2)
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Skip warning policy evaluation when Arcade short-circuits for clean, preserve argument boundaries in the public build and restore wrappers, and exercise these entry points in the regression matrix. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3b559861-b2bb-4130-9adc-0ebe3542e70a
Tests selectorSelects the full PR test matrix + all PR-gated jobs (ALL) — a rule matching 'Directory.Build.props' selects ALL Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
ce1e47b
into
main
|
✅ No documentation update needed. Step 5 branch taken: Triggered signals (1): Why this is a false positive: This PR only changes the microsoft/aspire repository's own internal build/CI infrastructure - The 'security' language in the PR body describes the build system's NuGet vulnerability-audit configuration and warning-as-error policy for building the aspire repo itself, not a user-facing Aspire security feature. I searched No docs PR was drafted since there is no concrete, in-scope documentation edit to make on the public Aspire docs site for this change. |
|
The CI build failed due to test failure(s) that appear unrelated to the PR changes. These may be flaky tests. Suspected flaky test(s):
Suggested actions:
You can re-run the failed jobs from the workflow run page. |


Description
Use public NuGet vulnerability metadata during developer and CI restores without adding nuget.org as a package download source or changing the existing package-source mappings.
auditSourcestoNuGet.config, clearing inherited audit sources and selectinghttps://data.nuget.org/v3/index.json.NU1901–NU1904toWarningsNotAsErrors, preserving inherited exemptions and respectingTreatNuGetAuditWarningsAsErrors=true. Remove this temporary assignment after upgrading to Arcade 11, which supplies it.WarningsNotAsErrorsthrougheng/WarningPolicy.projand forward the result through Arcade's-warnNotAsErroroption in both build entry points. Warning codes remain in one place rather than being duplicated in the scripts.-clean, preserving Arcade's SDK-free cleanup path.ALLin the test-trigger map. Document the policy in the contributor guide.Why forwarding is needed
The original change exposed existing vulnerable dependencies, but CI still failed: Arcade invokes a standalone
NuGet.targetsproject under MSBuild's/warnaserror. That project does not import ourDirectory.Build.props, so a project-levelWarningsNotAsErrorsassignment alone cannot protect its logger. Evaluating and forwarding the policy applies the exemption at that outer command-line level while preserving unrelated warnings as errors. See also dotnet/msbuild#10801.The pinned Arcade version,
10.0.0-beta.26423.1, already setsNuGetAuditMode=alland disables auditing whenOfficialBuild=true; these settings remain unchanged. It lacks the vulnerability-warning exemption supplied by newer Arcade. The Arcade 11 cleanup comment refers to that temporary assignment, not to the generic forwarding mechanism.Validation
build.shandrestore.shwrappers, including arguments containing spaces and semicolon-delimited warning lists.ALLtest routing for the build-policy inputs and public Bash wrappers.build.cmd/Arcade restore ofAspire.Npgsql.Testssucceeds while retaining the SSH.NETNU1903warning./p:TreatNuGetAuditWarningsAsErrors=truefails on that advisory as intended.Security considerations
Developer/CI restores retrieve public vulnerability metadata from
data.nuget.org. Package downloads continue using the existing approved feeds. Findings remain visible, rather than being suppressed, and official-build auditing behavior is unchanged. Warning exemptions do not remediate the underlying vulnerable dependencies.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?