getsops / getsops/sops

Inconsistent behaviour when the sops configuration file isn't in (a parent of) the current working directory

Open
#1,222 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
23.1k
Forks
1.1k
Avg merge
1d 11h
Merged PRs (30d)
9

Description

The below is with sops 3.7.3 on Debian 12 on x86 (installed using the deb provided on the releases page).

Take a folder structure as follows

.
└── foo
    ├── hello.yaml
    └── .sops.yaml

where .sops.yaml contains (trivial) GCP KMS creation rules, e.g.

creation_rules:
  - path_regex: .+
    gcp_kms: [REDACTED]
    encrypted_regex: .+

and hello.yaml contains

hello: world

Note the following.

  1. Encryption fails.
$ sops -e foo/hello.yaml
config file not found and no keys provided through command line options
  1. Creating an encrypted file interactively fails.
$ sops foo/goodbye.yaml
config file not found and no keys provided through command line options
  1. Encrypting the file from within foo works.
$ cd foo
$ sops -e hello.yaml > hello.enc.yaml
  1. Creating a new encrypted file from within foo works.
$ cd foo
$ sops goodbye.yaml
  1. Decrypting the encrypted file... works!
$ sops -d foo/hello.enc.yaml

That is, the behaviour of 5 is inconsistent with 1 and 2. For decryption, sops appears to walk from the file towards the root in search of configuration; for encryption, it doesn't.

Is this the intended design or is the inconsistency a minor mistake?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the four encryption and decryption commands from the report, comparing configuration lookup when run from the repository root and from foo. Trace the command entry points that load .sops.yaml and add regression coverage for matching configuration discovery during encryption, interactive creation, and decryption.

Written by the indexing model from the issue text.

Assessment

Tech stack
gcp, go
Domain
cli, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.