Skip to content

feat(esrp): update NuGet signing config with Client ID and Key Vault#363

Merged
imran-siddique merged 2 commits intomicrosoft:mainfrom
imran-siddique:main
Mar 24, 2026
Merged

feat(esrp): update NuGet signing config with Client ID and Key Vault#363
imran-siddique merged 2 commits intomicrosoft:mainfrom
imran-siddique:main

Conversation

@imran-siddique
Copy link
Copy Markdown
Member

Align NuGet ESRP config with PyPI/npm pipelines. Remove deprecated ESRP_AAD_SECRET. Add Client ID + learncopilot KV.

imran-siddique and others added 2 commits March 23, 2026 18:33
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Align NuGet ESRP signing steps with PyPI/npm pipeline config:
- Client ID: a458522c-0359-4e92-9887-5fee1607c0c7
- Key Vault: learncopilot
- Remove ESRP_AAD_SECRET (no longer SFI-compliant)
- Add CP-401405 key code reference

TODO: Activate once PRSS certs are generated.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions bot added ci/cd CI/CD and workflows size/S Small PR (< 50 lines) labels Mar 24, 2026
@imran-siddique imran-siddique merged commit 76d880e into microsoft:main Mar 24, 2026
53 checks passed
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🤖 AI Agent: code-reviewer

Review Summary

This pull request updates the ESRP (Extended Security Release Program) configuration for NuGet signing to align with the configurations used for PyPI and npm pipelines. The changes include removing the deprecated ESRP_AAD_SECRET, adding a Client ID, and updating the Key Vault name to learncopilot. While the changes are mostly related to CI/CD configuration, there are a few areas of concern and improvement to address.


🔴 CRITICAL

  1. Hardcoded Client ID in Workflow

    • The Client ID (a458522c-0359-4e92-9887-5fee1607c0c7) is hardcoded in the workflow file. This is a sensitive value that should not be exposed in the source code, even if it is not a secret. Hardcoding such values increases the risk of accidental exposure and misuse.
    • Recommendation: Move the Client ID to GitHub Secrets or an environment variable and reference it in the workflow using ${{ secrets.CLIENT_ID }} or ${{ env.CLIENT_ID }}.
  2. Key Vault Name Exposure

    • The Key Vault name (learncopilot) is hardcoded in the workflow and pipeline files. While this is less sensitive than the Client ID, it still exposes internal infrastructure details that could be exploited by attackers.
    • Recommendation: Store the Key Vault name in a secure location, such as GitHub Secrets, and reference it in the workflow.
  3. Lack of ESRP Signing Implementation

    • The actual ESRP signing process is not implemented yet, and the workflow only contains placeholder commands. This could lead to unsigned DLLs or NuGet packages being published if the workflow is accidentally activated.
    • Recommendation: Add a safeguard to ensure that the workflow cannot proceed to publish unsigned artifacts. For example, add a conditional check to verify that the ESRP signing step has been completed successfully before proceeding to the publish step.

🟡 WARNING

  1. Backward Compatibility
    • The removal of ESRP_AAD_SECRET may break existing workflows or scripts that rely on this secret. While the PR description mentions that it is deprecated, it is important to ensure that all dependent systems have been updated to use the new configuration.
    • Recommendation: Clearly document the deprecation and removal of ESRP_AAD_SECRET in the release notes or migration guide.

