getsops / sops

Simple and flexible tool for managing secrets
https://getsops.io/
Mozilla Public License 2.0
16.34k stars 858 forks source link

`filestatus` Subcommand cannot handle mismatch between file extension and encrypted file format. #1591

Open Jafner opened 2 weeks ago

Jafner commented 2 weeks ago

I have a file secrets.env where the plain content is dotenv formatted.
I encrypt all files to json format.

When I run sops filestatus secrets.env I get:

[CMD]    FATA[0000] cannot check file status: cannot load encrypted file: invalid dotenv input line: {

I can decrypt the file just fine with sops decrypt --input-type json secrets.env

Is there another programmatic way to determine whether a file is properly sops-encrypted?

felixfontein commented 2 weeks ago

Unfortunately there's no --input-type for filestatus (yet). So right now there's no other way (except to reimplement filestatus in a programming language of your choice).

(Support for --input-type is definitely something that should be added.)