Skip to content

Scope NuGet package signing to specific packages#4058

Merged
samsharma2700 merged 2 commits intomainfrom
dev/samsharma2700/fix_nupkg_signing
Mar 20, 2026
Merged

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

Conversation

@samsharma2700
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread eng/pipelines/onebranch/steps/esrp-code-signing-step.yml
Comment thread eng/pipelines/onebranch/jobs/build-signed-sqlclient-package-job.yml Outdated
@samsharma2700
Copy link
Copy Markdown
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
@samsharma2700 samsharma2700 merged commit e65124a into main Mar 20, 2026
7 of 12 checks passed
@samsharma2700 samsharma2700 deleted the dev/samsharma2700/fix_nupkg_signing branch March 20, 2026 16:29
@github-project-automation github-project-automation Bot moved this from To triage to Done in SqlClient Board Mar 20, 2026
mdaigle pushed a commit that referenced this pull request Apr 2, 2026
Co-authored-by: samsharma2700 <sarasharma@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Prevent scanning/signing of extra dlls and nupkg files

5 participants