Enable NuGet audit on public feed without private feed access#1128
Merged
Conversation
- Remove conditional that disabled NuGet audit when AccessToNugetFeed != true - Add NuGetAuditSources property to restrict audit to 'nuget' source in CI - This prevents NU1900 errors when private Azure DevOps feed is unavailable - Audit now remains active during CI builds, detecting vulnerabilities in public packages - Update getting-started.md to clarify private feed is optional
Contributor
There was a problem hiding this comment.
Pull request overview
This PR keeps NuGet vulnerability auditing enabled even when private feed credentials are unavailable, aiming to preserve public package vulnerability checks in CI and local setups without private access.
Changes:
- Enables
NuGetAuditunconditionally. - Attempts to scope audit sources to the public NuGet source when
AccessToNugetFeedis not true. - Updates getting-started docs to clarify private feed access is optional.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
Directory.Packages.props |
Updates NuGet audit configuration based on private feed access. |
docs/getting-started.md |
Documents optional private feed access and placeholder-content behavior. |
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.
Problem
NuGet audit was unconditionally disabled when the private Azure DevOps feed is unavailable — the default in CI environments without credentials. This creates a security gap where vulnerabilities in public packages go undetected during builds.
Solution
NuGetAuditunconditionallyNuGetAuditSourcesproperty to restrict audit to the publicnugetsource whenAccessToNugetFeed != trueThis approach prevents NU1900 errors when the private feed is inaccessible while keeping security vulnerability checks active.
Changes
NuGetAudit=trueand conditionally scope audit to the public nuget source in CIImpact
NuGet audit now runs in all CI paths (PR builds, CodeQL, deployments) and detects vulnerabilities in public packages, even without private feed credentials.