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.
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.
The README corresponds to the main development branch and may include unreleased features. The upgrade command only supports GitHub Actions references and does not work with container or Docker-based references. Users should ensure to pin versions to avoid mutable dependencies that pose security risks in CI/CD workflows.
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)
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.