Installing Salt CLI

For generating attestations in CI/CD pipelines, you may run download and run the Salt CLI.

Xygeni offers custom tasks that simplify installation on certain CI/CD platforms. For Azure DevOps, you can use Xygeni Build Attestationarrow-up-right to generate SLSA provenance attestations and Xygeni Attestation Verifierarrow-up-right to verify software attestations.

Install Salt CLI

Xygeni provides bootstrap scripts (get-salt.sh for mac/Linux, get-salt.ps1 for Windows) that download the Salt CLI, verify its SHA-256 checksum, and install it in a single step.

1. Download the bootstrap script

curl -sSfLO https://get.xygeni.io/latest/salt/get-salt.sh

2. Review the script

The script downloads the Salt CLI, verifies its SHA-256 checksum (from a separate source on GitHub), and installs it. You can review its contents — it is intentionally kept short:

set -e
# Download helper: uses curl if available, falls back to wget
fetch() { curl -sSfL "$1" 2>/dev/null || wget -qO- "$1"; }
DIR="${1:-$HOME/.xygeni_salt}"
# Check and exit if already installed
[ -x "$DIR/salt" ] && { echo "Salt CLI already installed in $DIR" >&2; exit 0; }
ZIP="$(mktemp).zip"
trap 'rm -f "$ZIP"' EXIT
# Download Salt CLI and checksum
fetch https://get.xygeni.io/latest/salt/salt.zip > "$ZIP"
EXPECT=$(fetch https://raw.githubusercontent.com/xygeni/xygeni/main/checksum/latest/salt.zip.sha256)
ACTUAL=$(sha256sum "$ZIP" 2>/dev/null || shasum -a 256 "$ZIP")
ACTUAL=$(echo "$ACTUAL" | awk '{print $1}')
# Verify checksum
[ "$EXPECT" = "$ACTUAL" ] || { echo "Checksum mismatch: expected $EXPECT, got $ACTUAL" >&2; exit 1; }
# Extract Salt CLI: uses unzip if available, falls back to jar
mkdir -p "$DIR"
unzip -qo "$ZIP" -d "$DIR" 2>/dev/null || (cd "$DIR" && jar xf "$ZIP")
mv "$DIR/xygeni_salt"/* "$DIR/" && rmdir "$DIR/xygeni_salt"  # flatten nested dir
echo "Salt CLI installed in $DIR"

3. Verify the script checksum

circle-exclamation

If the checksum matches, you will see:

If it does not match, you will see:

triangle-exclamation

4. Run the script

circle-info

The script fetches the checksum from GitHub (raw.githubusercontent.com/xygeni/xygeni) while the Salt CLI zip is downloaded from get.xygeni.io — an attacker would need to compromise both sites to bypass the integrity check.

circle-info

This step is optional but highly recommended to facilitate running Salt commands.

Option 1 — Symlink in ~/.local/bin (recommended, if ~/.local/bin is already in PATH):

Option 2 — Shell alias in ~/.bashrc or ~/.zshrc:

Option 3 — Add to PATH (fallback):

circle-info

You may add --no-banner (or -nb) to the alias to hide the SALT banner, so logfiles are leaner: alias salt='$HOME/.xygeni_salt/salt -nb'

Execute Salt

Once installed, you can execute salt.

Please note that you need to provide a Xygeni Token to salt to make it work.

circle-info

Please see Salt Authentication and Salt Command-Line Reference for further information.

Last updated