Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable NuGet audit #75049

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Enable NuGet audit #75049

wants to merge 2 commits into from

Conversation

jaredpar
Copy link
Member

This enables NuGet audit using the audit sources from nuget.org. This is the standard that is being pushed into all of our repositories. The end result is that we will get early warning on CVE and won't need to wait until CG scans on our scheduled builds reveal them.

I've set this up so that it warns not errors. That is deliberate because the audit warnings are asynchronous. Setting them up as errors would mean that builds, which were passing one minute, could start failing the next t. A warning here feels like the right balance but we can experiment and see how it goes.

Related dotnet/arcade#15019

This enables NuGet audit using the audit sources from nuget.org. This is
the standard that is being pushed into all of our repositories. The end
result is that we will get early warning on CVE and won't need to wait
until CG scans on our scheduled builds reveal them.

I've set this up so that it warns not errors. That is deliberate because
the audit warnings are asynchronous. Setting them up as errors would
mean that builds, which were passing one minute, could start failing the
next t. A warning here feels like the right balance but we can
experiment and see how it goes.

Related dotnet/arcade#15019
@jaredpar jaredpar requested review from a team as code owners September 11, 2024 14:51
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Sep 11, 2024
jjonescz
jjonescz previously approved these changes Sep 11, 2024
and then potentially fail on the next. This is meant to be an early warning system, not a
random CI failure generator.
-->
<WarningsNotAsErrors>$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this doesn't work, CI is failing with NU1903 :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes I know. It's quite frustrating. Trying to understand why that is happening.

@@ -16,6 +16,14 @@
<!-- TODO: https://github.com/dotnet/roslyn/issues/71667 -->
<NoWarn>$(NoWarn);NU1507</NoWarn>

<!--
Do not error on NuGet audit warnings. These are warnings that are introduced asynchronously as
new vulnerabilities are discovered. Having these as errors means that CI would pass on on job,
Copy link
Member

Choose a reason for hiding this comment

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

on on

typo: on on

@@ -163,7 +163,7 @@ public static ImmutableArray<byte> HexToByte(ReadOnlySpan<char> input)

return ImmutableCollectionsMarshal.AsImmutableArray(bytes);

byte parseByte(ReadOnlySpan<char> input, NumberStyles numberStyle)
static byte parseByte(ReadOnlySpan<char> input, NumberStyles numberStyle)
Copy link
Member

@jcouv jcouv Sep 11, 2024

Choose a reason for hiding this comment

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

I don't have any objection, but this change (and the one in Silverlight.cs) are unexpected in this PR. Just want to confirm these were intentional

Copy link
Member Author

Choose a reason for hiding this comment

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

It was intentional. It's a follow up comment from a previous PR that I forgot to merge.

Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

Done with review pass (iteration 1)

@jcouv jcouv self-assigned this Sep 11, 2024
@jaredpar jaredpar marked this pull request as draft September 11, 2024 22:39
@jaredpar jaredpar dismissed jjonescz’s stale review September 11, 2024 22:39

There were issues with this PR i did'n tsee locally

@jaredpar
Copy link
Member Author

Reverting to draft as there were a number of audit warnings. There is an up to date check issue in NuGet / MSBuild that caused me to see no errors locally and believe we were clean. This PR showed me there was still work left. Dealing with that locally and will update this PR In a bit.

eng/targets/Settings.props Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants