Metadata-Version: 2.4
Name: sops-checker
Version: 0.2.0
Summary: Validate that files matched by .sops.yaml creation_rules are SOPS-encrypted.
Project-URL: Homepage, https://github.com/psvmcc/sops-checker
Project-URL: Bug Tracker, https://github.com/psvmcc/sops-checker/issues
Project-URL: Changelog, https://github.com/psvmcc/sops-checker/releases
Author: Sergey Putko
License: MIT License
        
        Copyright (c) 2024 sops-checker authors
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: cli,devsecops,encryption,sops
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.8
Requires-Dist: pyyaml>=6.0
Provides-Extra: dev
Requires-Dist: pytest>=8.3.5; extra == 'dev'
Requires-Dist: ruff>=0.5.0; extra == 'dev'
Requires-Dist: yamllint>=1.35.0; extra == 'dev'
Description-Content-Type: text/markdown

# 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](https://pypi.org/project/sops-checker/).

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

SOPS itself is maintained by the [getsops community](https://github.com/getsops/sops) and contributors—huge thanks to them for the encryption tooling this checker relies on.

## Installation

```bash
pip install sops-checker
```

For development:

```bash
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

```bash
sops-checker [ROOT] [--fix]
```

- `ROOT` defaults to the current directory.
- `--fix` encrypts files that match the rules but are not SOPS-encrypted yet.

```bash
# 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.
