Skip to content

Commit c12fa53

Browse files
Clarify requirements for security auditing in dotnet restore (#50271)
* Clarify requirements for security auditing in dotnet restore * update audit section * Update docs/core/tools/dotnet-restore.md Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent e518c6b commit c12fa53

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/core/tools/dotnet-restore.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,16 @@ Starting in .NET 8, `dotnet restore` includes NuGet security auditing. This audi
199199

200200
To opt out of the security auditing, set the `<NuGetAudit>` MSBuild property to `false` in your project file.
201201

202-
To retrieve the known vulnerability dataset, ensure that you have the NuGet.org central registry defined as one of your package sources:
202+
To retrieve the known vulnerability dataset from the NuGet.org central registry, define the following in the *nuget.config* file:
203203

204204
```xml
205205
<packageSources>
206206
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
207207
</packageSources>
208208
```
209209

210+
NuGet.org is the only package source that provides a vulnerability dataset for NuGet auditing. However, NuGet audits any source as long as the source provides the [`VulnerabilityInfo` resource](/nuget/api/vulnerability-info).
211+
210212
You can configure the level at which auditing will fail by setting the `<NuGetAuditLevel>` MSBuild property. Possible values are `low`, `moderate`, `high`, and `critical`. For example if you only want to see moderate, high, and critical advisories, you can set the property to `moderate`.
211213

212214
In .NET 8 and .NET 9, only *direct* package references are audited by default. Starting in .NET 10, NuGet audits both *direct* and *transitive* package references by default. You can change the mode by setting the `<NuGetAuditMode>` MSBuild property to `direct` or `all`.

0 commit comments

Comments
 (0)