Skip to main content

Validate that files matched by .sops.yaml creation_rules are SOPS-encrypted.

Project description

sops-checker

sops-checker inspects the creation_rules in .sops.yaml and verifies that each matching file already looks SOPS-encrypted. It can optionally encrypt files in place via sops --encrypt --in-place. You can grab the latest release from PyPI.

Built collaboratively with OpenAI Codex to streamline packaging and release prep.

SOPS itself is maintained by the getsops community and contributors—huge thanks to them for the encryption tooling this checker relies on.

Installation

pip install sops-checker

For development:

uv pip install -e .

Prerequisites for local workflows

  • sops – encrypts files when --fix is used; install via Homebrew (brew install sops) or your package manager.
  • mise – optional toolchain manager if you rely on the provided mise.toml to install Python/uv/just (mise install).
  • uv – fast package manager used in the Just recipes and CI (brew install uv).
  • just – task runner powering the commands in Justfile (brew install just).
  • gitleaks – required for just lint to run secrets scans (brew install gitleaks).

Usage

sops-checker [ROOT] [--fix]
  • ROOT defaults to the current directory.
  • --fix encrypts files that match the rules but are not SOPS-encrypted yet.
# Dry-run
sops-checker

# Automatically encrypt missing files
sops-checker --fix

The command exits non-zero when it finds unencrypted files (unless --fix succeeds).

Note: The current implementation inspects files described in .sops.yaml creation rules and only understands YAML/plaintext formats. Binary or non-YAML files are treated as unencrypted unless they have the SOPS magic header at the start of the file.

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

sops_checker-0.2.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

sops_checker-0.2.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sops_checker-0.2.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for sops_checker-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3d191acae8ba299c2285aeed4b0957afca1db7ecd1f5aa7f188503838e6c1655
MD5 fb84b8622074c18bbbb479ff41d67d08
BLAKE2b-256 e8d1cbe1053595bf929488d6c380bcb41b91eb5948eff7547798adb857c98233

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sops_checker-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e4462993686d8756c95a46255227babdd62d08201fb9825914ef1f35868e16c
MD5 4d4fca08939405e61b01c30e675a7471
BLAKE2b-256 fb4fb92c45ebdf197960b5e74955b3b08155ba1dfd415884e3ea819e7d0dedd8

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