💡 SUGGESTIONS

  1. Add Validation for ESRP Configuration

    • Before running the ESRP signing steps, validate that all required environment variables (e.g., ESRP_AAD_ID, CLIENT_ID, KEY_VAULT_NAME) are set. This can prevent runtime errors and make debugging easier.
    • Example:
      if [ -z "$ESRP_AAD_ID" ] || [ -z "$CLIENT_ID" ] || [ -z "$KEY_VAULT_NAME" ]; then
        echo "::error::Missing required ESRP configuration. Please check your environment variables."
        exit 1
      fi
  2. Improve Logging

    • Add more descriptive logging to the workflow steps to make it easier to debug issues. For example, log the names of the files being signed and the results of the signing operation.
  3. Document ESRP Onboarding Process

    • The workflow references the ESRP onboarding process (https://aka.ms/esrp-onboarding), but it would be helpful to include a brief summary or checklist in the repository's documentation for contributors who may need to work with ESRP.
  4. Use Conditional Activation for ESRP Steps

    • Since the ESRP signing process is not fully implemented, consider adding a feature flag or conditional activation mechanism to prevent accidental execution of incomplete steps. For example:
      if: ${{ env.ENABLE_ESRP_SIGNING == 'true' }}

Final Assessment

This pull request introduces necessary updates to align the NuGet ESRP configuration with other pipelines. However, the exposure of sensitive values (Client ID and Key Vault name) and the lack of safeguards for unsigned artifacts are critical issues that need to be addressed before merging. Additionally, backward compatibility and workflow robustness should be improved to ensure a smooth transition.

  • Merge Readiness: 🚫 Not ready for merge
  • Priority Fixes: Address the 🔴 CRITICAL issues before proceeding.

@github-actions
Copy link
Copy Markdown

🤖 AI Agent: security-scanner — Security Review of Pull Request

Security Review of Pull Request

This pull request updates the NuGet signing configuration to align with PyPI and npm pipelines, replacing the deprecated ESRP_AAD_SECRET with a Client ID and Key Vault integration. Below is a detailed security analysis of the changes.


Findings

1. Credential Exposure in Logs

🔴 CRITICAL
Issue:
The Client ID (a458522c-0359-4e92-9887-5fee1607c0c7) and Key Vault name (learncopilot) are being echoed in the logs during the CI/CD pipeline execution. This exposes sensitive information that could be used by attackers to target the Key Vault or attempt unauthorized access to ESRP services.

Attack Vector:
An attacker monitoring CI/CD logs (e.g., through a compromised developer account or a misconfigured logging system) could extract the Client ID and Key Vault name. This information could be used to launch targeted attacks, such as brute-forcing credentials or exploiting misconfigurations in the Key Vault.

Suggested Fix:

  • Remove all echo statements that log sensitive information like the Client ID and Key Vault name.
  • Use environment variables or secrets management to securely pass these values without exposing them in logs.
  • Example:
    run: |
      echo "Submitting DLLs for Authenticode signing via ESRP..."
      # Do not log sensitive information

2. Incomplete ESRP Configuration

🟠 HIGH
Issue:
The ESRP signing process is not fully implemented, and placeholder comments indicate that the actual signing process is pending. This leaves the pipeline in a partially configured state, which could lead to unsigned or improperly signed artifacts being published.

Attack Vector:
If an attacker gains access to the pipeline or the artifact repository, they could replace unsigned or improperly signed artifacts with malicious ones. Downstream consumers of the library would then unknowingly use compromised packages.

Suggested Fix:

  • Complete the ESRP signing configuration before merging this pull request.
  • Ensure that all artifacts are signed with the appropriate certificates from the Key Vault before being published.
  • Add a validation step to verify the signature of the artifacts before publishing.

3. Potential for Misconfigured Key Vault Access

🟡 MEDIUM
Issue:
The Key Vault name (learncopilot) is hardcoded in the pipeline configuration. If the Key Vault access policies are not properly configured, this could lead to unauthorized access to sensitive signing certificates.

Attack Vector:
An attacker with access to the pipeline or the Key Vault could potentially retrieve signing certificates and use them to sign malicious packages, compromising the trust chain for downstream users.

Suggested Fix:

  • Use a secure method to pass the Key Vault name, such as environment variables or a secrets management system.
  • Review and restrict Key Vault access policies to ensure that only the CI/CD pipeline has access to the required certificates.
  • Implement monitoring and alerting for unauthorized access attempts to the Key Vault.

4. Lack of Validation for ESRP Signing

🟠 HIGH
Issue:
There is no validation step to ensure that the artifacts have been successfully signed by ESRP before they are published. The pipeline currently includes placeholder warnings but does not enforce signing.

Attack Vector:
Unsigned or improperly signed artifacts could be published, allowing attackers to replace them with malicious versions. This undermines the trust chain for downstream users.

Suggested Fix:

  • Add a validation step to verify the ESRP signatures of all artifacts before publishing them.
  • Use tools like NuGet verify or equivalent commands for other package types to ensure the integrity and authenticity of the signed artifacts.

5. Dependency on External Services Without Fallback

🟡 MEDIUM
Issue:
The pipeline relies on external services (e.g., ESRP and Key Vault) for signing operations. If these services are unavailable or misconfigured, the pipeline may fail or produce unsigned artifacts.

Attack Vector:
An attacker could exploit downtime or misconfigurations in external services to disrupt the signing process, potentially leading to the publication of unsigned or improperly signed artifacts.

Suggested Fix:

  • Implement a fallback mechanism to prevent the publication of unsigned artifacts if the external services are unavailable.
  • Add monitoring and alerting for failures in the ESRP signing process.

Summary of Findings

Finding Severity Suggested Fix
Credential Exposure in Logs 🔴 CRITICAL Remove sensitive information from logs and use secure secrets management.
Incomplete ESRP Configuration 🟠 HIGH Complete ESRP signing setup before merging; validate signatures before publishing.
Potential for Misconfigured Key Vault 🟡 MEDIUM Use secure methods for Key Vault integration and review access policies.
Lack of Validation for ESRP Signing 🟠 HIGH Add a validation step to ensure artifacts are signed before publishing.
Dependency on External Services 🟡 MEDIUM Implement fallback mechanisms and monitoring for external service dependencies.

Final Recommendation

Do not merge this pull request until the critical and high-severity issues are resolved. The exposure of sensitive information in logs and the incomplete ESRP configuration pose significant security risks to the integrity of the signing process and the trust chain for downstream users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd CI/CD and workflows size/S Small PR (< 50 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant