This repository is a fork of getsops/sops that adds STACKIT KMS as a key source. It exists until getsops/sops#2094 is merged. Files encrypted with this fork use the same metadata format as that pull request, so upstream SOPS releases that include it can read them.
Each release is an upstream release plus the STACKIT KMS change. Tags have the
form vX.Y.Z-stackit.N, where vX.Y.Z is the upstream release and N counts
fork releases on top of it.
Install with mise:
mise use -g 'github:stackitcloud/sops[bin=sops]'Or pin it per project in mise.toml:
[tools]
"github:stackitcloud/sops" = { version = "3.13.3-stackit.2", bin = "sops" }The release assets are plain binaries with the version in the name.
bin = "sops" installs them as sops.
mise can hide releases newer than its minimum release age, so latest may
find no version right after a release. Pin the version, or exclude the fork
from the check:
[settings]
minimum_release_age_excludes = ["github:stackitcloud/sops"]API=https://api.github.com/repos/stackitcloud/sops/releases/latest
VERSION=$(curl -fsSL "$API" \
| grep -o '"tag_name": *"[^"]*"' | cut -d'"' -f4)
OS=linux # or darwin
ARCH=amd64 # or arm64
BASE=https://github.com/stackitcloud/sops/releases/download
curl -fLo sops "${BASE}/${VERSION}/sops-${VERSION}.${OS}.${ARCH}"
chmod +x sops
sudo mv sops /usr/local/bin/sopsWindows binaries (sops-vX.Y.Z-stackit.N.amd64.exe) are on the
releases page.
The macOS binaries are signed by
Developer ID Application: Schwarz IT KG (5DR5YYJ2CC) and notarized by Apple.
To check one:
spctl --assess --type install --verbose /usr/local/bin/sopsARCH=amd64 # or arm64
curl -fsSL https://api.github.com/repos/stackitcloud/sops/releases/latest \
| grep -o "https://[^\"]*_${ARCH}\.deb" | xargs curl -fLO
sudo dpkg -i sops_*_${ARCH}.debARCH=x86_64 # or aarch64
curl -fsSL https://api.github.com/repos/stackitcloud/sops/releases/latest \
| grep -o "https://[^\"]*\.${ARCH}\.rpm" | xargs curl -fLO
sudo rpm -Uvh sops-*.${ARCH}.rpmdocker run --rm ghcr.io/stackitcloud/sops:v3.13.3-stackit.1 --versionImages are tagged vX.Y.Z-stackit.N and vX.Y.Z-stackit.N-alpine. There is
no latest tag.
go install does not work, because the Go module path stays
github.com/getsops/sops/v3.
Set the STACKIT KMS key in .sops.yaml:
creation_rules:
- stackit_kms: >-
projects/<project>/regions/eu01/keyRings/<ring>/keys/<key>/versions/1On the command line, use --stackit-kms or SOPS_STACKIT_KMS_IDS.
sops updatekeys, --add-stackit-kms and --rm-stackit-kms work like the
other key sources.
Authentication uses the default STACKIT SDK credentials.
The stackit branch is the latest upstream release tag plus the fork commits.
main is a copy of upstream main and gets no fork commits.
To release on top of a new upstream tag vNEW, where vOLD is the current
base:
git fetch upstream --tags
git checkout stackit
git rebase --onto vNEW vOLD stackitIf go.mod or go.sum conflict, take the upstream files and add the STACKIT
SDK again:
git checkout --ours go.mod go.sum
go get github.com/stackitcloud/stackit-sdk-go/core@latest \
github.com/stackitcloud/stackit-sdk-go/services/kms@latest
go mod tidy
git add go.mod go.sum
git rebase --continueThen push the upstream base tag, the branch and the release tag. The release
notes cover the changes since the base tag, which this repository keeps as
upstream/vNEW. Upstream v* tags must not be pushed here: they would start
the release workflow of the upstream commit. Wait for the CLI workflow to pass
on stackit before pushing the release tag.
git tag upstream/vNEW 'vNEW^{}'
git push origin upstream/vNEW
git push --force-with-lease origin stackit
git tag vNEW-stackit.1
git push origin vNEW-stackit.1The release workflow publishes binaries, packages and images. It signs and
notarizes the macOS binaries with the secrets of the signing environment,
see .github/workflows/release.yml.