Skip to content

Scope NuGet package signing to specific packages#4058

Open
samsharma2700 wants to merge 2 commits intomainfrom
dev/samsharma2700/fix_nupkg_signing
Open

Scope NuGet package signing to specific packages#4058
samsharma2700 wants to merge 2 commits intomainfrom
dev/samsharma2700/fix_nupkg_signing

Conversation

@samsharma2700
Copy link
Contributor

@samsharma2700 samsharma2700 commented Mar 17, 2026

Description

Fixes : #4029

The ESRP NuGet signing steps in the OneBranch pipeline use a broad *.*nupkg glob pattern, meaning they scan and sign every .nupkg/.snupkg file found in the output directory, not just the package built by the current job. If dependency packages from upstream stages are inadvertently present, they get re-scanned and re-signed unnecessarily.

PR #3998 addressed the primary cause by isolating PACK_OUTPUT to a dedicated output/ directory (separate from packages/where downloaded dependencies live). This PR adds a defense layer by scoping the ESRP glob patterns so each job only matches its own packages.

Changes

  • esrp-code-signing-step.yml : Added nupkgPattern parameter (default *.*nupkg) used in the pkg signing path
  • compound-esrp-nuget-signing-step.yml : Added pattern parameter (default *.*nupkg) for malware scanning and code signing
  • build-signed-sqlclient-package-job.yml : Passes Microsoft.Data.SqlClient.[0-9]*nupkg, the [0-9] ensures versioned MDS packages match but Extension packages (starting with a letter after SqlClient) do not.
  • build-signed-csproj-package-job.yml : Passes .*nupkg, scopes to the exact package being built (e.g., Microsoft.Data.SqlClient.Internal.Logging.*nupkg)

@samsharma2700 samsharma2700 requested a review from a team as a code owner March 17, 2026 22:19
Copilot AI review requested due to automatic review settings March 17, 2026 22:19
@github-project-automation github-project-automation bot moved this to To triage in SqlClient Board Mar 17, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens ESRP malware scanning and NuGet signing in the OneBranch pipeline so each job signs only the package(s) it produces, avoiding redundant re-scanning/re-signing when other .nupkg/.snupkg files are present in the output directory.

Changes:

  • Add configurable NuGet package glob parameters to ESRP signing templates (nupkgPattern / pattern) with backward-compatible defaults.
  • Pass package-specific patterns from job templates to scope scanning/signing to the intended artifacts (SqlClient job + csproj-based package jobs).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
eng/pipelines/onebranch/steps/esrp-code-signing-step.yml Adds nupkgPattern parameter and uses it for NuGet malware scan + signing.
eng/pipelines/onebranch/steps/compound-esrp-nuget-signing-step.yml Adds pattern parameter and uses it to scope scanning/signing under $(PACK_OUTPUT).
eng/pipelines/onebranch/jobs/build-signed-sqlclient-package-job.yml Passes a SqlClient-specific nupkg pattern into ESRP signing.
eng/pipelines/onebranch/jobs/build-signed-csproj-package-job.yml Passes a per-package nupkg pattern into the compound NuGet signing step.

@samsharma2700
Copy link
Contributor Author

samsharma2700 commented Mar 17, 2026

@mdaigle mdaigle modified the milestone: 7.1.0-preview1 Mar 18, 2026
@samsharma2700 samsharma2700 self-assigned this Mar 18, 2026
@samsharma2700 samsharma2700 added this to the 7.0.1 milestone Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To triage

Development

Successfully merging this pull request may close these issues.

Prevent scanning/signing of extra dlls and nupkg files

3 participants