CodeSign Secure Documentation
  • Overview
    • About CodeSign Secure
    • Getting Started
    • Documentation Guide
    • Portal Overview
    • Troubleshooting
      • FAQ
    • Glossary
  • Reference Guide
    • Header Bar
      • CodeSign Secure Documentation
      • Swagger API
      • Profile Section
    • Dashboard
      • Key Performance Indicators
      • Issued Certificates
      • Signatures Generated
      • HSM Health Check
    • Keys and Certificates
      • Key and Certificate Lifecycle
    • App Management
    • Signing Requests
      • Approval Workflows
    • Signing Tools
    • Reports
      • Signing Request Report
      • Audit Trail
      • Certificate Report
      • Client Report
    • Logs
    • System Setup
      • Identity Store
      • Backup
      • User
      • Roles and Permissions
      • Email
      • Signing Projects
      • SSL/TLS Management
      • Environment
      • Plugins
  • Setup & Architecture
    • Identity and Access Control
    • Architecture and Concepts
    • Installation
      • Windows
        • Installing the Server
        • Ports and Protocols
        • High Availability and Backup
        • Upgrades and Compatibility
    • Security
      • Security Hardening Checklist
      • Client Authentication
      • Designing Signing Policies
  • Release Notes
    • Releases for 2026
      • v3.2.1
    • Releases for 2025
      • v3.2.0
    • Releases for 2024
      • v3.1.0
  • API Reference
    • Getting Started
    • Authorizing Requests
    • Securing API Access
    • Request and Response Conventions
    • Endpoint Reference
      • Signing
      • Signing Requests
      • Certificates
      • Applications and Environments
      • User Management
      • Permissions
      • Email
      • System Setup
      • Reports
      • Dashboard
      • License
  • Integration Guides
    • Signing Capabilities
      • Supported Formats and Platforms
      • Timestamping
      • Windows Signing - SignTool
        • Signing
        • Macro Signing
      • Apple Signing
      • AppX & MSIX Signing
      • Visual Studio ClickOnce
      • Jar Signing
      • Sign HLK/HCK using CodeSign Secure
      • NuGet Signing
      • Mage Signing
      • Sign OVA/OVF using Encryption Consulting’s Utility Tool
      • Utility Tool for code signing
      • Container Signing
      • PKCS11 Wrapper
        • APK Signing
        • OpenSSL Signing
        • XML Signing
        • JSign Tool Signing
        • Jarsigner Signing
        • GPG2, Debian & RPM Signing
      • Reproducible Build
        • Automated Hash Validation
        • Reproducible Build Process Flow
        • Pipeline Script Components
        • Hash Validation
    • CI/CD Integration
      • GitHub Actions
      • Jenkins
      • GitLab
      • Azure DevOps
      • TeamCity
      • Bamboo
      • Securing CI/CD Credentials

Securing CI/CD Credentials

Keep authentication certificates, passwords and passcodes out of pipeline code and logs.

What a pipeline needs
  • The authentication certificate (PFX) and its password.

  • The API user credentials: username and code or passcode.

  • For the PKCS#11 Wrapper, the ec_pkcs11client.ini file, which contains all of the above.

Rules for every pipeline
  • Never commit PFX files, INI files, passwords or passcodes to the repository.

  • Store them in the CI system’s secret store and inject them only into the signing step.

  • Use a dedicated CodeSign Secure user for each pipeline, with only the permissions it needs. See Recommended role design.

  • Restrict signing jobs to protected branches or tags, so pull requests from forks can’t reach the secrets.

  • Make sure secret values are masked in job logs, and don’t echo them.

  • Renew the authentication certificate before its Valid Till date and rotate passcodes on a schedule.

  • For automated jobs, use a certificate in an environment with No Approval, because approvals time out after 100 seconds. See Designing signing policies.

Secret stores by platform
PlatformWhere to store secretsTips
GitHub ActionsRepository or environment secretsUse environment secrets with required reviewers for release signing.
JenkinsCredentials (Secret file, Secret text)Bind them with withCredentials only around the signing step.
GitLab CI/CDCI/CD variables marked Masked and Protected; File-type variables for filesA File-type variable named EC_INI_FILE_PATH is written to a temporary file and the variable holds its path.
Azure DevOpsSecure files, secret variables, variable groups linked to Azure Key VaultUse the DownloadSecureFile task for the INI or PFX file.
TeamCityPassword parametersPassword values are hidden in the build log.
BambooPlan or global variablesBamboo masks variables whose names contain password, secret or passphrase.
Examples with the PKCS#11 Wrapper

The PKCS#11 Wrapper reads the path of its configuration file from EC_INI_FILE_PATH. Keep the INI file (and the PFX it points to) in the secret store and let the platform provide the path at run time.

GitLab CI/CD

Create a CI/CD variable of type File named EC_INI_FILE_PATH whose value is the content of your INI file, and mark it Protected.

sign-jar:
  stage: sign
  rules:
    - if: $CI_COMMIT_TAG
  script:
    - jarsigner -keystore NONE -storetype PKCS11 -storepass NONE -providerClass sun.security.pkcs11.SunPKCS11 -providerArg pkcs11properties.cfg -sigalg SHA256withRSA -tsa http://timestamp.digicert.com -signedjar app-signed.jar app.jar EC-Cert-020
Jenkins

Store the INI file as a Secret file credential with the ID ec-pkcs11-ini.

stage('Sign') {
  steps {
    withCredentials([file(credentialsId: 'ec-pkcs11-ini', variable: 'EC_INI_FILE_PATH')]) {
      sh 'jarsigner -keystore NONE -storetype PKCS11 -storepass NONE -providerClass sun.security.pkcs11.SunPKCS11 -providerArg pkcs11properties.cfg -sigalg SHA256withRSA -tsa http://timestamp.digicert.com -signedjar app-signed.jar app.jar EC-Cert-020'
    }
  }
}
Azure DevOps

Upload the INI file to Pipelines > Library > Secure files.

- task: DownloadSecureFile@1
  name: ecIni
  inputs:
    secureFile: 'ec_pkcs11client.ini'

- script: jarsigner -keystore NONE -storetype PKCS11 -storepass NONE -providerClass sun.security.pkcs11.SunPKCS11 -providerArg pkcs11properties.cfg -sigalg SHA256withRSA -tsa http://timestamp.digicert.com -signedjar app-signed.jar app.jar EC-Cert-020
  env:
    EC_INI_FILE_PATH: $(ecIni.secureFilePath)

Note: Replace EC-Cert-020 with the key label of your signing certificate. The PFX path inside the INI file must point to a location the agent can read. Keep that file on the agent in a folder only the build account can read, or download it in the same job from the secret store.

Windows KSP on build agents
  • Install the KSP on a self-hosted agent and set EC_Client_Auth and EC_Client_Pass for the account the agent service runs as. Also maintain the settings in the Registry Editor for the EC KSP.

  • Store the PFX in a folder only that account can read. See Protect credentials on build machines.

  • Restart the agent service after you change the variables, so new jobs pick them up.

  • Hosted, short-lived agents need the client installed in every job. Use self-hosted agents for KSP signing, and contact Encryption Consulting for unattended installation options.

On this Page:
Support Privacy Policy Terms of Service

Copyright Encryption Consulting LLC. All rights reserved.