CG
SkillsImplementing Code Signing for Artifacts
Start Free
Back to Skills Library
DevSecOps🟡 Intermediate

Implementing Code Signing for Artifacts

This guide covers implementing code signing for build artifacts to ensure integrity and authenticity throughout the software supply chain.

4 min read6 code examples

Prerequisites

  • GPG key pair for traditional signing or Sigstore account for keyless signing
  • Code signing certificate from a Certificate Authority for public distribution
  • CI/CD pipeline with access to signing keys or identity provider
  • Verification infrastructure in deployment pipelines

Implementing Code Signing for Artifacts

When to Use

  • When establishing artifact integrity verification to prevent supply chain tampering
  • When compliance requires cryptographic proof that build artifacts are authentic and unmodified
  • When distributing software to customers who need to verify publisher identity
  • When implementing zero-trust deployment pipelines that reject unsigned artifacts
  • When meeting SLSA Level 2+ requirements for provenance and integrity

Do not use for encrypting artifacts (signing provides integrity, not confidentiality), for container image signing specifically (use cosign), or for source code authentication (use commit signing).

Prerequisites

  • GPG key pair for traditional signing or Sigstore account for keyless signing
  • Code signing certificate from a Certificate Authority for public distribution
  • CI/CD pipeline with access to signing keys or identity provider
  • Verification infrastructure in deployment pipelines

Workflow

Step 1: Generate and Manage Signing Keys

# Generate GPG key for artifact signing
gpg --full-generate-key --batch <<EOF
Key-Type: eddsa
Key-Curve: ed25519
Subkey-Type: eddsa
Subkey-Curve: ed25519
Name-Real: CI Build System
Name-Email: ci-signing@company.com
Expire-Date: 1y
%no-protection
EOF

# Export public key for distribution
gpg --armor --export ci-signing@company.com > signing-key.pub

# Export private key for CI/CD (store in secrets manager)
gpg --armor --export-secret-keys ci-signing@company.com > signing-key.priv

Step 2: Sign Build Artifacts in CI/CD

# .github/workflows/build-sign.yml
name: Build and Sign

on:
  push:
    tags: ['v*']

