You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[6.8](../release-notes/NuGet-6.8.md)| .NET 8 SDK (8.0.100) | Visual Studio 2022 17.8 |[NuGetAudit](#running-a-security-audit-with-restore) for PackageReference |
27
+
|[6.10](../release-notes/NuGet-6.10.md)| N/A | Visual Studio 2022 17.10 |[NuGetAudit](#running-a-security-audit-with-restore) for packages.config|
28
+
|[6.11](../release-notes/NuGet-6.11.md)| .NET 8 SDK (8.0.400) | Visual Studio 2022 17.11 |[NuGetAuditSuppress](#excluding-advisories) for PackageReference |
29
+
|[6.12](../release-notes/NuGet-6.12.md)| .NET 9 SDK (9.0.100) | Visual Studio 2022 17.12 |[Audit sources](#audit-sources). [NuGetAuditSuppress](#excluding-advisories) for packages.config. |
30
30
31
31
## Running a security audit with `restore`
32
32
@@ -48,7 +48,7 @@ We recommend that audit is configured at a repository level.
48
48
| NuGetAuditLevel | low |`low`, `moderate`, `high`, and `critical`| The minimum severity level to report. If you'd like to see `moderate`, `high`, and `critical` advisories (exclude `low`), set the value to `moderate`|
49
49
| NuGetAudit | true |`true` and `false`| If you wish to not receive security audit reports, you can opt-out of the experience entirely by setting the value to `false`|
50
50
51
-
(1) NuGetAuditMode defaulted to `direct` when it was introduced in the .NET 8.0.100 SDK and VS 17.8. In .NET 9.0.100 SDK and VS 17.12 the default changed to `all`.
51
+
(1) NuGetAuditMode defaulted to `direct` when it was introduced in [the .NET 8.0.100 SDK and VS 17.8](../release-notes/NuGet-6.8.md). In [.NET 9.0.100 SDK and VS 17.12](../release-notes/NuGet-6.12.md) the default changed to `all`.
52
52
53
53
#### Audit Sources
54
54
@@ -70,7 +70,7 @@ Note that the [V2 protocol is deprecated](../nuget-org/overview-nuget-org.md#api
70
70
</configuration>
71
71
```
72
72
73
-
Audit sources are available from NuGet 6.12, .NET 9.0.100 SDK, and Visual Studio 2022 17.12.
73
+
Audit sources are available from [NuGet 6.12, .NET 9.0.100 SDK, and Visual Studio 2022 17.12](../release-notes/NuGet-6.12.md).
74
74
Prior to this version, NuGet Audit will only use package sources to download vulnerability information.
75
75
Audit sources are not used by `dotnet list package --vulnerable` at this time.
76
76
@@ -87,8 +87,8 @@ Define a `NuGetAuditSuppress` item with the `Include=` metadata set to the advis
87
87
88
88
Similar to the other NuGet audit configuration properties, `NuGetAuditSuppress` items can be defined at the project or repository level.
89
89
90
-
`NuGetAuditSuppress` is available for PackageReference projects starting from NuGet 6.11, Visual Studio 17.11, and the .NET 8.0.400 SDK.
91
-
It is available for packages.config with Visual Studio 17.12 and NuGet 6.12.
90
+
`NuGetAuditSuppress` is available for PackageReference projects starting from [NuGet 6.11, Visual Studio 17.11, and the .NET 8.0.400 SDK](../release-notes/NuGet-6.11.md).
91
+
It is available for packages.config from [Visual Studio 17.12 and NuGet 6.12](../release-notes/NuGet-6.12.md).
> Duplicate 'NuGetAuditSuppress' items found. Remove the duplicate items or use the Update functionality to ensure a consistent restore behavior. The duplicate 'NuGetAuditSuppress' items are: https://contoso.test/cve/1 , https://contoso.test/cve/1 .
17
+
18
+
### Issue
19
+
20
+
Sometimes when adding `NuGetAuditSuppress` items, you may end up adding an item for a particular package multiple times.
21
+
22
+
MSBuild projects commonly import multiple `.props` and `.targets` files, so the duplicates might not be in the same file, but may be in included files, such as `Directory.Build.props`, `Directory.Packages.props`, or `Directory.Build.targets`.
23
+
24
+
### Solution
25
+
26
+
Remove the duplicate item, so that it's included exactly once.
Copy file name to clipboardExpand all lines: docs/reference/errors-and-warnings/NU1901-NU1904.md
+1-8Lines changed: 1 addition & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,14 +47,7 @@ For example, `<NuGetAuditLevel>high</NuGetAuditLevel>`.
47
47
48
48
If you would like to suppress a specific advisory, add an MSBuild [NuGetAuditSuppress](../../concepts/Auditing-Packages.md#excluding-advisories) item.
49
49
For example `<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-g3q9-xf95-8hp5" />`.
50
+
`NuGetAuditSuppress` is available from [VS 17.11 and .NET 8.0.400 SDK](../../release-notes/NuGet-6.11.md) for projects using `PackageReference`, and from [VS 17.12](../../release-notes/NuGet-6.12.md) for projects using `packages.config`.
50
51
51
52
If you do not want NuGet to check for packages with known vulnerabilities during restore, add `<NuGetAudit>false</NuGetAudit>` inside a `<PropertyGroup>` in your project file, or a [`Directory.Build.props` file](/visualstudio/msbuild/customize-by-directory).
52
53
If you would like to run NuGet Audit on developer machines, but disable it on CI pipelines, you can take advantage of MSBuild importing environment variables, and create a NuGetAudit environment variable set to `false` in your pipeline definition.
53
-
54
-
> [!NOTE]
55
-
> The initial release of NuGetAudit [does not provide a way to suppress specific advisories (URLs)](https://github.com/NuGet/Home/issues/11926).
56
-
> It is a feature we intend on adding based on prioritization of other improvements.
57
-
>
58
-
> As a mitigation, you can add an appropriate `NoWarn` to your `PackageReference` declarations.
59
-
> For example, `<PackageReference Include="Contoso.Library" Version="1.0.0" NoWarn="NU1901" />`.
60
-
> However, be aware that this will prevent new vulnerabilities of the same severity from being reported to you.
0 commit comments