New to Claude Skills? Learn how to install them →

mukul975 on GitHub

Implementing Code Signing for Artifacts

Free

Secure your build artifacts with trusted signatures.

Get this skill

Free · Opens the source repo

What Implementing Code Signing for Artifacts does

Implementing Code Signing for Artifacts is a skill designed for developers and DevSecOps teams looking to enhance the security of their software supply chain. This skill enables users to implement code signing for various build artifacts, including binaries, packages, and containers, using tools like GPG and Sigstore. By establishing trust chains and verifying signatures in deployment pipelines, it helps ensure that the artifacts being deployed are authentic and have not been tampered with.

The skill is particularly valuable in scenarios where compliance with security standards is required, such as meeting SLSA Level 2+ provenance requirements. It provides a structured workflow for generating and managing signing keys, signing artifacts in CI/CD pipelines, and verifying signatures during deployment. This process not only aids in preventing supply chain tampering but also helps in proving authenticity to customers who need assurance about the integrity of the software they are using.

With a focus on zero-trust deployment pipelines, this skill rejects unsigned artifacts, ensuring that only verified code is executed in production environments. It includes practical examples and scripts that can be integrated into existing CI/CD workflows, allowing teams to quickly adopt secure signing practices without extensive overhead or complexity.

While the skill is powerful, it is important to note that it is not intended for encrypting artifacts or for signing container images specifically, where alternative tools like cosign should be used. This skill is best suited for teams committed to enhancing their software security posture and looking to implement robust artifact integrity checks.

When to use it

Use this skill when you need to ensure the integrity and authenticity of build artifacts in your CI/CD pipeline, especially in compliance-driven environments.

When not to use it

This skill is not suitable for encrypting artifacts or for signing container images; consider using cosign for those purposes.

What you can build with it

Establishing Signed Release Pipeline

An open-source project can utilize this skill to sign release artifacts, allowing users to verify authenticity and detect tampering, thus enhancing trust in the software.

Implementing Zero-Trust Deployment

In a zero-trust environment, this skill ensures that only signed artifacts are deployed, rejecting any unsigned code and thereby reducing the risk of running malicious software.

Meeting Compliance Requirements

Organizations needing to comply with security standards can leverage this skill to provide cryptographic proof of artifact integrity and authenticity, fulfilling regulatory obligations.

How to install Implementing Code Signing for Artifacts

View source

1. Install with the skills CLI

npx skills add mukul975/anthropic-cybersecurity-skills/implementing-code-signing-for-artifacts --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by mukul975

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

Frequently asked questions about Implementing Code Signing for Artifacts

Similar skills