jobs:
  build-sign:
    runs-on: ubuntu-latest
    permissions:
      contents: write
      id-token: write  # For Sigstore keyless signing
    steps:
      - uses: actions/checkout@v4

      - name: Build artifacts
        run: |
          make build
          sha256sum dist/* > dist/checksums.sha256

      - name: Import GPG Key
        run: |
          echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import
          gpg --list-secret-keys

      - name: Sign artifacts
        run: |
          for file in dist/*; do
            gpg --detach-sign --armor --local-user ci-signing@company.com "$file"
          done

      - name: Install cosign for keyless signing
        uses: sigstore/cosign-installer@v3

      - name: Keyless sign with Sigstore
        run: |
          for file in dist/*.tar.gz; do
            cosign sign-blob "$file" \
              --output-signature "${file}.sig" \
              --output-certificate "${file}.cert" \
              --yes
          done

      - name: Create Release with signed artifacts
        uses: softprops/action-gh-release@v2
        with:
          files: |
            dist/*
            dist/*.asc
            dist/*.sig
            dist/*.cert

Step 3: Verify Signatures in Deployment Pipeline

# Verify GPG signature
gpg --import signing-key.pub
gpg --verify artifact.tar.gz.asc artifact.tar.gz

# Verify Sigstore keyless signature
cosign verify-blob artifact.tar.gz \
  --signature artifact.tar.gz.sig \
  --certificate artifact.tar.gz.cert \
  --certificate-identity ci-signing@company.com \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

# Verify checksums
sha256sum --check checksums.sha256

Step 4: Sign npm Packages with Provenance

{
  "scripts": {
    "prepublishOnly": "npm run build && npm run test"
  },
  "publishConfig": {
    "provenance": true
  }
}
# Publish npm package with provenance attestation
npm publish --provenance

Key Concepts

TermDefinition
Code SigningCryptographic process of signing software artifacts to verify publisher identity and artifact integrity
Detached SignatureSignature stored in a separate file from the artifact, allowing independent distribution
Keyless SigningSigstore's approach using short-lived certificates tied to OIDC identities instead of long-lived keys
ProvenanceMetadata describing how, where, and by whom an artifact was built
Transparency LogAppend-only log (Rekor) that records all signing events for public auditability
Trust ChainHierarchical chain from root CA to signing certificate establishing trust in the signer's identity
SLSASupply-chain Levels for Software Artifacts — framework defining levels of supply chain security

Tools & Systems

  • GPG/PGP: Traditional asymmetric cryptography tool for signing and verifying artifacts
  • Sigstore (cosign): Modern keyless signing infrastructure using OIDC identity and transparency logs
  • Rekor: Sigstore's transparency log recording all signing events immutably
  • Fulcio: Sigstore's certificate authority issuing short-lived certificates bound to OIDC identities
  • notation: Microsoft's artifact signing tool for OCI registries (Project Notary v2)

Common Scenarios

Scenario: Establishing Signed Release Pipeline

Context: An open-source project needs to sign release artifacts so users can verify authenticity and detect tampering.

Approach:

  1. Use Sigstore keyless signing in GitHub Actions (no key management overhead)
  2. Sign all release binaries with cosign sign-blob using OIDC identity
  3. Generate and sign checksums file for bulk verification
  4. Upload signatures, certificates, and checksums alongside release artifacts
  5. Document verification instructions in the project README
  6. Add verification step to the Homebrew formula or apt repository

Pitfalls: GPG key compromise requires revoking and re-signing all artifacts. Sigstore keyless signing avoids this by using ephemeral keys. Long-lived signing keys in CI/CD secrets are a supply chain risk if the CI system is compromised.

Output Format

Artifact Signing Report
========================
Pipeline: Build and Sign v2.3.0
Date: 2026-02-23
Signing Method: Sigstore Keyless + GPG

SIGNED ARTIFACTS:
  app-v2.3.0-linux-amd64.tar.gz
    GPG:      PASS (ci-signing@company.com, EdDSA/Ed25519)
    Sigstore: PASS (Rekor entry: 24658135, Fulcio cert issued)
    SHA256:   a1b2c3d4...

  app-v2.3.0-darwin-arm64.tar.gz
    GPG:      PASS
    Sigstore: PASS (Rekor entry: 24658136)
    SHA256:   e5f6g7h8...

  checksums.sha256
    GPG:      PASS (detached signature)

TRANSPARENCY LOG:
  Entries recorded: 3
  Log index range: 24658135-24658137
  Verification: https://search.sigstore.dev

Verification Criteria

Confirm successful execution by validating:

  • [ ] All prerequisite tools and access requirements are satisfied
  • [ ] Each workflow step completed without errors
  • [ ] Output matches expected format and contains expected data
  • [ ] No security warnings or misconfigurations detected
  • [ ] Results are documented and evidence is preserved for audit

Compliance Framework Mapping

This skill supports compliance evidence collection across multiple frameworks:

  • SOC 2: CC8.1 (Change Management), CC6.1 (Logical Access)
  • ISO 27001: A.14.2 (Secure Development), A.12.1 (Operational Procedures)
  • NIST 800-53: SA-11 (Developer Testing), CM-3 (Configuration Change Control), SA-15 (Development Process)
  • NIST CSF: PR.IP (Information Protection), PR.DS (Data Security)

Claw GRC Tip: When this skill is executed by a registered agent, compliance evidence is automatically captured and mapped to the relevant controls in your active frameworks.

Deploying This Skill with Claw GRC

Agent Execution

Register this skill with your Claw GRC agent for automated execution:

# Install via CLI
npx claw-grc skills add implementing-code-signing-for-artifacts

# Or load dynamically via MCP
grc.load_skill("implementing-code-signing-for-artifacts")

Audit Trail Integration

When executed through Claw GRC, every step of this skill generates tamper-evident audit records:

  • SHA-256 chain hashing ensures no step can be modified after execution
  • Evidence artifacts (configs, scan results, logs) are automatically attached to relevant controls
  • Trust score impact — successful execution increases your agent's trust score

Continuous Compliance

Schedule this skill for recurring execution to maintain continuous compliance posture. Claw GRC monitors for drift and alerts when re-execution is needed.

Use with Claw GRC Agents

This skill is fully compatible with Claw GRC's autonomous agent system. Deploy it to any registered agent via MCP, and every execution will be logged in the tamper-evident audit trail.

// Load this skill in your agent
npx claw-grc skills add implementing-code-signing-for-artifacts
// Or via MCP
grc.load_skill("implementing-code-signing-for-artifacts")

Tags

devsecopscicdcode-signingsupply-chainsigstoresecure-sdlc

Related Skills

DevSecOps

Securing GitHub Actions Workflows

5m·intermediate
DevSecOps

Implementing Infrastructure as Code Security Scanning

4m·intermediate
DevSecOps

Implementing Policy as Code with Open Policy Agent

5m·intermediate
DevSecOps

Implementing Secret Scanning with Gitleaks

6m·intermediate
DevSecOps

Integrating DAST with OWASP Zap in Pipeline

4m·intermediate
DevSecOps

Integrating SAST Into GitHub Actions Pipeline

6m·intermediate

Skill Details

Domain
DevSecOps
Difficulty
intermediate
Read Time
4 min
Code Examples
6

On This Page

When to UsePrerequisitesWorkflowKey ConceptsTools & SystemsCommon ScenariosOutput FormatVerification CriteriaCompliance Framework MappingDeploying This Skill with Claw GRC

Deploy This Skill

Add this skill to your Claw GRC agent and start automating.

Get Started Free →