Skip to content

Enable NuGet audit on public feed without private feed access#1128

Merged
BenjaminMichaelis merged 3 commits into
mainfrom
benjaminmichaelis/nuget-audit-gap
May 18, 2026
Merged

Enable NuGet audit on public feed without private feed access#1128
BenjaminMichaelis merged 3 commits into
mainfrom
benjaminmichaelis/nuget-audit-gap

Conversation

@BenjaminMichaelis
Copy link
Copy Markdown
Member

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

  • Enabled NuGetAudit unconditionally
  • Added NuGetAuditSources property to restrict audit to the public nuget source when AccessToNugetFeed != true

This approach prevents NU1900 errors when the private feed is inaccessible while keeping security vulnerability checks active.

Changes

  • Directory.Packages.props — Set NuGetAudit=true and conditionally scope audit to the public nuget source in CI
  • docs/getting-started.md — Clarified that the private feed is optional; security audit functions without it

Impact

NuGet audit now runs in all CI paths (PR builds, CodeQL, deployments) and detects vulnerabilities in public packages, even without private feed credentials.

- 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
Copilot AI review requested due to automatic review settings May 18, 2026 00:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 NuGetAudit unconditionally.
  • Attempts to scope audit sources to the public NuGet source when AccessToNugetFeed is 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.

Comment thread Directory.Packages.props Outdated
Copilot AI review requested due to automatic review settings May 18, 2026 05:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@BenjaminMichaelis BenjaminMichaelis merged commit b8b0636 into main May 18, 2026
12 checks passed
@BenjaminMichaelis BenjaminMichaelis deleted the benjaminmichaelis/nuget-audit-gap branch May 18, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants