SOPS:Secrets OPerationS

安装

https://github.com/getsops/sops

使用

创建 .sops.yaml 文件

creation_rules:
  - age: 'age1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' #age 公钥
#   - pgp: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' #PGP 公钥

age 使用笔记:age-note

gpg 使用笔记:gpg-note

age 的私钥存放在

C:\Users\24109\AppData\Roaming\sops\age\keys.txt

(待补充)

sops 加密二进制文件

sops --encrypt --input-type binary --output secret.json secret.bin
sops --decrypt --output-type binary --output secret.bin secret.json

sops 加密文本文件

sops -e -i secrets.txt
sops --encrypt --output secrets.enc.txt secrets.txt
sops secrets.enc.txt
sops --decrypt a.txt
sops --decrypt --output secrets.decrypted.txt secrets.enc.txt