Skip to content
Skillpedia
General coding35k · #5853

implementing-code-signing-for-artifacts

Teaches your AI agent to ship projects and manage infrastructure.

What it does

This tool adds a "digital signature" to your program files. This ensures the files haven't been tampered with and come from a trusted source, like a seal of authenticity.

When to use it

  • ✓When you want to ensure a program file hasn't been modified by hackers.
  • ✓When you need to prove to your customers that the software is genuinely yours and hasn't been tampered with.
  • ✓When you want your system to automatically reject any program that lacks this official "signature".

Example of what to ask your AI

“Digitally sign my program files to ensure they haven't been tampered with.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-code-signing-for-artifacts/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-code-signing-for-artifacts/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool uses cryptographic methods (like GPG or Sigstore) to create a unique signature for each file. This signature is later verified to confirm the file's integrity and origin.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill implementing-code-signing-for-artifacts

Or download just the file:

curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/implementing-code-signing-for-artifacts/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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

Term Definition
Code Signing Cryptographic process of signing software artifacts to verify publisher identity and artifact integrity
Detached Signature Signature stored in a separate file from the artifact, allowing independent distribution
Keyless Signing Sigstore's approach using short-lived certificates tied to OIDC identities instead of long-lived keys
Provenance Metadata describing how, where, and by whom an artifact was built
Transparency Log Append-only log (Rekor) that records all signing events for public auditability
Trust Chain Hierarchical chain from root CA to signing certificate establishing trust in the signer's identity
SLSA Supply-chain Levels for Software Artifacts — framework defining levels of supply chain security

…

FAQ

What is a digital signature?

It's like a security seal that proves a file is authentic and hasn't been changed since it was signed.

What's the difference between signing and encrypting?

Signing ensures authenticity and integrity (who made it and if it's unchanged). Encrypting protects the content, making it unreadable without a key.

Do I need a special key to sign?

Yes, you need a key pair (public and private) or use a service like Sigstore that manages this for you more simply (keyless).

Details

Original description by the author

Implements code signing for build artifacts (binaries, packages, containers) using GPG, Sigstore, and platform-specific signing tools, establishing trust chains and verifying signatures in deployment pipelines. Use when establishing artifact integrity checks against supply-chain tampering, proving authenticity to customers, building zero-trust pipelines that reject unsigned artifacts, or meeting S

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularity

GitHub stars
35k
Ranking position
#5853
License
Apache-2.0
Updated
8/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills