Skip to content

Commit e871a3e

Browse files
committed
add to toc and overview page
1 parent 96280b8 commit e871a3e

File tree

3 files changed

+31
-15
lines changed

3 files changed

+31
-15
lines changed

docs/core/compatibility/9.0.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,12 @@ If you're migrating an app to .NET 9, the breaking changes listed here might aff
9595

9696
| Title | Type of change | Introduced version |
9797
|-------------------------------------------------------------------------------|-------------------|--------------------|
98-
| [`dotnet watch` incompatible with Hot Reload for old frameworks](sdk/9.0/dotnet-watch.md) | Behavioral change | RC 1 |
98+
| ['dotnet restore' audits transitive packages](sdk/9.0/nugetaudit-transitive-packages.md) | Behavioral change | Preview 6 |
99+
| [`dotnet watch` incompatible with Hot Reload for old frameworks](sdk/9.0/dotnet-watch.md) | Behavioral change | RC 1 |
99100
| [`dotnet workload` commands output change](sdk/9.0/dotnet-workload-output.md) | Behavioral change | Preview 1 |
100101
| [`installer` repo version no longer documented](sdk/9.0/productcommits-versions.md) | Behavioral change | Preview 5 |
101102
| [Terminal logger is default](sdk/9.0/terminal-logger.md) | Behavioral change | Preview 1 |
102-
| [Version requirements for .NET 9 SDK](sdk/9.0/version-requirements.md) | Source incompatible | GA |
103+
| [Version requirements for .NET 9 SDK](sdk/9.0/version-requirements.md) | Source incompatible | GA |
103104
| [Warning emitted for .NET Standard 1.x target](sdk/9.0/netstandard-warning.md) | Source incompatible | Preview 6 |
104105
| [Warning emitted for .NET 7 target](sdk/9.0/net70-warning.md) | Source incompatible | GA |
105106

docs/core/compatibility/sdk/9.0/nugetaudit-transitive-packages.md

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
---
2-
title: "Breaking change: 'dotnet restore' produces security vulnerability warnings for transitive packages"
3-
description: Learn about a breaking change in the .NET 9 SDK where 'dotnet restore' produces security vulnerability warnings for transitive packages by default.
2+
title: "Breaking change: 'dotnet restore' audits transitive packages"
3+
description: Learn about a breaking change in the .NET 9 SDK where 'dotnet restore' also produces security vulnerability warnings for transitive packages by default.
4+
ms.date: 11/14/2024
45
---
5-
# 'dotnet restore' produces security vulnerability warnings for transitive packages
6+
# 'dotnet restore' audits transitive packages
67

78
The [`dotnet restore` command](../../../tools/dotnet-restore.md), which restores the dependencies and tools of a project, now produces security vulnerability warnings for transitive packages by default.
89

910
## Previous behavior
1011

11-
In [.NET 8, we introduced NuGetAudit](../8.0/dotnet-restore-audit.md), which emits warnings for packages with known security vulnerabilities.
12-
It was possible to change the `NuGetAuditMode` property to include all packages, but the default was to report only direct package references.
12+
In .NET 8, [NuGetAudit](../8.0/dotnet-restore-audit.md) was introduced to emit warnings for packages with known security vulnerabilities. By default, only direct package references were audited, however, it was possible to change the `NuGetAuditMode` property to include all packages.
1313

1414
## New behavior
1515

16-
`NuGetAuditMode` now defaults to `all`, if it has not been explicitly set.
17-
This means that transitive packages (dependencies of packages your project directly references) with known vulnerabilities will now cause warnings to be reported.
18-
If your project treats errors as warnings, this can cause restore failures.
16+
Starting in .NET 9, `NuGetAuditMode` defaults to `all` if it hasn't been explicitly set. This setting means that *transitive packages* (dependencies of packages your project directly references) with known vulnerabilities now cause warnings to be reported.
17+
If your project treats errors as warnings, this behavior can cause restore failures.
1918

2019
## Version introduced
2120

@@ -28,17 +27,29 @@ This change is a [behavioral change](../../categories.md#behavioral-change).
2827
## Reason for change
2928

3029
Packages with known vulnerabilities might cause your app to be exploitable, even if your project does not directly reference or use the vulnerable package.
31-
New features in .NET 9 also make it easier to investigate the package graph, and suppress advisories that are not relevant to how your app uses the vulnerable package.
30+
New features in .NET 9 also make it easier to investigate the package graph and to suppress advisories that aren't relevant to how your app uses the vulnerable package.
3231

3332
## Recommended action
3433

35-
- To explicitly reduce the probability of this breaking your build due to warnings, you can consider your usage of `<TreatWarningsAsErrors>` and use `<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>` to ensure known security vulnerabilities are still allowed in your environment.
34+
- To explicitly reduce the probability of this change breaking your build due to warnings, you can consider your usage of `<TreatWarningsAsErrors>` and use `<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>` to ensure known security vulnerabilities are still allowed in your environment.
3635

37-
- Use tools, such as `dotnet nuget why`, to find the top-level package that caused the transitive package with the known vulnerability to be included, and try to upgrade it to see if the transitive vulnerability goes away. If not, promote the transitive package to a top-level package by adding a `PackageReference` for it, and upgrade it to a newer version.
36+
- Use tools such as `dotnet nuget why` to find the top-level package that caused the transitive package with the known vulnerability to be included, and try to upgrade it to see if the transitive vulnerability goes away. If not, promote the transitive package to a top-level package by adding a `PackageReference` for it, and upgrade it to a newer version.
3837

39-
- If you want to suppress a specific advisory, you can add `<NuGetAuditSuppress Include="url" />` within an `<ItemGroup>`, where `url` is the URL reported in NuGet's warning message.
38+
- If you want to suppress a specific advisory, you can add `<NuGetAuditSuppress Include="url" />` item to your project file, where `url` is the URL reported in NuGet's warning message.
4039

41-
- If you want to only be warned of direct package references with known vulnerabilities, you can set `<NuGetAuditMode>` to `direct`.
40+
```xml
41+
<ItemGroup>
42+
<NuGetAuditSuppress Include="url" />
43+
</ItemGroup>
44+
```
45+
46+
- If you want to only be warned of direct package references with known vulnerabilities, you can set `<NuGetAuditMode>` to `direct` in your project file.
47+
48+
```xml
49+
<PropertyGroup>
50+
<NuGetAuditMode>direct</NuGetAuditMode>
51+
</PropertyGroup>
52+
```
4253

4354
## See also
4455

docs/core/compatibility/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ items:
9494
href: networking/9.0/query-redaction-logs.md
9595
- name: SDK and MSBuild
9696
items:
97+
- name: 'dotnet restore' audits transitive packages
98+
href: sdk/9.0/nugetaudit-transitive-packages.md
9799
- name: "`dotnet watch` incompatible with Hot Reload for old frameworks"
98100
href: sdk/9.0/dotnet-watch.md
99101
- name: "'dotnet workload' commands output change"
@@ -1776,6 +1778,8 @@ items:
17761778
items:
17771779
- name: .NET 9
17781780
items:
1781+
- name: 'dotnet restore' audits transitive packages
1782+
href: sdk/9.0/nugetaudit-transitive-packages.md
17791783
- name: "`dotnet watch` incompatible with Hot Reload for old frameworks"
17801784
href: sdk/9.0/dotnet-watch.md
17811785
- name: "'dotnet workload' commands output change"

0 commit comments

Comments
 (0)