Skip to main content

A SOPS companion CLI for editing, validating, and rekeying Kubernetes secrets

Project description

ksops

A SOPS companion CLI for editing, validating, and rekeying Kubernetes secrets.

ksops does not replace SOPS. It uses the sops binary for encryption, decryption, editing, and key updates, while adding small GitOps-oriented workflows around it.

Why ksops?

sops is excellent at encrypting files with age, GPG, KMS, and cloud key services. But Kubernetes secret repos often need repeatable project workflows around that core.

ksops is a DX layer on top of sops for Kubernetes/GitOps repositories:

sops ksops
Encrypt files for GitOps ✅ (via sops)
Edit encrypted files ksops edit
Decrypt to stdout ksops cat
Initialize Kubernetes Secret defaults ksops init
Encrypt all plaintext Secret manifests ksops encrypt-all
Rekey one file from .sops.yaml sops updatekeys ksops rekey
Rekey all encrypted manifests ksops rekey-all
Check plaintext Kubernetes Secret leaks ksops validate-all

Commands

ksops init
ksops edit secret.yaml
ksops cat secret.yaml
ksops encrypt secret.yaml --in-place
ksops encrypt-all ./manifests
ksops decrypt secret.yaml
ksops rekey secret.yaml
ksops rekey-all ./manifests
ksops validate-all ./manifests
ksops completion zsh

Configuration

Encryption policy stays in native .sops.yaml.

creation_rules:
  - path_regex: .*secret.*\.ya?ml$
    encrypted_regex: ^(data|stringData)$
    age: age1...

ksops init can create a starter .sops.yaml, but all encryption behavior is still handled by SOPS itself.

Shell Completion

source <(ksops completion bash)
source <(ksops completion zsh)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ksops-0.2.0.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ksops-0.2.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file ksops-0.2.0.tar.gz.

File metadata

  • Download URL: ksops-0.2.0.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ksops-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5cc81744d17b807b0c7b4a8cd4073ed29f65b4a5b68af96eb45e0a2ffff24d52
MD5 2b6869bd61a54e206fb92264b511029a
BLAKE2b-256 6342cb5e675195708818aeea6d8bd9a4905fc09dea8c80623076c405deacadab

See more details on using hashes here.

File details

Details for the file ksops-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ksops-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ksops-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d83f17fc75abe325ccfefd4119d4e32457e331f2c273eee9ad83de73771a112
MD5 1ef994a8c9cbc254d09dac325c313981
BLAKE2b-256 7c61d4863c63b36c0c2228b01f40a3fad92d18a05777176931dce002e8c2ceeb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page