> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usepitboard.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Verify a download

> Check that a release file came from Pitboard's release workflow, using attestations, checksums and signatures.

## What each release attests

An attestation is a signed record, kept by GitHub, of the workflow and commit that built a file. Every release attests:

* each command line archive, the macOS app's zip and the Windows app's installers, each with a CycloneDX bill of materials (`.cdx.json`)
* each Linux package, each with a bill of materials but the keyring's
* `install.sh`, the [install script](https://docs.usepitboard.com/install.md#install-with-the-script)
* `SHA256SUMS`, the checksums of the archives, the app's zip, the installers, the Linux packages and `install.sh`
* `appcast.xml` and `appcast-windows.xml`, the feeds the apps update from

Only a full release published as the latest carries the feeds. A release candidate, tagged like `v1.2.0-rc1`, or a beta, tagged like `v1.3.0-beta.1`, has neither.

Checking an attestation needs the [GitHub CLI](https://cli.github.com), `gh`, signed in to a GitHub account.

## Check an attestation

In the download's folder, run this with the file's name:

```sh theme={null}
gh attestation verify Pitboard-v<version>-macos.zip --repo datlechin/pitboard
```

When a workflow in `datlechin/pitboard` attested that exact file, `gh` prints `Verification succeeded!`. A changed file has no attestation, and the command fails.

With `--repo` alone, `gh` accepts an attestation from any workflow in the repository. Add `--signer-workflow` to accept only the release workflow:

```sh theme={null}
gh attestation verify Pitboard-v<version>-windows-x64.msi --repo datlechin/pitboard --signer-workflow datlechin/pitboard/.github/workflows/release.yml
```

## Check the checksums

Download `SHA256SUMS` from the same release and check its attestation first:

```sh theme={null}
gh attestation verify SHA256SUMS --repo datlechin/pitboard
```

On its own, `SHA256SUMS` shows only that a download arrived whole: anyone able to change the release could change a file and its checksum together.

Then, in the folder that holds both files, on macOS:

```sh theme={null}
shasum -a 256 -c SHA256SUMS --ignore-missing
```

On Linux:

```sh theme={null}
sha256sum -c SHA256SUMS --ignore-missing
```

`--ignore-missing` skips the files you did not download. A file that matches prints:

```text theme={null}
Pitboard-v<version>-macos.zip: OK
```

A file that differs prints `FAILED`, and the command exits with status 1.

On Windows, in PowerShell:

```powershell theme={null}
Select-String -Path SHA256SUMS -Pattern (Get-ChildItem Pitboard-*.msi, pitboard-*.zip | Get-FileHash).Hash
```

It prints the line of `SHA256SUMS` for each installer and zip in the folder that matches. A file whose line it does not print differs from the one the release published.

Homebrew, Scoop and the install script check what they install against these checksums, and refuse a download changed on the release page later. apt, dnf and zypper check what they install from Pitboard's repository against its signatures, as [Check the signature](#check-the-signature) says. On Windows, Scoop checks the zip it installs, and nothing else checks an installer or a zip for you.

## Check the install script

Piped to `sh`, the script runs unchecked. Its checksums cover the tarball it downloads, not the script. To check the script, download it and check its attestation:

```sh theme={null}
curl -fsSLO https://usepitboard.com/install.sh
gh attestation verify install.sh --repo datlechin/pitboard
```

After `Verification succeeded!`, run the file you checked:

```sh theme={null}
sh install.sh
```

## Check the signature

The macOS command line and app are signed with a Developer ID and notarised by Apple. On Linux, each RPM package is signed with [the repository key](https://docs.usepitboard.com/install/linux-repository.md), and the other files are not signed. The [code signing policy](https://docs.usepitboard.com/install/code-signing-policy.md) says which Windows files are signed, and from which release.

> [tab] macOS
>
> The app carries its notarisation ticket. Gatekeeper fetches the command line's ticket from Apple when you first open a copy downloaded in a browser.
>
> `spctl` asks Gatekeeper whether macOS would open a file. For the app:
>
> ```sh theme={null}
> spctl --assess --type execute -v /Applications/Pitboard.app
> ```
>
> ```text theme={null}
> /Applications/Pitboard.app: accepted
> source=Notarized Developer ID
> ```
>
> For the command line, use `--type install`, since `--type execute` accepts only apps. In the folder the tarball unpacked into:
>
> ```sh theme={null}
> spctl --assess --type install -v pitboard
> ```
>
> ```text theme={null}
> pitboard: accepted
> source=Notarized Developer ID
> ```
>
> Any developer's notarised file is `accepted`. With `-vvv` in place of `-v`, an `origin` line names the signer. For Pitboard's files, it ends with the team identifier `(D7HJ5TFYCU)`.

> [tab] Windows
>
> In PowerShell, in the download's folder, run this with the installer's name, or with `pitboard.exe` from the zip:
>
> ```powershell theme={null}
> Get-AuthenticodeSignature Pitboard-v<version>-windows-x64.msi
> ```
>
> From 1.0.0, its `Status` reads `Valid`. To see who signed it, run:
>
> ```powershell theme={null}
> (Get-AuthenticodeSignature Pitboard-v<version>-windows-x64.msi).SignerCertificate.Subject
> ```
>
> It prints `CN=SignPath Foundation, O=SignPath Foundation, L=Lewes, S=Delaware, C=US`. A beta published before 1.0.0 is not signed: its `Status` reads `NotSigned`.

> [tab] Linux
>
> On Fedora or openSUSE, import the repository key, then check an RPM package in its folder:
>
> ```sh theme={null}
> sudo rpm --import https://packages.usepitboard.com/pitboard-archive-keyring.asc
> rpm -K pitboard-app-v<version>-x86_64.rpm
> ```
>
> ```text theme={null}
> pitboard-app-v<version>-x86_64.rpm: digests signatures OK
> ```
>
> Without the key, it prints `digests SIGNATURES NOT OK`. Setting up [the repository](https://docs.usepitboard.com/install/linux-repository.md) imports the same key.
>
> A Debian package is not signed on its own. apt checks the signature of the repository's indices at each `apt update`, and they hold each package's checksum. Check a Debian package from a release file against `SHA256SUMS`.

For what else Pitboard protects against, see [SECURITY.md](https://github.com/datlechin/pitboard/blob/main/SECURITY.md#in-scope).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.