SKILLS/implementing-code-signing-for-artifacts/SKILL.md
This skill covers implementing code signing for build artifacts to ensure integrity and authenticity throughout the software supply chain. It addresses signing binaries, packages, and containers using GPG, Sigstore, and platform-specific signing tools, establishing trust chains, and verifying signatures in deployment pipelines.
npx skillsauth add pinkpixel-dev/skills-collection-2 implementing-code-signing-for-artifactsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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).
# 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: [email protected]
Expire-Date: 1y
%no-protection
EOF
# Export public key for distribution
gpg --armor --export [email protected] > signing-key.pub
# Export private key for CI/CD (store in secrets manager)
gpg --armor --export-secret-keys [email protected] > signing-key.priv
# .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 [email protected] "$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
# 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 [email protected] \
--certificate-oidc-issuer https://token.actions.githubusercontent.com
# Verify checksums
sha256sum --check checksums.sha256
{
"scripts": {
"prepublishOnly": "npm run build && npm run test"
},
"publishConfig": {
"provenance": true
}
}
# Publish npm package with provenance attestation
npm publish --provenance
| 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 |
Context: An open-source project needs to sign release artifacts so users can verify authenticity and detect tampering.
Approach:
cosign sign-blob using OIDC identityPitfalls: 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.
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 ([email protected], 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
development
Deploy and configure Rapid7 InsightVM Security Console and Scan Engines for authenticated and unauthenticated vulnerability scanning across enterprise environments.
testing
Detects and exploits ransomware kill switch mechanisms including mutex-based execution guards, domain-based kill switches, and registry-based termination checks. Implements proactive mutex vaccination and kill switch domain monitoring to prevent ransomware from executing. Activates for requests involving ransomware kill switch analysis, mutex vaccination, WannaCry-style domain kill switches, or malware execution guard detection.
testing
Designs and implements a ransomware-resilient backup strategy following the 3-2-1-1-0 methodology (3 copies, 2 media types, 1 offsite, 1 immutable/air-gapped, 0 errors on restore verification). Configures backup schedules aligned to RPO/RTO requirements, implements backup credential isolation to prevent ransomware from compromising backup infrastructure, and establishes automated restore testing. Activates for requests involving ransomware backup planning, backup resilience, air-gapped backup design, or backup recovery point objective configuration.
testing
Implement network segmentation based on the Purdue Enterprise Reference Architecture (PERA) model to separate industrial control system networks into hierarchical security zones from Level 0 physical process through Level 5 enterprise, enforcing strict traffic control between OT and IT domains.