Ensure that secrets are encrypted using sops before commiting to git.
- Requires: pre-commit
- Requires: sops
- CNCF - sops
- CNCF - Landscape
It looks for the sops configuration file .sops.yaml
in the project root
or anywhere in the path above the file being tested.
If this file is found and it contains creation_rules
, then the value of
path_regex
for each of the defined rules is used to check if a file should
be encrypted or not.
If a file name doesn't match any of the defined values for path_regex
it
will NOT be evaluated.
ONLY when no configuration file is found, then all .*.ya?ml
files are checked
as having kind: secret
, then they are evaluated.
Enable this hook by adding this to your project's .pre-commit-config.yaml
repos:
- repo: https://github.com/red-lichtie/sops-pre-commit-hook
rev: v1.2.1
hooks:
- id: sops-pre-commit-hook
This software is licensed under the LGPL V3 license (see the LICENSE file).