Marcio Cunha

Binary Integrity Audit in CI/CD Pipelines with Sigstore-Based Cryptographic Signatures

Learn how to apply Sigstore-based cryptographic signatures in CI/CD pipelines to ensure no tampered software ever reaches production.

Marcio Cunha•4 min
Also available in:PortuguêsEspañol
Summary
  • Traditional signatures using long-lived keys frequently fail due to complexity and secret leakage risks in the infrastructure.
  • Using ephemeral identities connected to OIDC eliminates manual key management and binds artifacts directly to the correct user or pipeline.
  • Public transparency generated by immutable logs ensures rigorous auditability and prevents repudiation attacks on any executed build.
  • Automated verification in the deployment environment immediately blocks the execution of binaries lacking valid cryptographic attestations.
  • Adopting open supply chain standards drastically reduces the impact of compromises within the software delivery pipeline.

The Problem of Blind Trust in Continuous Delivery Pipelines

In modern software development, we blindly trust the servers that compile our programs. A CI/CD pipeline (the automated system that takes source code, tests it, and turns it into an executable program) is usually treated as a secure black box. In practice, this means that if an attacker manages to quietly modify a configuration file or inject a malicious step into the automation pipeline, they can alter the final binary without anyone noticing.

Historically, the answer to this risk has been the use of private cryptographic keys stored in secret vaults. Developers use these keys to sign the compiled program, proving it came from a trusted source. However, in real life, managing these long-lived keys is an operational nightmare. Keys expire, get stolen, or end up scattered across build servers without proper access control.

How Ephemeral Identity-Based Signing Works

Sigstore emerges as a modern solution to eliminate the headache of manual signature key management. Instead of creating a static private key file that lasts for years, the system generates an ephemeral key (lasting only a few minutes) right at the moment the build is running. In practice, the process validates the CI system's identity through an OIDC (OpenID Connect) provider, such as GitHub Actions or GitLab CI.

When the pipeline finishes compiling the program, it authenticates with the identity provider, which issues a secure token. Sigstore receives this token, checks if the identity is legitimate, and issues a very short-lived certificate. With this certificate, the pipeline signs the binary and discards the private key immediately. This means there are no static keys to steal, making the process much safer against prolonged intrusions.

Public Transparency Logs and Cryptographic Proof

Another fundamental pillar of this technology is the use of a public transparency log, known in the ecosystem as Rekor. Think of this as an immutable ledger, much like the technology behind cryptocurrencies, but focused exclusively on recording who signed what and when. In practice, every signature generated by your pipeline is published in this public log, creating an audit trail that cannot be erased or modified retroactively.

This approach solves a classic security problem called a repudiation attack, where someone with malicious intent denies having authorized a specific software release. Because the log is public and encrypted, anyone can check the mathematical proof that the binary running in production was generated exactly by the official, auditable commit, without tampering along the way.

Practical Implementation with Native Tools

To put this integrity audit into practice, we use command-line tools created specifically to interact with the Sigstore ecosystem, such as Cosign. The basic workflow consists of generating the artifact, requesting the signature based on the pipeline identity, and recording the transaction on the transparency server.

# Signing a binary using the CI/CD environment OIDC identity
cosign sign-blob --bundle sigstore-bundle.json my-binary-app

# Verifying the integrity and signature of the binary before deployment
cosign verify-blob \
  --bundle sigstore-bundle.json \
  --certificate-identity "https://github.com/organization/repository/.github/workflows/build.yml@refs/heads/main" \
  --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
  my-binary-app

In the example above, the first line creates a cryptographic signature bundle tied to the binary file. The second line performs rigorous verification before allowing the program to run on the target infrastructure, ensuring that the issuer and repository match exactly what is expected.

Ensuring Secure Deployment in Production

The final and most critical step of this entire architecture is the admission policy in the production environment. It is not enough to sign the binary in the pipeline if the server running it accepts any program that comes along. In practice, we configure execution nodes or orchestration tools to categorically reject any image or binary that lacks a valid attestation issued by Sigstore.

This final barrier prevents files manually injected by careless administrators or attackers with partial server access from running in production. Security is no longer based on blind trust and becomes guaranteed by automated mathematical proofs that are auditable in real time.

Final Considerations on the Supply Chain

Binary integrity in CI/CD pipelines is no longer a corporate luxury but a basic software engineering necessity. The use of identity-based signatures and transparency logs removes the operational complexity of traditional keys and raises the security level of the supply chain. By adopting these practices, teams gain speed without sacrificing predictability and absolute trust in the artifacts delivered to end-users.