Skip to content

Add Visual Studio telemetry for package-signing revocation outcomes - #7851

Merged
dtivel merged 3 commits into
devfrom
dev-dtivel-revocation-telemetry
Nov 5, 2026
Merged

dtivel merged 3 commits into
devfrom
dev-dtivel-revocation-telemetry

Conversation

@dtivel

@dtivel dtivel commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Bug

Fixes: https://github.com/NuGet/Client.Engineering/issues/4041

Description

Add Visual Studio telemetry to measure how often NuGet accepts a signed package when it cannot determine whether its signing certificate has been revoked, and why packages are rejected.

Distinguish online/offline operation, skipped or inconclusive checks, warnings promoted to errors, and independent failures such as package tampering. Record final package acceptance separately from verification. Verification policy, public API signatures, and existing event names and status values remain unchanged. New fields contain only categories, booleans, and numeric flags.

Validation after the final code changes

  • Package-extraction telemetry tests: 20 passed on each of net472 and net10.0; zero failures or skips.
  • Solution-wide whitespace verification passed: .\cli\dotnet.exe format whitespace --verify-no-changes NuGet.sln --no-restore --verbosity minimal.
  • git diff --check passed.

cc @aortiz-msft

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

Capture certificate-check observations, rejection attribution, and final
package acceptance without changing verification policy or public API
signatures.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: d4ec79f1-0abb-4416-a2fe-ba6943ee07fd
@dtivel
dtivel marked this pull request as ready for review November 2, 2026 20:56
@dtivel
dtivel requested a review from a team as a code owner November 2, 2026 20:56
@dtivel
dtivel requested review from jeffkl and zivkan November 2, 2026 20:56
@jeffkl

jeffkl commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Inject the signature-verification opt-in through the package reader so the
mocked verifier runs on Linux and macOS. Leave production verification
policy and the process environment unchanged.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: d4ec79f1-0abb-4416-a2fe-ba6943ee07fd
@dtivel

dtivel commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

@jeffkl, thanks for the heads up! I think 498e3cf fixes them.

@jeffkl
jeffkl requested a balanced review from Copilot November 2, 2026 23:31
jeffkl
jeffkl previously approved these changes Nov 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Integrity and allow-list failures leave RejectionReasons as None, causing telemetry to misclassify known rejections as Unknown rather than Other.

2 open issues
What changed in this PR

Adds package-signing telemetry to NuGet’s verification and extraction pipeline for Visual Studio, distinguishing revocation observations from verification decisions and final package acceptance without changing verification policy or public API signatures.

Changes:

  • Captures signer and timestamp chain flags, evaluation status, and rejection categories.
  • Records warning promotion and final acceptance separately from signature verification.
  • Adds tests for revocation outcomes, fallback behavior, parsing failures, and warning policies.
File Description
test/​NuGet.Core.Tests/​NuGet.Packaging.Test/​SigningTests/​SignatureTrustAndValidityVerificationProviderTests.cs Tests chain observations and rejection attribution.
test/​NuGet.Core.Tests/​NuGet.Packaging.Test/​SigningTests/​CertificateChainUtilityTests.cs Tests excluded-root and incomplete-chain classification.
test/​NuGet.Core.Tests/​NuGet.Packaging.Test/​PackageExtractorTests.cs Tests acceptance telemetry under warning policies.
src/​NuGet.Core/​NuGet.Packaging/​Telemetry/​PackageSigningTelemetryEvent.cs Aggregates chain observations and rejection telemetry.
src/​NuGet.Core/​NuGet.Packaging/​Signing/​Verification/​SignatureVerificationSummary.cs Stores per-signature chain and rejection details.
src/​NuGet.Core/​NuGet.Packaging/​Signing/​Verification/​SignatureVerificationRejectionReasons.cs Defines rejection-category flags.
src/​NuGet.Core/​NuGet.Packaging/​Signing/​Verification/​SignatureTrustAndValidityVerificationProvider.cs Tracks observations and effective trust blockers.
src/​NuGet.Core/​NuGet.Packaging/​Signing/​Verification/​SignatureChainEvaluationStatus.cs Defines chain-evaluation categories.
src/​NuGet.Core/​NuGet.Packaging/​Signing/​Verification/​PackageVerificationResult.cs Carries summaries and rejection metadata.
src/​NuGet.Core/​NuGet.Packaging/​Signing/​Verification/​PackageSignatureVerifier.cs Preserves observations through parsing failures and emits telemetry.
src/​NuGet.Core/​NuGet.Packaging/​Signing/​Verification/​IntegrityVerificationProvider.cs Marks integrity failures as non-X509 blockers.
src/​NuGet.Core/​NuGet.Packaging/​Signing/​Verification/​AllowListVerificationProvider.cs Marks allow-list failures as non-X509 blockers.
src/​NuGet.Core/​NuGet.Packaging/​Signing/​Utility/​CertificateChainUtility.cs Classifies chain evaluation and retains diagnostic flags.
src/​NuGet.Core/​NuGet.Packaging/​Signing/​Timestamp/​Timestamp.cs Captures timestamp-chain observations and issue flags.
src/​NuGet.Core/​NuGet.Packaging/​Signing/​Signatures/​Signature.cs Captures signer-chain observations and issue flags.
src/​NuGet.Core/​NuGet.Packaging/​Signing/​Signatures/​RepositoryPrimarySignature.cs Preserves summary metadata when adding repository issues.
src/​NuGet.Core/​NuGet.Packaging/​Signing/​Signatures/​RepositoryCountersignature.cs Preserves summary metadata when adding countersignature issues.
src/​NuGet.Core/​NuGet.Packaging/​Signing/​Signatures/​AuthorPrimarySignature.cs Preserves summary metadata when adding author issues.
src/​NuGet.Core/​NuGet.Packaging/​Signing/​SignatureLog.cs Associates diagnostics with chain flags and converted log messages.
src/​NuGet.Core/​NuGet.Packaging/​PackageExtractor.cs Records final signature acceptance and warning-promotion causes.

Review effort: Balanced

Co-authored-by: Copilot <[email protected]>

Copilot-Session: d4ec79f1-0abb-4416-a2fe-ba6943ee07fd
@dtivel
dtivel merged commit 92e2a37 into dev Nov 5, 2026
18 checks passed
@dtivel
dtivel deleted the dev-dtivel-revocation-telemetry branch November 5, 2026 17:46
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.

3 participants