How to Verify GitHub Artifact Attestations Offline

An air-gapped system can verify a GitHub build artifact using files prepared on a connected machine. Before transfer, obtain the attestation bundle for the exact artifact with gh attestation download and export the Sigstore trust material with gh attestation trusted-root. Bring the artifact, its bundle, the trusted root file and a trusted copy of GitHub CLI into the isolated environment. See GitHub’s offline verification guide.

Run gh attestation verify against the local artifact. Pass the expected repository with -R, the local bundle with --bundle and the trust material with --custom-trusted-root. Refresh the trusted root file whenever you bring in new signed material. An older offline copy cannot tell you whether signing keys have since been revoked. See the GitHub CLI verification reference.

The offline -R check uses the owner and repository names recorded at signing time. A repository keeps its numeric ID when renamed, and another repository can take the old name. For a bundle distributed alongside a release, record the expected repository ID from GitHub’s API while online and compare it with the source repository ID in the verified certificate. If the repository or owner has since been renamed, use the names recorded in the certificate for -R. Investigate any ID mismatch before accepting the build. See GitHub’s repository identity guidance.

Latest articles

Related articles