10/12 free views
Tool
CLI
DevSecOps Tools

ratchet

by sethvargo

843stars
38forks
10watchers
Updated 9 months ago
About

Ratchet is a CLI tool that secures CI/CD workflows by automating version pinning and updating of upstream dependencies to immutable references.

A tool for securing CI/CD workflows with version pinning.

Primary Use Case

Ratchet is used by DevOps and security engineers to enhance the security and reliability of CI/CD pipelines by replacing mutable version references with fixed, checksummed versions. It automates the tedious process of resolving and maintaining pinned versions for various CI/CD platforms, reducing risks associated with mutable dependencies.

Key Features
  • Automates pinning and unpinning of upstream CI/CD workflow versions
  • Supports multiple CI/CD platforms including GitHub Actions, CircleCI, GitLab CI, Google Cloud Build, Harness Drone, and Tekton
  • Resolves mutable references to immutable checksummed versions
  • Maintains original version constraints as comments for traceability
  • Provides commands to pin, unpin, update, and upgrade workflow references
  • Distributes as a single static binary, container image, or via package managers
  • Focuses on improving security and reliability in DevSecOps pipelines

Installation

  • Install via Homebrew: brew install ratchet (community supported, may not be latest)
  • Download a single static binary from the releases page
  • Use the container image from the container registry
  • Install via Nix: nix run 'github:NixOS/nixpkgs/nixpkgs-unstable#ratchet' -- --help (community supported)
  • Install via Go: go install github.com/sethvargo/ratchet@latest
  • Compile from source (not officially supported)

Usage

>_ ratchet pin workflow.yml

Pins all mutable references in the input CI/CD workflow file to immutable versions.

>_ ratchet pin -parser circleci circleci.yml

Pins versions in a CircleCI configuration file.

>_ ratchet unpin workflow.yml

Removes pinned versions from the input workflow file, reverting to original mutable references.

>_ ratchet update workflow.yml

Updates all pinned versions to the latest matching version constraints.

>_ ratchet upgrade workflow.yml

Upgrades all GitHub Actions references to their latest versions, updating both the ref and ratchet comment.

>_ ratchet pin -out workflow-compiled.yml workflow.yml

Pins versions and outputs the result to a different file path.

>_ ratchet unpin -out workflow.yml workflow-compiled.yml

Unpins versions and writes output to a specified file.

>_ ratchet update -parser cloudbuild cloudbuild.yml

Updates pinned versions in a Google Cloud Build configuration file.

Security Frameworks
Defense Evasion
Initial Access
Execution
Persistence
Impact
Usage Insights
  • Integrate Ratchet into CI/CD pipelines to enforce immutable references and prevent supply chain attacks caused by mutable dependencies.
  • Use Ratchet to automate compliance with secure software development lifecycle practices by ensuring pinned versions are auditable and traceable.
  • Combine Ratchet with vulnerability scanning tools to detect outdated or vulnerable pinned dependencies proactively.
  • Leverage Ratchet's multi-platform support to standardize security controls across diverse CI/CD environments.
  • In purple team exercises, simulate attacks exploiting mutable dependencies and demonstrate how Ratchet mitigates these risks effectively.

Docs Take 2 Hours. AI Takes 10 Seconds.

Ask anything about ratchet. Installation? Config? Troubleshooting? Get answers trained on real docs and GitHub issues—not generic ChatGPT fluff.

This tool hasn't been indexed yet. Request indexing to enable AI chat.

Admin will review your request within 24 hours

Security Profile
Red Team30%
Blue Team85%
Purple Team70%
Details
LicenseApache License 2.0
LanguageGo
Open Issues40
Topics
cicd
dependency
security